Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 General Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 02-14-2009, 11:13 PM
FRANKTHETANK 2 FRANKTHETANK 2 is offline
 
Join Date: Sep 2006
Posts: 364
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default navbar question

How do you make a link change from forum and home depending on what page your on. For example, when your on the home page it would show forum. And when your on forum it would show Home Page
Reply With Quote
  #2  
Old 02-14-2009, 11:27 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

HTML Code:
<if condition="THIS_SCRIPT == 'index'">show home link</if>
<if condition="THIS_SCRIPT == 'whatever-you-call-home'">show index link</if>
Reply With Quote
  #3  
Old 02-14-2009, 11:47 PM
FRANKTHETANK 2 FRANKTHETANK 2 is offline
 
Join Date: Sep 2006
Posts: 364
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

The following error occurred when attempting to evaluate this template:

The conditional on line 89 appears to be missing its beginning tag (<if>). This may cause unexpected behavior.

This is likely caused by a malformed conditional statement. It is highly recommended that you fix this error before continuing, but you may continue as-is if you wish.

I get that error
Reply With Quote
  #4  
Old 02-15-2009, 12:08 AM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

whoops.... condition, not conditions. Fixed above.
Reply With Quote
  #5  
Old 02-15-2009, 12:13 AM
FRANKTHETANK 2 FRANKTHETANK 2 is offline
 
Join Date: Sep 2006
Posts: 364
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Still not working, here is the code i'm putting in.

Code:
		<td class="vbmenu_control"><a href="index.php$session[sessionurl_q]">Forum</a></td>
<if condition="THIS_SCRIPT == 'index.php'">Home</if>
<if condition="THIS_SCRIPT == 'home.php'">Forum</if>
Is this right or wrong. It shows up forum no matter what I do
Reply With Quote
  #6  
Old 02-15-2009, 12:25 AM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

No, that isn't correct because of two issues. First, THIS_SCRIPT is defined at the top of your php page. For instance, this is the line at the top of index.php:
Code:
define('THIS_SCRIPT', 'index');
Thus, this is the correct condition:
Code:
<if condition="THIS_SCRIPT == 'index'">Home</if>
Find the name of the home script at the top of the home.php page.

Second, you want the link to look the same as this line:
Code:
<td class="vbmenu_control"><a href="index.php$session[sessionurl_q]">Forum</a></td>
That is the code (with "whatever-you-call-home" replaced with the correct name from the top of home.php) you would use in place of "Forum":
Code:
<if condition="THIS_SCRIPT == 'whatever-you-call-home'"><td class="vbmenu_control"><a href="index.php$session[sessionurl_q]">Forum</a></td></if>
Reply With Quote
  #7  
Old 02-15-2009, 12:36 AM
FRANKTHETANK 2 FRANKTHETANK 2 is offline
 
Join Date: Sep 2006
Posts: 364
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

ok the script at the top of my home page is
Code:
define('THIS_SCRIPT', 'provb_blhome');
So
My code would be this right or wrong?
Code:
<if condition="define('THIS_SCRIPT', 'provb_blhome');"><td class="vbmenu_control"><a href="index.php$session[sessionurl_q]">Forum</a></td></if>
When I put it in i get an error



Code:
vBulletin Message


    The following template conditional expression contains function calls:

    <if condition="define('THIS_SCRIPT', 'provb_blhome');">

    Function Name 	Usage in Expression
    define	define('THIS_SCRIPT', 'provb_blhome')

    With a few exceptions, function calls are not permitted in template conditional expressions. Please go back and re-write this expression.

    The following functions are allowed in template conditional expressions:
    in_array() is_array() is_numeric() isset() empty() defined() array() can_moderate() can_moderate_calendar() exec_switch_bg() is_browser() is_member_of()
Reply With Quote
  #8  
Old 02-15-2009, 03:23 AM
Dismounted's Avatar
Dismounted Dismounted is offline
 
Join Date: Jun 2005
Location: Melbourne, Australia
Posts: 15,047
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Code:
<if condition="THIS_SCRIPT ==  'provb_blhome'"><td class="vbmenu_control"><a href="index.php$session[sessionurl_q]">Forum</a></td></if>
Reply With Quote
  #9  
Old 02-15-2009, 12:57 PM
FRANKTHETANK 2 FRANKTHETANK 2 is offline
 
Join Date: Sep 2006
Posts: 364
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

none of these are working. My home page is called home.php and my forum is index.php.

This is were i put the code
Code:
<if condition="THIS_SCRIPT ==  'provb_blhome'"><td class="vbmenu_control"><a href="index.php$session[sessionurl_q]">Forum</a></td></if>
<td class="vbmenu_control">
<a href="usercp.php$session[sessionurl_q]">$vbphrase[user_cp]</a></td>
		</if>
		<if condition="$show['registerbutton']">
			<td class="vbmenu_control"><a href="register.php$session[sessionurl_q]" rel="nofollow">$vbphrase[register]</a></td>
		</if>
Reply With Quote
  #10  
Old 02-15-2009, 01:02 PM
SEOvB's Avatar
SEOvB SEOvB is offline
 
Join Date: May 2007
Location: Indianapolis
Posts: 2,451
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Code:
<td class="vbmenu_control"><if condition="THIS_SCRIPT ==  provb_blhome"><a href="index.php$session[sessionurl_q]">Forum</a><else /><a href="/home.php" rel="nofollow">Home</a></if></td>
<a href="usercp.php$session[sessionurl_q]">$vbphrase[user_cp]</a></td>
		</if>
		<if condition="$show['registerbutton']">
			<td class="vbmenu_control"><a href="register.php$session[sessionurl_q]" rel="nofollow">$vbphrase[register]</a></td>
		</if>
Try that one
Reply With Quote
Reply


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 05:19 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.04159 seconds
  • Memory Usage 2,258KB
  • 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
  • (11)bbcode_code
  • (1)bbcode_html
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (10)postbit
  • (10)postbit_onlinestatus
  • (10)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_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
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete