PDA

View Full Version : is_member_of behaves odd


argon
03-20-2009, 08:33 AM
How can the same condition for template and for php script work different?

I'm trying to make a new module. Which is visible by anyone. Members of a certain group will be able to post data. While rest has just to navigate.

I have a <if condition="is_member_of($bbuserinfo, 19)">in template to show the anchors. It is working as it's intended to be for all users. Just the members of group see the anchors and forms.

In module's php I have to recheck if the user is allowed to do such a request before execution.
if(is_member_of($vbulletin->userinfo['userid'], 19)) $editor=true; else $editor=false; The odd part is this: It works perfect just for me. Whenever I remove myself from the group both the template condition and the php code works as its suppesed to be.
But for the rest? I have one administrator and one standard user that both have membership to that group. The template condition still does its job but somehow php doesn't recognise people as the member of 19.
I removed myself from that group; and php removed my links also I rejoined. PHP re-printed again.
PS: I'm the first administrator with userid:1

Brian
03-20-2009, 08:55 AM
The first variable passed should be $vbulletin->userinfo, not $vbulletin->userinfo['userid'] ;)

Our Sponsors
 

argon
03-20-2009, 09:08 AM
I hate myself...
Thanks