The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
||||
|
||||
How to tell if a post is by a member of a certain usergroup
I know the below code tells the forum to run code if the current user is a member of a certain usergroup:
if(is_member_of($vbulletin->userinfo, 5, 6, 7)) //stuff goes here if true My question is, is there similar code to decide to run the if statement based on the usergroup of the current poster. Basically I'm in the postbit template and want a conditional to do something if the poster is in a certain usergroup(s). Maybe something like: if(is_member_of($vbulletin->posterinfo, 5, 6, 7)) //stuff goes here if true |
#2
|
||||
|
||||
Try this:
PHP Code:
|
#3
|
||||
|
||||
Quote:
and just to be clear, what I'm really using is Code:
<if condition="(is_member_of($vbulletin->post, 2, 6, 20, 21))"> |
#4
|
||||
|
||||
Quote:
Ah, you want it to use in a template. From your op, I thought you needed the rraw php code. Anyway, try this: HTML Code:
<if condition="is_member_of($post, 2, 6, 20, 21 )"> <!--your code here--> </if> |
#5
|
||||
|
||||
*Perfect* Much thanks!
May I ask did you read about these functions somewhere or just something you picked up along the way? I've made a number of php apps but clueless when it comes to vB. |
#6
|
||||
|
||||
Quote:
|
#7
|
||||
|
||||
Quote:
|
#8
|
||||
|
||||
Quote:
Personally, I did a lot of research here by searching the forums and studying the vb files/templates. And pretty soon everything fell in place and became crystal clear. These forums are a gold mine of information. One can learn a lot. |
#9
|
||||
|
||||
A lot of it hasn't changed. And, you can always just look the function up in the files if you are wondering if it's changed.
|
Thread Tools | |
Display Modes | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|