[code]s do not be visible for guests
+2
brandon_g
DeathLess
6 posters
Page 1 of 1
[code]s do not be visible for guests
Hey!
Is possible to codes do not be visible for guests, only for members?
Ex.: At the place of the codes guests will see "Sorry, codes are visible for members only, please login or signup to view it".
Is this possible?
Is possible to codes do not be visible for guests, only for members?
Ex.: At the place of the codes guests will see "Sorry, codes are visible for members only, please login or signup to view it".
Is this possible?
Last edited by DeathLess on August 30th 2017, 11:54 am; edited 1 time in total
Re: [code]s do not be visible for guests
Hello,
There is no option for this in the acp, however, you could use the hide code for code in posts and this will hide it for anyone who didnt reply to the topic (except for staff who can see so long as they have moderation rights to the section), so long as guests can"t post this method could do something similar to what your looking to do.
-Brandon
There is no option for this in the acp, however, you could use the hide code for code in posts and this will hide it for anyone who didnt reply to the topic (except for staff who can see so long as they have moderation rights to the section), so long as guests can"t post this method could do something similar to what your looking to do.
-Brandon

![[code]s do not be visible for guests Brando10](https://i.servimg.com/u/f28/11/40/02/06/brando10.png)
Remember to mark your topic
![[code]s do not be visible for guests Solved15](https://i.servimg.com/u/f62/17/48/02/71/solved15.png)
General Rules | Tips & Tricks | FAQ | Forgot Founder Password?
![[code]s do not be visible for guests Scre1476](https://i.servimg.com/u/f28/11/40/02/06/scre1476.png)
Team Leader
Review Section Rules | Request A Review | Sticker Points
Re: [code]s do not be visible for guests
HI, yes it's very much possible with using JavaScript to restrict some guests from viewing code. Even I use the same method on my site to prevent guests from using the codes members only can use.
It only depends on what codes you are wanting to hide from guests. May I ask what you are trying to hide?
It only depends on what codes you are wanting to hide from guests. May I ask what you are trying to hide?
Re: [code]s do not be visible for guests
I simply want to hide codes for the guests. Because we use codes for urls, or javascript codes, etc..
Re: [code]s do not be visible for guests
You can use this method to determine if someone is logged in or not.
0 means they aren't logged in.
1 means they are.
- Code:
_userdata["session_logged_in"] == 0
0 means they aren't logged in.
1 means they are.
Re: [code]s do not be visible for guests
And where could I paste this code?Draxion wrote:You can use this method to determine if someone is logged in or not.
- Code:
_userdata["session_logged_in"] == 0
0 means they aren't logged in.
1 means they are.
Re: [code]s do not be visible for guests
give it a try
Rusalt:
![[code]s do not be visible for guests Untitl11](https://i.servimg.com/u/f11/16/90/68/76/untitl11.png)
- Code:
$(function() {
if (_userdata["session_logged_in"] == 0) {
$("dl.codebox").html(' please <a href="/login">login</a> or <a href="/register">register</a> to view it');
}
});
Rusalt:
![[code]s do not be visible for guests Untitl11](https://i.servimg.com/u/f11/16/90/68/76/untitl11.png)
Last edited by omarpop23 on August 24th 2017, 3:00 am; edited 2 times in total
Re: [code]s do not be visible for guests
run this javascript in post
- Code:
$(function(){
if(_userdata["session_logged_in"]==0){$(".codebox").remove();}
});
Re: [code]s do not be visible for guests
This is EXACTLY what I want!omarpop23 wrote:give it a try
- Code:
$(function() {
if (_userdata["session_logged_in"] == 0) {
$("dl.codebox").html(' please <a href="/login">login</a> or <a href="/register">register</a> to view it');
}
});
Rusalt:
Thanks!
Re: [code]s do not be visible for guests
~Hello @DeathLess can i consider this problem now solved ?
if yes please click the mark solved button found above this thread.
Thank you.
APE
if yes please click the mark solved button found above this thread.
Thank you.
APE
Re: [code]s do not be visible for guests
Yes, marked solved.APE wrote:~Hello @DeathLess can i consider this problem now solved ?
if yes please click the mark solved button found above this thread.
Thank you.
APE
Re: [code]s do not be visible for guests
Problem solved & topic archived.
|

» Usernames not visible to guests after applying a Javascript code
» Links not visible for guests?
» Making Chat visible to guests
» How to make announcement visible for guests?
» Code visible only under conditions
» Links not visible for guests?
» Making Chat visible to guests
» How to make announcement visible for guests?
» Code visible only under conditions
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum