Register Members List Search Today's Posts Mark Forums Read

Reply
 
Thread Tools
  #1  
Old 05 Dec 2009, 21:56
chsmith700 chsmith700 is offline
 
Join Date: Jun 2007
Check if User is in Usergroup (PHP)

Hello,

I am writing a custom script and having some issues verifying if a user is in a usergroup, not in the template file but in the PHP. I tried this but it doesnt seem to be working correctly, What am I doing wrong?


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

I tried just doing an echo '<vb:if condition=\"is_member_of($vbulletin->userinfo, 6)\">' statement but when I do that is displays in the source an array.
Reply With Quote
  #2  
Old 05 Dec 2009, 22:29
ForumsMods's Avatar
ForumsMods ForumsMods is offline
 
Join Date: Aug 2007
Real name: Adrian Sacchi

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

Reply With Quote
  #3  
Old 06 Dec 2009, 20:13
chsmith700 chsmith700 is offline
 
Join Date: Jun 2007
Awesome, thanks alot!
Reply With Quote
  #4  
Old 26 Dec 2009, 12:48
Weetabix Weetabix is offline
 
Join Date: Feb 2007
Could this be used to enable style selection for certain (sub) usergroups only?
Reply With Quote
  #5  
Old 20 Aug 2015, 19:18
TransAmDan TransAmDan is offline
 
Join Date: Nov 2009
I wonder if this should work in the forum Blocks area?
I have the following:-

if (is_member_of($vbulletin->userinfo, 6)) {
$my_output = '';
} else {
$my_output = ' google adsence code......';
}
return $my_output;


However no matter what usergroup I choose the advertising is always displayed. 6 is Admin usergroup and I am admin. I choose usergroup 1 for not logged in, and try that without being logged in, but it still displays the advertising.
I know its not a cached issue, as I just popped in some test text, and that was displayed.
Reply With Quote
  #6  
Old 20 Aug 2015, 19:24
MarkFL's Avatar
MarkFL MarkFL is offline
 
Join Date: Feb 2014
Real name: Mark
Try adding the following to the top of your Content (PHP code)


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


New To Site? Need Help?

All times are GMT. The time now is 12:24.

Layout Options | Width: Wide Color: