View Full Version : Highlighting Threads by Author's User Group
greytone
09-01-2011, 08:02 PM
I want my thread list in each sub-forum to emphasize threads that were created by Administrators. For instance, have their name in red.
It would make sense to edit the memberaction_dropdown template because this is where the user names are printed, but I can't figure out what conditional statement to write. Any suggestions?
I already have the posts within a single thread doing custom styling on the username, but this doesn't affect the list of thread in a forum.
Lynne
09-01-2011, 11:17 PM
Try a condition like (not exactly like this since I put a comment in it!):
<vb:if condition="is_member_of($memberinfo, x)">
<span style="whatever">{vb:raw memberinfo.username}
(or {vb:raw memberinfo.musername} )
</span>
<vb:else />
{vb:raw memberinfo.username}
(or {vb:raw memberinfo.musername} )
</vb:if>Change x to the usergroup you want
greytone
09-02-2011, 09:26 PM
Hi Lynne,
I'm afraid that your suggestion didn't work.
No matter what number I substitute for X, it never executes as "true".
I suspect that the $member variable doesn't evaluate.
Any other suggestions?
Lynne
09-02-2011, 10:03 PM
Whoops, sorry, it is $memberinfo. And, I didn't do the else correctly (why did I write another if???).
A correct example for replacing the username (need to do the same for musername):
<vb:if condition="is_member_of($memberinfo, 6)">
<span style="color:red">{vb:raw memberinfo.username}</span>
<vb:else />
{vb:raw memberinfo.username}
</vb:if>
And, if you only want it on the forumdisplay page, you may need to add in the condition "AND THIS_SCRIPT=='forumdisplay'" also.
greytone
09-06-2011, 03:41 PM
It works!
Thank you very much!
dany_danay
10-21-2013, 06:54 PM
Hi, now i think its not woriking ... :(
tbworld
10-21-2013, 09:17 PM
Hi, now i think its not woriking ... :(
Please describe what is not working and where you are trying to implement @Lynnes code. We can only be as helpful as per the data you provide us. Most likely you are implementing @Lynne's code snippet incorrectly. Give your question another go. :)
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.