The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
||||
|
||||
What is the if condition= for group & logged in?
I am trying to add a field to the postbit, and to show up only if the logged in user is within a specific group.
What is the <if condition="?????"></if> to see if user is in the group(s) and also logged in? |
#2
|
||||
|
||||
HTML Code:
<if condition="is_member_of($posts,2)"> do something </if> |
#3
|
||||
|
||||
Quote:
Last Q - vBulletin.vb_userfield.field1 (admin defined profile field) how do I reference it to display? i.e. HTML Code:
<if condition="is_member_of($posts,2)"> display vb_userfield.field1 </if> |
#4
|
|||
|
|||
In the postbit
Code:
$post[fieldx] Or in the memberinfo Code:
$userinfo[fieldx] |
#5
|
||||
|
||||
Hmm...
HTML Code:
... <a class="bigusername" href="member.php?$session[sessionurl]u=$post[userid]">$post[musername]</a> <if condition="is_member_of($posts,9)">$post[field8] </if> $post[onlinestatus]... If I remove the conditional, the text is displayed without a problem. What could I be doing wrong? Does the group have to be the primary group? Is there a "set" list, where I can define a set of groups? (Is there a central reference to all this, so I don't have to bug all of you on this for the next 2 dozen issues?) |
#6
|
||||
|
||||
I could be wrong but it looks like you're defining that if the user who posted is in Usergroup 9 then $post[field8] will show up. If yes, then anyone (logged in or not) will be able to view field8 for that particular post. It may explain why you didn't see field8.
If you want only Usergroup "9" to see "$post[field8]" then try: Code:
<if condition="is_member_of($bbuserinfo, 9)">$post[field8]</if> |
#7
|
||||
|
||||
Excellent! Works like a charm.
Thank you. Where can I get some sort of a manual or details of these fields, functions, etc? |
#8
|
||||
|
||||
NP.
Aside from vBulletin's manual I've gathered what I need from vBulletin.com. In the "How Do I..." and "Quick Tips & Custiomizations" forums you can get quite a bit of information by doing various searches. Also, a good tip is to study the vB's .php codes and various vB.org hacks as they often contain common routines. |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|