vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Design and Graphics Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=168)
-   -   Multiple conditions to showing a navbar menu item (https://vborg.vbsupport.ru/showthread.php?t=256266)

furnival 12-31-2010 04:31 PM

Multiple conditions to showing a navbar menu item
 
I wondered if it's possible to hide a certain menu item in my navbar template if the following conditions are met:
  1. It is a member viewing the forum
  2. They have a post count of greater than 5
  3. Their language preference is set to English

Is there any way of coding that please?

BirdOPrey5 12-31-2010 10:06 PM

1. $show['member']
2. $vbulletin->userinfo['posts']
3. $vbulletin->userinfo['languageid']

However they will only have a post count if they are a member so condition # 1 is irrelevant...

So try putting the navbar code in the following condition:
Code:

<if condition="($vbulletin->userinfo['posts'] > 5) AND ($vbulletin->userinfo['languageid'] == 1)">
navbar code
</if>

This assumes the forum's original language was English so the languageid for English should be #1, if another language was the first install it may be a different id number.

furnival 01-01-2011 05:22 PM

Superb! I take your point about condition # 1 being redundant. That code is so simple and elegant; many thanks!


All times are GMT. The time now is 07:27 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.00977 seconds
  • Memory Usage 1,709KB
  • 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
  • (1)bbcode_code_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (3)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
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete