PDA

View Full Version : Mini Mods - Hiding Certain Navbar Links From Guests


metalguy639
27 Feb 2009, 01:26
THIS TEMPLATE EDIT BROUGHT TO YOU BY:

https://www.vbulletin.org/forum/
www.skinsnstyles.com (http://www.skinsnstyles.com)

CLICK INSTALLED TO GET SUPPORT FOR THIS ADD-ON. IF YOU DO NOT CLICK INSTALLED I CANNOT HELP YOU.

If you want to hide some of the links in your navbar to guests you can do it by adding an if/else statement to your template code.

Steps To Add Code:

1. Login to your admin CP
2. Scroll down to Styles & Templates & click on "Style Manager"
3. Now find the skin you want to edit in the right side panel.
4. Click the drop down box and choose "Edit Templates"
5. Expand the templates to include all the template groups by clicking the bottom left button on the far right large box.
6. Scroll through the templates until you find the "navbar" template & double click on it.
7. Now you should see the code, I will go through each button that does not have the if/else statement on it already.

To Hide The FAQ Link:

Find:

<td class="vbmenu_control"><a rel="help" href="faq.php$session[sessionurl_q]" accesskey="5">$vbphrase[faq]</a></td>

Replace With:

<if condition="$show['member']">
<td class="vbmenu_control"><a rel="help" href="faq.php$session[sessionurl_q]" accesskey="5">$vbphrase[faq]</a></td>
</if>

To Hide The Community Link Popups:

Find:

<if condition="$show['communitylink'] AND $show['popups']">
<td class="vbmenu_control"><a id="community" href="$show[nojs_link]#community" rel="nofollow" accesskey="6">$vbphrase[community]</a> <script type="text/javascript"> vbmenu_register("community"); </script></td>

Replace With:

<if condition="$show['member']">
<if condition="$show['communitylink'] AND $show['popups']">
<td class="vbmenu_control"><a id="community" href="$show[nojs_link]#community" rel="nofollow" accesskey="6">$vbphrase[community]</a> <script type="text/javascript"> vbmenu_register("community"); </script></td>
</if>

To Hide The Search Link:

Find:

<td class="vbmenu_control"><a id="navbar_search" href="search.php$session[sessionurl_q]" accesskey="4" rel="nofollow">$vbphrase[search]</a> <if condition="$show['quicksearch']"><script type="text/javascript"> vbmenu_register("navbar_search"); </script></if></td>
</if>

Replace With:

<if condition="$show['member']">
<td class="vbmenu_control"><a id="navbar_search" href="search.php$session[sessionurl_q]" accesskey="4" rel="nofollow">$vbphrase[search]</a> <if condition="$show['quicksearch']"><script type="text/javascript"> vbmenu_register("navbar_search"); </script></if></td>
</if>
</if>

You can pretty much hide any links that you want as long as you include both tags into your code. Be sure to always put:

<if condition="$show['member']">

at the beginning of the link area and be sure to close your tag and place...

</if>

at the end.

If you get an error or get stumped, post here & I will try to help you.

metalguy639
27 Feb 2009, 01:27
Reserved...

Jasem
04 Apr 2009, 16:26
great work, thank you!

Installed

metalguy639
20 Apr 2009, 10:24
No problem. Glad you found it helpful.

Blue Ink
19 May 2009, 17:58
Can you tell me how to modity this so that a navbar link is hidden from anyone who is not an Administrator?

Thank you

metalguy639
20 May 2009, 00:13
Can you tell me how to modity this so that a navbar link is hidden from anyone who is not an Administrator?

Thank you

Which link? All navbar links or one link in particular?

Thanks

www.nofal
09 Oct 2012, 13:51
Good Work

metalguy639
10 Oct 2012, 03:14
Good Work


No problem, thanks :)

matrex722
10 Nov 2012, 13:46
great work, thank you!

metalguy639
11 Nov 2012, 00:41
great work, thank you!

Thanks :)

madness85
11 Jan 2013, 20:03
Reserved...

how to do this on 4.2 ?

metalguy639
12 Jan 2013, 06:11
how to do this on 4.2 ?

I will have to post an entirely different tutorial for that since the code is different from vB 3.8. When I have some time I'll post it this weekend.

madness85
24 Jan 2013, 19:11
I will have to post an entirely different tutorial for that since the code is different from vB 3.8. When I have some time I'll post it this weekend.

Please if ya would buddy I can't hide faq and community link

metalguy639
30 Jan 2013, 01:09
Please if ya would buddy I can't hide faq and community link

Sorry for the late reply. I'm really bogged down in other stuff right now. If you are using vBulletin 4.2 there is a built in system for navigation that you can set who can see a link and who cannot. It maybe easier to use that system if you are on 4.2.

Or if you are not using vB 4.2 you can place the conditionals yourself. The vB4 conditionals are here: http://www.vbulletin.org/forum/showthread.php?t=231525&highlight=Conditionals. If you can find the part of the template for those links you should be able to put the conditionals around it and make it where its not seen.

Dorgham
04 Apr 2013, 01:09
Good Job

metalguy639
05 Apr 2013, 03:07
Good Job

Thanks.