The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
If condition which returns true if the creator of a post belongs to usergroup
For our forums (VB5), I'd like to give staff members a differently coloured backgrounds in their posts. To this end, I'd like to add the HTML class "staffPost" to each post made by a staff member (usergroupid 5 or 6).
I've spent an entire afternoon searching for the right condition, but can't seem to find it. Any help would be greatly appreciated. In pseudo code: Code:
<vb:if condition="owner of this post belongs to usergroup 5"> staffPost</vb:if> |
#2
|
||||
|
||||
If you would try to change css you should do this by somthing like this in additional.css:
Code:
<vb:if condition="!empty($user['userid']) AND $user['usergroupid'] = 5 OR $user['usergroupid'] = 6"> backgroundcolor: #000; </vb:if> This might help a little bit: http://forum.vbulletin-germany.com/s...te-Bedingungen |
#3
|
|||
|
|||
I didn't know if conditionals worked in the CSS as well, that's great!
The code you provided doesn't seem to accomplish what I'd like it to, though. This changes the background colour of a post when the user viewing it belongs to group 5 or 6. What I'd like it to do, is change the background colour of posts if the owner of that post belongs to group 5 or 6. Do you happen to know what conditional I could use for that? I can't seem to find it in the thread you linked to... |
#4
|
||||
|
||||
Sorry, didn't got it right.
Look into all templates named like conversation... but that should be a little more tricky... have to change the class in code if conversation userid is in usergroup 5 or 6 and make new css-stuff for that staff-class... This is what I found right now... but I don't think there is something with $conversation['groupid'] at vb-original-code. Code:
<vb:if condition="isset($conversation['edit_userid']) AND !$conversation['unpublishdate']"> <vb:if condition="!$conversation['userid']"> If you find something it would be nice to share it. ;-) |
#5
|
|||
|
|||
I can't seem to find anything thus far, I think I'll might just have to do it the lousy way and hardcode the user ID's into the template...
|
#6
|
|||
|
|||
Glenn Vergara provided me with a good solution over at vbulletin.com:
Code:
{vb:data posterInfo, user, fetchUserinfo, {vb:raw conversation['userid']}} <vb:if condition="$posterInfo['usergroupid'] == 5 OR $posterInfo['usergroupid'] == 6">staffPost</vb:if> http://www.vbulletin.com/forum/forum...28#post4326328 |
#7
|
||||
|
||||
Quote:
Looks great and usable in many ways. |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|