The forum of the forums
Would you like to react to this message? Create an account in a few clicks or log in to continue.

Hide links in code from guest?

4 posters

Go down

In progress Hide links in code from guest?

Post by bedazzled 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
avatar
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 August 6th 2014, 2:50 pm

You will need to use the hide tags.


hide - Hide links in code from guest? Slgray10

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

Male Posts : 51548
Reputation : 3519
Language : English
Location : United States

https://forumsclub.com/gc/128-link-directory/

Back to top Go down

In progress Re: Hide links in code from guest?

Post by bedazzled 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?
avatar
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 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
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 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...
avatar
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 August 7th 2014, 5:03 am

You're actually wanting to hide links that are posted by your users in posts right?
Japorized
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 August 7th 2014, 5:23 am

No. Only my links that can not be seen! That's what I want!
avatar
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 August 7th 2014, 8:49 am

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


hide - Hide links in code from guest? Slgray10

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

Male Posts : 51548
Reputation : 3519
Language : English
Location : United States

https://forumsclub.com/gc/128-link-directory/

Back to top Go down

In progress Re: Hide links in code from guest?

Post by Japorized 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
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 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
SSYT
Forumember

Male Posts : 77
Reputation : 15
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 August 10th 2014, 2:18 am

Tell me exactly where to put this? Because I do not understand where that to copy?
avatar
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 August 10th 2014, 4:13 pm

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


hide - Hide links in code from guest? Slgray10

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

Male Posts : 51548
Reputation : 3519
Language : English
Location : United States

https://forumsclub.com/gc/128-link-directory/

Back to top Go down

In progress Re: Hide links in code from guest?

Post by bedazzled 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???


hide - Hide links in code from guest? Untitl10
avatar
bedazzled
New Member

Posts : 15
Reputation : 1
Language : Serbian,English

http://bedazzledupload.serbianforum.info/

Back to top Go down

Back to top

- Similar topics

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