vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   Menu like on vB.org (https://vborg.vbsupport.ru/showthread.php?t=185386)

Triky 07-15-2008 01:06 PM

Thank you, but I don't understand how do I do the 'Home' condition. Using the code below, can you please post me another example?

Now my code is:

Code:

<div id="menucase">
  <div id="styletwo">
    <ul>
      <li><a href="http://www.example.org" <if condition="THIS_SCRIPT == 'index'">class="current"</if>>Home</a></li>
      <li><a href="forumdisplay.php?f=72" <if condition="$foruminfo['parentid'] == 72 OR $foruminfo['forumid'] == 72">class="current"</if>>Test 1</a></li>
      <li><a href="forumdisplay.php?f=36" <if condition="$foruminfo['parentid'] == 36 OR $foruminfo['forumid'] == 36">class="current"</if>>Test 2</a></li>
      <li><a href="forumdisplay.php?f=60" <if condition="$foruminfo['parentid'] == 60 OR $foruminfo['forumid'] == 60">class="current"</if>>Test 3</a></li>
    </ul>
  </div>
</div>

And it works perfectly.. but not for the home.

Dismounted 07-16-2008 06:59 AM

Code:

<if condition="!in_array($foruminfo['parentid'], 72, 36, 60) AND in_array($foruminfo['forumid'], 72, 36, 60)">
It was pretty self-explanatory...

Triky 07-16-2008 07:21 AM

Excuse me Dismounted, but I'm not too familiar with PHP.

If I put it like this:

Code:

<div id="menucase">
  <div id="styletwo">
    <ul>
      <li><a <if condition="!in_array($foruminfo['parentid'], 72, 36, 60) AND in_array($foruminfo['forumid'], 72, 36, 60)">href="http://www.example.org/"<else />class="current"</if>>Home</a></li>
      <li><a href="forumdisplay.php?f=72" <if condition="$foruminfo['parentid'] == 72 OR $foruminfo['forumid'] == 72">class="current"</if>>Test 1</a></li>
      <li><a href="forumdisplay.php?f=36" <if condition="$foruminfo['parentid'] == 36 OR $foruminfo['forumid'] == 36">class="current"</if>>Test 2</a></li>
      <li><a href="forumdisplay.php?f=60" <if condition="$foruminfo['parentid'] == 60 OR $foruminfo['forumid'] == 60">class="current"</if>>Test 3</a></li>
    </ul>
  </div>
</div>

When I try to save I get a syntax error:

Quote:

The following error occurred when attempting to evaluate this template:

Warning: Wrong parameter count for in_array() in [path]/includes/adminfunctions_template.php(3716) : eval()'d code on line 12

Warning: Wrong parameter count for in_array() in [path]/includes/adminfunctions_template.php(3716) : eval()'d code on line 12


MoT3rror 07-16-2008 08:04 AM

Code:

<if condition="!in_array($foruminfo['parentid'], array(72, 36, 60)) AND in_array($foruminfo['forumid'], array(72, 36, 60))">
Try this.

Triky 07-16-2008 09:27 AM

No, it doesn't work correctly..
EDIT: Fixed. Now it works.
In this conditional wasn't an '!'.. :)

<if condition="!in_array($foruminfo['parentid'], array(72, 36, 60)) AND !in_array($foruminfo['forumid'], array(72, 36, 60))">

Thank you guys.

ReQueM 12-18-2008 11:50 PM

thaks :)


All times are GMT. The time now is 12:03 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.01078 seconds
  • Memory Usage 1,728KB
  • 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
  • (4)bbcode_code_printable
  • (1)bbcode_quote_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
  • (6)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