PDA

View Full Version : $post['usergroupid'] and <if> Questions


UberMensch
10-02-2007, 09:13 PM
I'm trying to do this in the postbit_legacy:


<if condition="$post['usergroupid'] == 8"> (If the post OWNER's usergroup id is 8)
<!-- HTML here -->
<else />
<!-- More Code -->
</if>


I'm pretty sure the "$post['usergroupid']" part is wrong. Is there a list of all the $post/$bbuserinfo variables?

Also, which conditions are allowed in the <if> statements? Are they similar/the same as php?

Freesteyelz
10-03-2007, 02:19 AM
Conditional for Usergroup is:


<if condition="is_member_of($bbuserinfo, x,y,z)">
<!-- HTML here -->
<else />
<!-- More Code -->
</if>


Just change the x,y,z to the Usergroup ID's. Remove the extras. :)

Dismounted
10-03-2007, 05:20 AM
<if condition="is_member_of($post, x,y,z)">
<!-- HTML here -->
<else />
<!-- More Code -->
</if>
I believe he was wanting to base it off the poster (as he is editing postbit_legacy).

Freesteyelz
10-03-2007, 06:27 AM
Ahh...I see. :)

UberMensch
10-03-2007, 08:42 AM
Thanks very much! So conditions are basically the same as php?

Also, what other things can I use with $post?

Dismounted
10-03-2007, 09:39 AM
Whatever's in the post array. Also, keep in mind there is no "else if" template condition, due to the format of which vBulletin parses them.

Dankness
10-03-2007, 10:16 AM
Whatever's in the post array. Also, keep in mind there is no "else if" template condition, due to the format of which vBulletin parses them.

can't you nest a if inside of a else like this thou? I haven't found the need to test the theory but i belive it possible

<if condition="this">
Do Something
<else />
<if condition="that"
Do Something Else
</if>
</if>

Dismounted
10-03-2007, 11:10 AM
Yes, you can nest conditionals, but they aren't "true" else ifs.

Freesteyelz
10-04-2007, 01:09 AM
can't you nest a if inside of a else like this thou? I haven't found the need to test the theory but i belive it possible

<if condition="this">
Do Something
<else />
<if condition="that"
Do Something Else
</if>
</if>



I've been doing something like that for such things as an avatar. If Flash then custom avatar is overrided; if custom avatar then default avatar is overrided; if Flash and custom avatar is false then default avatar will display.

mem0ries
11-16-2007, 01:20 PM
how come it doesnt work for me ?

i'm editing it inside postbit_legacy,

i code this, but cant .
<if condition="is_member_of($post, 8,9,10)">
<!-- HTML here -->
</if>

any idea how to code it?
when it show, it will become Group: (the group you are in)

Gray Matter
11-16-2007, 01:45 PM
how come it doesnt work for me ?
Post your code.

mem0ries
11-16-2007, 01:49 PM
<if condition="is_member_of($post, x,y,z)">
<!-- HTML here -->
<else />
<!-- More Code -->
</if>

i wanted it to look like - > https://vborg.vbsupport.ru/external/2007/11/30.jpg
Group: (the groups you are in)

er, editing in postbit_legacy, and it show on the person who posted.

Gray Matter
11-16-2007, 10:23 PM
I don't understand what you're trying to say. :confused:

mem0ries
11-17-2007, 05:17 AM
To get the group name you will need a plugin to run a query against the usergroup ID they are in. You would need to ask this over at www.vbulletin.org.

^ this is what i get over at vbulletin.com,
i needs the full codes.