I want to mod several templates that display content based on whether a user is a member of a group. Instead of doing
Code:
<if condition="is_member_of($vbulletin->userinfo,6,7,15)">
for every template edit, I thought i'd define it as a plugin, like so:
Hook: parse_templates
Plugin:
Code:
$is_youth = false;
if (is_member_of($vbulletin->userinfo,6,7,15))
{
$is_youth = true;
}
and in the template:
Code:
<if condition="$is_youth">
So I only need to define it once.
It works fine for the header and footer, but not postbit (as part of the user's profile). I know I am editting the correct postbit, and I have tried other hooks like global_start and postbit_display_start.
Can anyone see where I am going wrong? Is it that the $vbulletin->userinfo is not available to postbit? Because the <if condition="is_member_of($vbulletin->userinfo,6,7,15)"> doesn't work either. However, even if I don't use it and use a custom variable instead, it still doesn't show in postbit. Anyone know why?
Just starting to get involved in modding VB so it could be something really simple.
Many thanx.