Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 General Discussions
  #1  
Old 12-14-2005, 05:39 PM
dieselpowered's Avatar
dieselpowered dieselpowered is offline
 
Join Date: Aug 2004
Location: Arizona
Posts: 661
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default <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
Reply With Quote
  #2  
Old 12-14-2005, 05:50 PM
Zachery's Avatar
Zachery Zachery is offline
 
Join Date: Jul 2002
Location: Ontario, Canada
Posts: 11,440
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #3  
Old 12-14-2005, 05:58 PM
dieselpowered's Avatar
dieselpowered dieselpowered is offline
 
Join Date: Aug 2004
Location: Arizona
Posts: 661
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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!
Reply With Quote
  #4  
Old 12-14-2005, 06:00 PM
Zachery's Avatar
Zachery Zachery is offline
 
Join Date: Jul 2002
Location: Ontario, Canada
Posts: 11,440
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #5  
Old 12-14-2005, 06:09 PM
dieselpowered's Avatar
dieselpowered dieselpowered is offline
 
Join Date: Aug 2004
Location: Arizona
Posts: 661
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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??
Reply With Quote
  #6  
Old 12-14-2005, 08:25 PM
merk merk is offline
 
Join Date: Nov 2001
Location: Canberra, Australia
Posts: 601
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #7  
Old 12-14-2005, 08:54 PM
dieselpowered's Avatar
dieselpowered dieselpowered is offline
 
Join Date: Aug 2004
Location: Arizona
Posts: 661
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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!
Reply With Quote
  #8  
Old 12-14-2005, 08:58 PM
merk merk is offline
 
Join Date: Nov 2001
Location: Canberra, Australia
Posts: 601
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

No. Look for the define in javachat.php for THIS_SCRIPT. If it doesnt exist you cant do it.
Reply With Quote
  #9  
Old 12-14-2005, 09:03 PM
dieselpowered's Avatar
dieselpowered dieselpowered is offline
 
Join Date: Aug 2004
Location: Arizona
Posts: 661
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 07:50 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04162 seconds
  • Memory Usage 2,244KB
  • Queries Executed 13 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (3)bbcode_code
  • (4)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (9)post_thanks_box
  • (9)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (9)post_thanks_postbit_info
  • (9)postbit
  • (9)postbit_onlinestatus
  • (9)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete