The forum of the forums
Welcome to the Official Support Forum of Forumotion!

To take full advantage of everything offered by our forum, please log in if you are already a member, or join our community if you've not yet.



Create a free forum like this one.

[code]s do not be visible for guests

View previous topic View next topic Go down

Solved [code]s do not be visible for guests

Post by DeathLess on August 18th 2017, 11:37 am

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?


Last edited by DeathLess on August 30th 2017, 11:54 am; edited 1 time in total
avatar
DeathLess
Forumember

Male Posts : 59
Reputation : 1
Language : ForuMotion Hungarian Translator
Location : At Your Girlfriend's House

http://www.minervasite.org/

Back to top Go down

Solved Re: [code]s do not be visible for guests

Post by brandon_g on August 18th 2017, 12:32 pm

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


Remember to mark your topic when a solution is found.
avatar
brandon_g
Support Moderator
Support Moderator

Male Posts : 5943
Reputation : 547
Language : English
Location : USA

http://broadcastingduo.forumotion.com/

Back to top Go down

Solved Re: [code]s do not be visible for guests

Post by Draxion on August 18th 2017, 5:52 pm

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?


NEVER provide your founder's account or email
Please provide forum's URL when dealing with design and appearance issues
Don't forget to mark the topic as when the issue is resolved. This helps the staff greatly.
PM Support is prohibited!
TOS | General Rules | FAQ | Tricks & Tips | Latest Updates | Introduce Yourself

avatar
Draxion
Support Moderator
Support Moderator

Male Posts : 1713
Reputation : 223
Language : English
Location : USA

http://www.draxionsgameden.com/

Back to top Go down

Solved Re: [code]s do not be visible for guests

Post by DeathLess on August 22nd 2017, 7:16 pm

I simply want to hide codes for the guests. Because we use codes for urls, or javascript codes, etc..
avatar
DeathLess
Forumember

Male Posts : 59
Reputation : 1
Language : ForuMotion Hungarian Translator
Location : At Your Girlfriend's House

http://www.minervasite.org/

Back to top Go down

Solved Re: [code]s do not be visible for guests

Post by Draxion on August 22nd 2017, 7:22 pm

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.


NEVER provide your founder's account or email
Please provide forum's URL when dealing with design and appearance issues
Don't forget to mark the topic as when the issue is resolved. This helps the staff greatly.
PM Support is prohibited!
TOS | General Rules | FAQ | Tricks & Tips | Latest Updates | Introduce Yourself

avatar
Draxion
Support Moderator
Support Moderator

Male Posts : 1713
Reputation : 223
Language : English
Location : USA

http://www.draxionsgameden.com/

Back to top Go down

Solved Re: [code]s do not be visible for guests

Post by DeathLess on August 23rd 2017, 2:42 pm

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.
And where could I paste this code?
avatar
DeathLess
Forumember

Male Posts : 59
Reputation : 1
Language : ForuMotion Hungarian Translator
Location : At Your Girlfriend's House

http://www.minervasite.org/

Back to top Go down

Solved Re: [code]s do not be visible for guests

Post by omarpop23 on August 23rd 2017, 4:56 pm

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:


Last edited by omarpop23 on August 24th 2017, 3:00 am; edited 2 times in total
avatar
omarpop23
Forumember

Male Posts : 157
Reputation : 3
Language : Arabic
Location : Egypt

http://egyover.ahlamontada.com

Back to top Go down

Solved Re: [code]s do not be visible for guests

Post by _Twisted_Mods_ on August 23rd 2017, 5:02 pm

run this javascript in post

Code:
$(function(){
if(_userdata["session_logged_in"]==0){$(".codebox").remove();}
});
avatar
_Twisted_Mods_
Helper
Helper

Male Posts : 2064
Reputation : 314
Language : English
Location : Ms

http://liquidcode.forumotion.com

Back to top Go down

Solved Re: [code]s do not be visible for guests

Post by DeathLess on August 30th 2017, 9:04 am

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:
This is EXACTLY what I want!
Thanks!
avatar
DeathLess
Forumember

Male Posts : 59
Reputation : 1
Language : ForuMotion Hungarian Translator
Location : At Your Girlfriend's House

http://www.minervasite.org/

Back to top Go down

Solved Re: [code]s do not be visible for guests

Post by APE on August 30th 2017, 11:33 am

~Hello @DeathLess can i consider this problem now solved ?

if yes please click the mark solved button found above this thread.

Thank you.

APE



avatar
APE
Manager
Manager

Male Posts : 10672
Reputation : 997
Language : fluent in dork / mumbojumbo & English haha
Location : STUCK IN FORUMOTIONS SERVERS HELP ME !!!!!!

http://chatworld.forumotion.co.uk/

Back to top Go down

Solved Re: [code]s do not be visible for guests

Post by DeathLess on August 30th 2017, 11:54 am

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
Yes, marked solved.
avatar
DeathLess
Forumember

Male Posts : 59
Reputation : 1
Language : ForuMotion Hungarian Translator
Location : At Your Girlfriend's House

http://www.minervasite.org/

Back to top Go down

Solved Re: [code]s do not be visible for guests

Post by Draxion on August 30th 2017, 5:17 pm

Problem solved & topic archived.
Please read our forum rules: ESF General Rules


NEVER provide your founder's account or email
Please provide forum's URL when dealing with design and appearance issues
Don't forget to mark the topic as when the issue is resolved. This helps the staff greatly.
PM Support is prohibited!
TOS | General Rules | FAQ | Tricks & Tips | Latest Updates | Introduce Yourself

avatar
Draxion
Support Moderator
Support Moderator

Male Posts : 1713
Reputation : 223
Language : English
Location : USA

http://www.draxionsgameden.com/

Back to top Go down

View previous topic View next topic Back to top


 
Permissions in this forum:
You cannot reply to topics in this forum