View Full Version : Highlight thread
Kaitlyn2004
10-23-2007, 04:46 PM
I want to highlight a thread in the forumdisplay if they are in a certain usergroup. Looking at $thread in the threadbit_display hook, it has their user id and username, but no usergroup. I don't want to run a query each time to get their usergroup...
Am I missing something or is this not easy to do?
Opserty
10-24-2007, 09:21 AM
You need to add a join to the thread queries.
Add a New Plugin
Hook Location: forumdisplay_query
PHP Code:
$hook_query_fields .= ", user.usergroupid";
$hook_query_joins .= "LEFT JOIN ". TABLE_PREFIX ."user AS user ON(user.userid=postuserid)";
You should then be able to use $thread['usergroupid'] to get the thread starters primary usergroup.
vBulletin® v3.8.12 by vBS, Copyright ©2000-2024, vBulletin Solutions Inc.