View Full Version : Multiple conditions to showing a navbar menu item
furnival
12-31-2010, 04:31 PM
I wondered if it's possible to hide a certain menu item in my navbar template if the following conditions are met:
It is a member viewing the forum
They have a post count of greater than 5
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:
<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!
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.