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 08:12 AM

Menu like on vB.org
 
You see at the top right, that menu (Home, Forums, Articles, Mods, Styles) that change the class into 'current' depending on wich category we are browsing. I have setted something like that on my vBulletin forum. But I don't know how can I do the same: example -> if we are on category id.2 (and all the subforums wich they are in), active this part of the menu, etc. Can you please help me?

Opserty 07-15-2008 08:18 AM

Use the THIS_SCRIPT condition?

Triky 07-15-2008 09:09 AM

Yes, but how do I set that in order to change my menu's class when we're browsing just some categories?

Dismounted 07-15-2008 09:19 AM

$foruminfo['forumid']

Triky 07-15-2008 09:31 AM

Yes, but if I set that.. I define one forum id.. and not a forum category id.
Should I create an array with all the forum ids in wich it should be 'active', or can I define just the categories ids?

Dismounted 07-15-2008 09:47 AM

I believe there is also $foruminfo['parentid'].

Triky 07-15-2008 11:40 AM

Ok, it works but only when I enter one subforum of that category id. When I directly view the category id it doesn't appear as 'current'.
Also, for the forums wich are on my forumhome.. it should be 'current' for the 'Home' part of the menu. I have used THIS_SCRIPT == 'index'.. but it work only when I'm browsing the homepage..

This is my actual code:

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">class="current"</if>>Test 1</a></li>
      <li><a href="forumdisplay.php?f=36">Test 2</a></li>
      <li><a href="forumdisplay.php?f=60">Test 3</a></li>
    </ul>
  </div>
</div>


Dismounted 07-15-2008 11:55 AM

Combine it with $foruminfo['forumid'] ;). As for your home part, you will need to compile all your other ones together, and make one big "not" conditional.

Triky 07-15-2008 12:24 PM

Can you please post me an example of both these methods?
How do I combine them? Also, what do you mean with a 'big "not" conditional'?

Dismounted 07-15-2008 12:54 PM

Code:

<if condition="$foruminfo['parentid'] == 72 OR $foruminfo['forumid'] == 72">
As for your Home link, put all the conditions you use in your other menu links, and negate them (using the ! operator). Make sure you use AND instead of OR as well.


All times are GMT. The time now is 11:50 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.01074 seconds
  • Memory Usage 1,726KB
  • 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
  • (2)bbcode_code_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