View Full Version : List of IF Conditions
RonJH
11-25-2007, 06:18 AM
Does anyone know where I can find a list of all of the available <IF> conditions that can be used in vbulletin?
Marco van Herwaarden
11-25-2007, 06:28 AM
There is no such list. You can use any variable that is defined on that specific script in a condition.
RonJH
11-25-2007, 07:13 AM
Is it possible to run an IF command so that a plugin only appears IF a certain style is selected by the user?
Opserty
11-25-2007, 10:04 AM
Why not just make the modifications to the selected style only? That way it will only appear if the user is running that style.
The if condition would look something like this:
<if condition="$bbuserinfo['styleid'] == X">
SOME CODE
</if>
Where X is the styleid number of the certain style.
Jelmertjee
11-25-2007, 10:53 AM
True, there is no list since anyone can go into a script and define some variables that can be used, but there are a few which I find useful and use quite often, take a look here (http://forum.vbulletinsetup.com/f66/vbulletin-template-conditionals-list-2185.html).
ragtek
11-25-2007, 10:58 AM
True, there is no list since anyone can go into a script and define some variables that can be used, but there are a few which I find useful and use quite often, take a look here (http://forum.vbulletinsetup.com/f66/vbulletin-template-conditionals-list-2185.html).
i acnt see anything
No Thread specified. If you followed a valid link, please notify the administrator
RonJH
11-26-2007, 05:47 AM
<if condition="$bbuserinfo['styleid'] == 15">
include('/home/osorg/public_html/include/head.inc.php');
</if>
Is this accurate?
I put this inside a plugin which is being run at the global_complete hook.
I want it to only run if the user's style is set to ID 15. It doesn't seem to be working. Any suggestions?
Paul M
11-26-2007, 06:59 AM
You need to put php in hooks, what you have there is template 'code'.
RedTyger
11-26-2007, 10:22 AM
if ($vbulletin->userinfo['styleid'] == '15')
{
include(DIR . '/home/osorg/public_html/include/head.inc.php');
}
RonJH
11-30-2007, 06:32 AM
Worked great, thank you!
RonJH
01-30-2008, 06:01 AM
Back again with a question regarding this code:
if ($vbulletin->userinfo['styleid'] == '15')
{
include(DIR . '/home/osorg/public_html/include/head.inc.php');
}
It works, but now I have two forum ID's which I wish to apply this to. I have tried:
if ($vbulletin->userinfo['styleid'] == '15,17')
{
include(DIR . '/home/osorg/public_html/include/head.inc.php');
}
It does not work. Any ideas?
ragtek
01-30-2008, 07:05 AM
if (condition1 OR condition2) ;)
that means:
if (styleid == 15 OR styleid == 17
Dismounted
01-30-2008, 07:46 AM
if (in_array($vbulletin->userinfo['styleid'], array(15, 17)))
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.