Using PHP Functions in Template Conditionals 
As a security precaution, to prevent malicious damage to either your database or your server itself, most PHP functions are disallowed in template conditionals.

This, for example, would be disallowed by the vBulletin template system, as it contains a call to a 'forbidden' function: mysql_query.
<if condition="$my_variable = mysql_query('SELECT * FROM mytable')">
    <!-- naughty naughty... -->
</if>
At the time of writing, the list of allowed 'safe' functions is as follows:
Note:
Functions marked * are custom functions defined by vBulletin itself. Each function name is a link that will take you to the documentation for that function. Use of these functions requires knowledge of PHP
This is an example of 'safe' functions being used in a template conditional:
<if condition="isset($my_variable) AND is_browser('ie')">
    <!-- $my_variable is set and the browser is Internet Explorer -->
</if>
User Contributed Notes: Using PHP Functions in Template Conditionals Add a Comment
x <x at x dot com> Apr 20th '05, 12:11pm
Was looking for the suntax (arguments) for is_member_of(). Would have hoped to find them, or a link to them, on this page (the one returned by searching for "is_member_of")....
Colin <colin dot frei at vbulletin dot com> Apr 20th '05, 12:11pm
is_member_of should be used as follows:

[code]<if condition="is_member_of($bbuserinfo, 6)">foo</if>[/code]

The first variable is the users userinfo (if the user surfing is meant, use $bbuserinfo), the second variable is the usergroup that member has to belong to, for the condition to return true.

Both primary and additional usergroups are searched.
James Harvard <james dot harvard at harvard-digital dot co dot uk> Mar 21st '06, 06:26am
I want to add a conditional that checks whether a user is an administrator or not, but don't seem to be able to find any useful information anywhere.


Edit:
Some useful variables to use in a conditional to check against a user's permissions are:

$show['admincplink']
$show['modcplink']
$show['member']
$show['guest']
Add a Comment