I'm trying to get markup username for the search results page:
I wrote the following plugin on hook "search_results_thread_process" (file: \packages\vbforum\search\result\thread.php) :
PHP Code:
$getusergroupinfo = $vbulletin->db->query_first("SELECT usergroupid, displaygroupid FROM " . TABLE_PREFIX . "user WHERE userid = " . intval($thread['postuserid']) . "");
$thread['userid'] = $thread['postuserid'];
$thread['username'] = $thread['postusername'];
$thread['usergroupid'] = $getusergroupinfo['usergroupid'];
$thread['displaygroupid'] = $getusergroupinfo['displaygroupid'];
fetch_musername($thread);
... but it means one query (but simple) for each result row-thread, which is not an optimized solution.
Any idea how to get the usergroupid and displaygroupid to be included on $thread by default and don't take it with a new query?
Any idea could be great.