PDA

View Full Version : Navbar if condition on gallery


theChronic
10-10-2006, 08:13 AM
hey folks
i am wondering if anyone might know the code i could use in my if condition to see if the user is looking at the gallery of the forum (vbGallery). If they are on the gallery, i obviously don't need a link to the gallery page.

Thanks
john

RS_Jelle
10-10-2006, 08:46 AM
This should do the trick:
<if condition="THIS_SCRIPT == 'scriptname'">your link code here</if>
You have to replace scriptname with the defined script name. It's at the top of vBGallery PHP file in the vBulletin root.

For example:
define('THIS_SCRIPT', 'myscript');
Then you need to replace scriptname with myscript. Probably it will be something like vbgallery, gallery, or something like that ;)

theChronic
10-10-2006, 09:06 AM
Awesome, thanks a lot :)

Fenriz
09-28-2007, 11:17 PM
And what is condition for the whole vbgallery? I've tried "gallery", "vbgallery", "vBGallery", "vbagallery". It's not working..

KW802
09-29-2007, 02:03 AM
And what is condition for the whole vbgallery? I've tried "gallery", "vbgallery", "vBGallery", "vbagallery". It's not working..The trick is to use PP_SCRIPT as the identifier instead of THIS_SCRIPT.

Below is the exact code I'm using over at Cool Sci-Fi; when in the gallery the navbar menu is not shown, when you're anywhere else it shows.<if condition="PP_SCRIPT != 'vBGallery'">
<td class="vbmenu_control"><a href="$vboptions[homeurl]/gallery/$session[sessionurl_q]">Gallery</a></td>
</if>

Fenriz
09-29-2007, 04:44 AM
KW802, great, thanks, it works!