PDA

View Full Version : Check Usergroup Permissions in Template


Neo_obs
21 Dec 2010, 06:45
I have searched high and low for an answer but have come up with nothing. So I am posting here.

I want to do thisif ($permissions['neots_perms'] & $vbulletin->bf_ugp['neots_perms']['neots_generate'])
but I want to do it in a template. I know it is possible in VB3 but I can't get it to work in VB4.

All help is appreciated.

Lynne
21 Dec 2010, 18:29
What was the code you used in vB3 and what is the code you tried in vB4?

Neo_obs
21 Dec 2010, 19:39
What was the code you used in vB3 and what is the code you tried in vB4?

I didn't have it in VB3, I was using it in PHP but wanted to move it into a template so I could get rid of the PHP file and just use plugins.

Here is what it looks like in the plugin
if ($permissions['neots_perms'] & $vbulletin->bf_ugp['neots_perms']['neots_generate'])
{
$content .= "<a href=\"".$_SERVER['PHP_SELF']."?do=add\">Generate Token</a><br />";
}

A similar code I used in VB3 that worked was
<if condition="!$permissions[tunez_perm] AND $vbulletin->bf_ugp[tunez_perm][tunez_vote]">
NOT ALLOWED
</if>