Log in

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


metalguy639
02-26-2009, 10:00 PM
THIS TEMPLATE EDIT BROUGHT TO YOU BY:

https://vborg.vbsupport.ru/
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
02-26-2009, 11:27 PM
Reserved...

Jasem
04-04-2009, 02:26 PM
great work, thank you!

Installed

metalguy639
04-20-2009, 08:24 AM
No problem. Glad you found it helpful.

Blue Ink
05-19-2009, 03:58 PM
<font color="Navy">Can you tell me how to modity this so that a navbar link is hidden from anyone who is not an Administrator?

Thank you</font>

metalguy639
05-19-2009, 10:13 PM
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
10-09-2012, 11:51 AM
Good Work

metalguy639
10-10-2012, 01:14 AM
Good Work


No problem, thanks :)

matrex722
11-10-2012, 12:46 PM
great work, thank you!

metalguy639
11-10-2012, 11:41 PM
great work, thank you!

Thanks :)

madness85
01-11-2013, 07:03 PM
Reserved...

how to do this on 4.2 ?

metalguy639
01-12-2013, 05:11 AM
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
01-24-2013, 06:11 PM
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
01-30-2013, 12:09 AM
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: https://vborg.vbsupport.ru/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-03-2013, 11:09 PM
Good Job

metalguy639
04-05-2013, 01:07 AM
Good Job

Thanks.