The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
||||
|
||||
[SOLVED] If and or Condition
SOLVED:
save you some reading. if anyone needs an if condition similar it turned out to be: Code:
<if condition="$show['registerbutton'] OR ($vboptions[someOption] == 1 AND ($vboptions[someOption] == 1 AND is_member_of($bbuserinfo, 6)))"> My if condition is currently as follows Code:
<if condition="$show['registerbutton'] OR $vboptions[someOption] == 1"> kind of like Code:
<if condition="$show['registerbutton'] OR $vboptions[someOption] == 1 AND $show['admin']"> with the option on, guests can still see it but now only admins can too. is this possible? |
#2
|
|||
|
|||
Use two ORs??...
Code:
<if condition="$show['registerbutton'] OR ($vboptions[someOption] == 1 OR $show['admin'])"> |
#3
|
||||
|
||||
Quote:
the option has to be on (1) in order for the admin to see it, if the option is off (0) then the admin wont see it but the guest (or people who can see the registerbutton) can still see it. if i used 2 ORs the admin will always see it |
#4
|
|||
|
|||
Easy enough. Is this closer to what you want?
Code:
<if condition="$show['registerbutton'] OR ($vboptions[someOption] == 1 OR ($vboptions[someOption] == 1 AND $show['admin']))"> |
#5
|
||||
|
||||
one too many ORs in there but i gave it a shot like
Code:
<if condition="$show['registerbutton'] OR ($vboptions[someOption] == 1 AND $show['admin'])"> |
#6
|
|||
|
|||
Quote:
Give exactly who should view what under what conditions. To break it down.. Code:
<if condition="$show['registerbutton'] // SHOW IF TRUE OR ($vboptions[someOption] == 1 // SHOW TO THIS OPTION OR ($vboptions[someOption] == 1 AND $show['admin']))"> // SHOW IF BOTH THIS OPTION AND SHOW ADMIN ARE TRUE |
#7
|
||||
|
||||
option set to yes
GUEST and ADMIN view FORUM HOME REGISTER NOW option set to no GUEST view FORUM HOME REGISTER NOW ADMIN view none registered members will never see it --------------- Added [DATE]1456516446[/DATE] at [TIME]1456516446[/TIME] --------------- Code:
<if condition="$show['registerbutton'] OR ($vboptions[someOption] == 1 AND $show['admin'])"> but the code would be Code:
<if condition="$show['registerbutton'] OR ($vboptions[someOption] == 1 AND $show['admin'])"> <DIV> BUTTON</DIV> </if> i used Code:
<if condition="$show['registerbutton'] OR ($vboptions[someOption] == 1 OR ($vboptions[someOption] == 1 AND $show['admin']))"> |
#8
|
|||
|
|||
IGNORE ORIGINAL POST
--------------- Added [DATE]1456517268[/DATE] at [TIME]1456517268[/TIME] --------------- Quote:
Code:
<if condition="$show['registerbutton'] AND ($vboptions[someOption] == 1 OR ($vboptions[someOption] == 1 AND $show['admin']))"> Code:
<if condition="$show['registerbutton'] AND (($vboptions[someOption] == 1 AND !$show['admin']) OR ($vboptions[someOption] == 1 AND $show['admin']))"> |
#9
|
||||
|
||||
now guest cant see it if the option is off, and the admin cant see it at all =/
|
#10
|
||||
|
||||
this is my product im working on if it will help you to see it and the way im trying to use it.
line 15 is where the if condition is <if condition="$show['registerbutton'] OR ($vboptions[drc_rb_edt] == 1 OR ($vboptions[drc_rb_edt] == 1 AND $show['admin']))"> is what is currently in there, but this makes it so other members can see it also. i always want guest to see it, then the admin to have an option to turn it on or off for themselves, not for everyone. |
Thread Tools | |
Display Modes | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|