vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   navbar question (https://vborg.vbsupport.ru/showthread.php?t=205396)

FRANKTHETANK 2 02-14-2009 11:13 PM

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

Lynne 02-14-2009 11:27 PM

HTML Code:

<if condition="THIS_SCRIPT == 'index'">show home link</if>
<if condition="THIS_SCRIPT == 'whatever-you-call-home'">show index link</if>


FRANKTHETANK 2 02-14-2009 11:47 PM

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

Lynne 02-15-2009 12:08 AM

whoops.... condition, not conditions. Fixed above.

FRANKTHETANK 2 02-15-2009 12:13 AM

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

Lynne 02-15-2009 12:25 AM

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>

FRANKTHETANK 2 02-15-2009 12:36 AM

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


Dismounted 02-15-2009 03:23 AM

Code:

<if condition="THIS_SCRIPT ==  'provb_blhome'"><td class="vbmenu_control"><a href="index.php$session[sessionurl_q]">Forum</a></td></if>

FRANKTHETANK 2 02-15-2009 12:57 PM

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>


SEOvB 02-15-2009 01:02 PM

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


All times are GMT. The time now is 10:09 PM.

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.01142 seconds
  • Memory Usage 1,742KB
  • 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
  • (11)bbcode_code_printable
  • (1)bbcode_html_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)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
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete