vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   <if> Statement For Navbar Link (https://vborg.vbsupport.ru/showthread.php?t=102959)

dieselpowered 12-14-2005 05:39 PM

<if> Statement For Navbar Link
 
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

Quote:

Originally Posted by xtremeoff-road
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

Quote:

Originally Posted by Zachery
<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

Quote:

Originally Posted by xtremeoff-road
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:
Code:

<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:
Code:

<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,toolbar=no,scrollbars=no,resizable=yes,directories=no,width=750,height=550,left=50,top=100,screenX=50,screenY=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:
Code:

<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 :)

Quote:

Originally Posted by merk
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


All times are GMT. The time now is 01:28 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.03179 seconds
  • Memory Usage 1,743KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (3)bbcode_code_printable
  • (4)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (9)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete