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.

Hide links in code from guest?

View previous topic View next topic Go down

In progress Hide links in code from guest?

Post by bedazzled on August 6th 2014, 2:38 pm

My englesh is not so good Sad I understand and know how to read English, but I do not know grammar and writing very well Wink So,my problem its... How to hide links in code tags,For example url links from guests? I put it in the control panel links can only be seen by members and visitors again see the this links? I use a version of phpbb2! If you need somewhere to put the script please clarify it easier because I'm new at this Embarassed
And how do I remove the text from sticky and Global announcement???


My forum adress: http://bedazzledupload.serbianforum.info/


Last edited by bedazzled on August 6th 2014, 3:28 pm; edited 1 time in total

bedazzled
New Member

Posts : 15
Reputation : 1
Language : Serbian,English

http://bedazzledupload.serbianforum.info/

Back to top Go down

In progress Re: Hide links in code from guest?

Post by SLGray on August 6th 2014, 2:50 pm

You will need to use the hide tags.


When your topic has been solved, ensure you mark the topic solved.
Never post your email in public.


SLGray
Administrator
Administrator

Male Posts : 36663
Reputation : 2445
Language : English
Location : United States

http://ztwds.forumotion.com/

Back to top Go down

In progress Re: Hide links in code from guest?

Post by bedazzled on August 6th 2014, 3:26 pm

I've tried hiding it but then they do not see for registered members? How should I put the url link?Maybe I'm mistaken here?





Code:
[hide]Url link[/hide]

or?

bedazzled
New Member

Posts : 15
Reputation : 1
Language : Serbian,English

http://bedazzledupload.serbianforum.info/

Back to top Go down

In progress Re: Hide links in code from guest?

Post by Japorized on August 6th 2014, 5:50 pm

Code:
<!-- BEGIN switch_user_logged_in -->
Put in code that you wish to hide from guests here. This tag actually means that it's only visible to logged-in users.
<!-- END switch_user_logged_in -->

Put this code in your template and it should work like a charm. Very Happy

Japorized
Forumember

Male Posts : 310
Reputation : 3
Language : English
Location : Malaysia

http://infinityhub.ace.st

Back to top Go down

In progress Re: Hide links in code from guest?

Post by bedazzled on August 6th 2014, 11:34 pm

I want to not see any link to the forum! Since I do not know where exactly to copy this code... Whether you can tell me where exactly do I copy this? I'm sorry but I have no idea where to go, I just started to learn this...

bedazzled
New Member

Posts : 15
Reputation : 1
Language : Serbian,English

http://bedazzledupload.serbianforum.info/

Back to top Go down

In progress Re: Hide links in code from guest?

Post by Japorized on August 7th 2014, 5:03 am

You're actually wanting to hide links that are posted by your users in posts right?

Japorized
Forumember

Male Posts : 310
Reputation : 3
Language : English
Location : Malaysia

http://infinityhub.ace.st

Back to top Go down

In progress Re: Hide links in code from guest?

Post by bedazzled on August 7th 2014, 5:23 am

No. Only my links that can not be seen! That's what I want!

bedazzled
New Member

Posts : 15
Reputation : 1
Language : Serbian,English

http://bedazzledupload.serbianforum.info/

Back to top Go down

In progress Re: Hide links in code from guest?

Post by SLGray on August 7th 2014, 8:49 am

So you want only the links you posted to be hidden?


When your topic has been solved, ensure you mark the topic solved.
Never post your email in public.


SLGray
Administrator
Administrator

Male Posts : 36663
Reputation : 2445
Language : English
Location : United States

http://ztwds.forumotion.com/

Back to top Go down

In progress Re: Hide links in code from guest?

Post by Japorized on August 7th 2014, 11:28 am

Hmm... If so, then you can try this.
Every time you post a certain link, add a class to it, like this.
Code:
<a href="url" class="your_class">Link</a>

Then add this to your javascript. Unselect all the placements, as we will be grabbing the link of the js manually.
Code:
$(document).ready(function(){
$('.your_class').parent().append('You must be logged in to view this link.').end().remove();
});

Then add this to your overall_header template.
Code:
<!-- BEGIN switch_user_logged_out -->
<script type="text/javascript" src="JS_LINK_HERE" />
<!-- END switch_user_logged_out -->

This would make the javascript file be loaded and ran if the user isn't logged in.
It should now hide your link every time but you'll have to remember adding that particular class to it.
This also has another advantage. If you decide that you can publish the link for guests, then just don't add in the class.

Japorized
Forumember

Male Posts : 310
Reputation : 3
Language : English
Location : Malaysia

http://infinityhub.ace.st

Back to top Go down

In progress Re: Hide links in code from guest?

Post by SSYT on August 7th 2014, 9:17 pm

try my code Wink
Code:
jQuery(function(a){
  msg = 'Your guest message ! \b You have a not logged account !';
  if(_userdata.session_logged_in == '0')
      return a('.codebox dd code').html(msg);
});

SSYT
Forumember

Male Posts : 41
Reputation : 2
Language : RO-10, EN-3, FR-1
Location : Romania

http://help.forumgratuit.ro/forum

Back to top Go down

In progress Re: Hide links in code from guest?

Post by bedazzled on August 10th 2014, 2:18 am

Tell me exactly where to put this? Because I do not understand where that to copy?

bedazzled
New Member

Posts : 15
Reputation : 1
Language : Serbian,English

http://bedazzledupload.serbianforum.info/

Back to top Go down

In progress Re: Hide links in code from guest?

Post by SLGray on August 10th 2014, 4:13 pm

Administration Panel > Modules > HTML/JavaScript > JavaScript Management
Make sure that it is activated.


When your topic has been solved, ensure you mark the topic solved.
Never post your email in public.


SLGray
Administrator
Administrator

Male Posts : 36663
Reputation : 2445
Language : English
Location : United States

http://ztwds.forumotion.com/

Back to top Go down

In progress Re: Hide links in code from guest?

Post by bedazzled on August 13th 2014, 10:25 pm

Not working Confused How to: only registered users can see all forum???

And how to have like this scrolling widget???



bedazzled
New Member

Posts : 15
Reputation : 1
Language : Serbian,English

http://bedazzledupload.serbianforum.info/

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