View Full Version : Find out script_name
Marc.F
04-21-2009, 02:40 PM
I'm trying to create a navigation bar, which recognises which page you are on and then if you are on that page, it will put a different CSS state.
Can anyone tell me how to do this?
I've got this for my blogs, and it works:
<li><a <if condition="(VBBLOG_STYLE == 1)">id="current"</if> href="/blog.php$session[sessionurl_q]"><span>Blogs</span></a></li>
But I dont know how to do it for other pages, such as Contact, etc.
Thanks.
Taragon
04-21-2009, 09:38 PM
Something I use myself
<if condition="$show['guest']">
<div id="relevant_replacement">
<if condition="(THIS_SCRIPT == 'forumdisplay') OR (THIS_SCRIPT == 'showthread')">
<!--VBSEO_RR_1-->
<else />
<if condition="(THIS_SCRIPT == 'album')">
<h1 class="descr">$vbphrase[albums]</h1>
<else />
<if condition="(THIS_SCRIPT == 'tags')">
<h1 class="descr">$vbphrase[tags]</h1>
<else />
<if condition="(THIS_SCRIPT == 'member')">
<h1>$userinfo[username]</h1>
<p>Viewing $userinfo[username]'s profile, <font style="text-transform: lowercase;">$prepared[usertitle]</font> at $vboptions[bbtitle]</p>
<else />
<if condition="(THIS_SCRIPT == 'blog') OR (THIS_SCRIPT == 'blog_search') OR (THIS_SCRIPT == 'blog_ucp')">
<h1 class="descr">$vbphrase[blogs]</h1>
<else />
<if condition="(THIS_SCRIPT == 'blog_post')">
<h1 class="descr">$bloginfo[title]</h1>
<else />
<h1>$vboptions[bbtitle]</h1>
<p>$vbphrase[bbdescription]</p>
</if>
</if>
</if>
</if>
</if>
</if>
</div>
</if>
Look for
define('THIS_SCRIPT', 'xxx');
in your php files
Marc.F
04-22-2009, 07:52 PM
Thanks.
vBulletin® v3.8.12 by vBS, Copyright ©2000-2024, vBulletin Solutions Inc.