Log in

View Full Version : <if> Statement For Navbar Link


dieselpowered
12-14-2005, 05:39 PM
Hi there everyone, I played around with this a little, but I obviously do not know what I am doing!

I would like to add an <if> statement to a link on my navbar...if members click that link, it take them to the page and the link is removed from the navbar, if they leave that page, the link is then added again.

I know that there <if> <else> statements out there that will change the links, however, I just want it to be removed, not replaced with anything else.

Any help would be most appreciated!

Thank you :)

Zachery
12-14-2005, 05:50 PM
Hi there everyone, I played around with this a little, but I obviously do not know what I am doing!

I would like to add an <if> statement to a link on my navbar...if members click that link, it take them to the page and the link is removed from the navbar, if they leave that page, the link is then added again.

I know that there <if> <else> statements out there that will change the links, however, I just want it to be removed, not replaced with anything else.

Any help would be most appreciated!

Thank you :)

<if condition="THIS_SCRIPT != page">show link</if>

If it is that page, it wont show the link.

dieselpowered
12-14-2005, 05:58 PM
<if condition="THIS_SCRIPT != page">show link</if>

If it is that page, it wont show the link.

So I just replace show link with what? The entire code or just the file name?

Thanks so much for the help!

Zachery
12-14-2005, 06:00 PM
So I just replace show link with what? The entire code or just the file name?

Thanks so much for the help!

for the index.php page

<if condition="THIS_SCRIPT != index">show link</if>
showthread.php
<if condition="THIS_SCRIPT != showthread">show link</if>

Etc.

If its a non vBpage THIS_SCRIPT can be defined to make use of it.

dieselpowered
12-14-2005, 06:09 PM
Thank you for the help!!

Alright, maybe this is more difficult than I thought:

Here is my navar link code, it generates a pull down menu:
<td id="chat" class="vbmenu_control"><a href="$show[nojs_link]#chat">$vbphrase[javachat_chat]</a> <script type="text/javascript"> vbmenu_register("chat"); </script></td>

This code is the information for the pull down:
<div class="vbmenu_popup" id="chat_menu" style="display:none">
<table cellpadding="4" cellspacing="1" border="0">

<tr><td class="thead">$vbphrase[javachat_chat_menu]</td></tr>
<tr><td class="vbmenu_option"><a href="javachat.php$session[sessionurl_q]">$vbphrase[javachat_javachat]</a></td></tr>
<tr><td class="vbmenu_option"><a href="#" onclick="window.open('javachat.php?$session[sessionurl]do=lite','javachat','statusbar=no,menubar=no,toolb ar=no,scrollbars=no,resizable=yes,directories=no,w idth=750,height=550,left=50,top=100,screenX=50,scr eenY=100'); return false;">$vbphrase[javachat_javachat_popup]</a></td></tr>
<tr><td class="vbmenu_option"><a href="irc://$vboptions[javachat_network]/$vboptions[javachat_channel]">$vbphrase[javachat_chat_w_mirc]</a></td></tr>
<tr><td class="vbmenu_option"><a href="http://www.mirc.com/get.html">$vbphrase[javachat_download_mirc]</a></td></tr>

</table>
</div>

Will your solution work for this? How would I integrate the <if> statement into it?

Something like:
<if condition="THIS_SCRIPT != javachat"><td id="chat" class="vbmenu_control"><a href="$show[nojs_link]#chat">$vbphrase[javachat_chat]</a> <script type="text/javascript"> vbmenu_register("chat"); </script></td></if>

Thanks again and please excuse the ignorance :)

Crap. no one knows??

merk
12-14-2005, 08:25 PM
The javachat.php file (if a vbulletin extension) should have THIS_SCRIPT defined at the start of the file.

If it is, you can use THIS_SCRIPT != 'WHATEVER_IT_IS' in the condition to check to see if the person is not on that page.

Just like Zach said.

dieselpowered
12-14-2005, 08:54 PM
Ok so the code Zach gave me was

<if condition="THIS_SCRIPT != page">show link</if>

So then the javachat.php would go where he has page labled, however, does anything go where he has show link labled? Or does the code simply go just before the link?

<if condition="THIS_SCRIPT != javachat.php">show link</if> (just like that?)

Thanks for the help!

merk
12-14-2005, 08:58 PM
No. Look for the define in javachat.php for THIS_SCRIPT. If it doesnt exist you cant do it.

dieselpowered
12-14-2005, 09:03 PM
WOOHOO I got it...thank you all so much :)

No. Look for the define in javachat.php for THIS_SCRIPT. If it doesnt exist you cant do it.

Not sure what you mean by that, however, I did get it to work :) lol