PDA

View Full Version : How do I...


Mythotical
07-19-2007, 01:21 AM
How do I call usergroup permissions and forum permissions in an if condition within a template? I can't figure that out but I need to do that for a mod. I searched through here but didn't find anything so maybe I missed something.

Thanks in advance
Steve M

Guest190829
07-19-2007, 02:12 AM
Personally, I wouldn't put all that logic in templates, do the logic in the php file (or plugin) and then use the $show array to communicate to the templates.

Mythotical
07-19-2007, 02:14 AM
Can't do that for this mod. Need to call the usergroup permissions and forum permissions.

Adrian Schneider
07-19-2007, 02:38 AM
Do what Danny said. PHP for logic, templates (wait, CSS! lol) for presentation.

Mythotical
07-19-2007, 02:54 AM
Well if I do that then I would know what I'm doing as I have no clue what Danny is talking about.

Adrian Schneider
07-19-2007, 03:07 AM
Examples, $show['deleteposts'] = can_moderate($threadinfo['forumid'], 'candeleteposts'); $show['something_cool'] = (
is_member_of($vbulletin->userinfo, 6) or
$forumperms & $vbulletin->bf_ugp_forumpermissions['canmove']
);

Mythotical
07-19-2007, 03:08 AM
Ahhh see I learned something new. Thanks, I will do it that way then since it seems easier.

Adrian, is there a specific code for using forum perms, such as the above that you used for usergroups but instead forum permis.