Yes, my product's contribution to that query can be found in the plugin hooked at "forumdisplay_query" which reads:
PHP Code:
global $vbulletin;
if ($vbulletin->options['markfl_starpost_active'])
{
$hook_query_fields .= ', (SELECT COUNT(*) FROM ' . TABLE_PREFIX . 'starposts AS starposts WHERE starposts.userid = ' . $vbulletin->userinfo['userid'] . ' AND starposts.threadid = thread.threadid) AS starcount';
}
The rest of the query (assuming no other products are adding to that query) can be found in the core vB script "forumdisplay.php" here:
PHP Code:
($hook = vBulletinHook::fetch_hook('forumdisplay_query')) ? eval($hook) : false;
$threads = $db->query_read_slave("
SELECT $votequery $previewfield
thread.threadid, thread.title AS threadtitle, thread.forumid, thread.pollid, thread.open, thread.postusername, thread.postuserid, thread.iconid AS threadiconid,
thread.dateline, thread.notes, thread.visible, thread.sticky, thread.votetotal, thread.attach, $tachy_columns,
thread.prefixid, thread.taglist, thread.hiddencount, thread.deletedcount, user.userid,
user.membergroupids, user.infractiongroupids, user.usergroupid, user.homepage, user.options AS useroptions, IF(userlist.friend = 'yes', 1, 0) AS isfriend,
user.lastactivity, user.lastvisit, IF(user.options & " . $vbulletin->bf_misc_useroptions['invisible'] . ", 1, 0) AS invisible
" . ($fetchavatar ? "
,avatar2.avatarpath AS api_avatarpath, NOT ISNULL(customavatar2.userid) AS api_hascustomavatar, customavatar2.dateline AS api_avatardateline, customavatar2.width AS api_avwidth, customavatar2.height AS api_avheight,
user2.adminoptions AS api_adminoptions, user2.userid AS api_userid, user2.usergroupid AS api_usergroupid, user2.membergroupids AS api_membergroupids, user2.infractiongroupids AS api_infractiongroupids, user2.avatarrevision AS api_avatarrevision
" : "") . "
" . (($vbulletin->options['threadsubscribed'] AND $vbulletin->userinfo['userid']) ? ", NOT ISNULL(subscribethread.subscribethreadid) AS issubscribed" : "") . "
" . ($deljoin ? ", deletionlog.userid AS del_userid, deletionlog.username AS del_username, deletionlog.reason AS del_reason" : "") . "
" . (($vbulletin->userinfo['userid']) ? ", threadread.readtime AS threadread" : "") . "
" . ($redirectjoin ? ", threadredirect.expires" : "") . "
$hook_query_fields
FROM " . TABLE_PREFIX . "thread AS thread
LEFT JOIN " . TABLE_PREFIX . "user AS user ON (user.userid = thread.lastposterid)
LEFT JOIN " . TABLE_PREFIX . "userlist AS userlist ON (userlist.relationid = user.userid AND userlist.type = 'buddy' AND userlist.userid = " . $vbulletin->userinfo['userid'] . ")
" . ($fetchavatar ? "
LEFT JOIN " . TABLE_PREFIX . "user AS user2 ON (thread.postuserid = user2.userid)
LEFT JOIN " . TABLE_PREFIX . "avatar AS avatar2 ON(avatar2.avatarid = user2.avatarid)
LEFT JOIN " . TABLE_PREFIX . "customavatar AS customavatar2 ON(customavatar2.userid = user2.userid)
" : "") . "
$deljoin
" . (($vbulletin->options['threadsubscribed'] AND $vbulletin->userinfo['userid']) ? " LEFT JOIN " . TABLE_PREFIX . "subscribethread AS subscribethread ON(subscribethread.threadid = thread.threadid AND subscribethread.userid = " . $vbulletin->userinfo['userid'] . " AND canview = 1)" : "") . "
" . (($vbulletin->userinfo['userid']) ? " LEFT JOIN " . TABLE_PREFIX . "threadread AS threadread ON (threadread.threadid = thread.threadid AND threadread.userid = " . $vbulletin->userinfo['userid'] . ")" : "") . "
$previewjoin
$tachyjoin
$redirectjoin
$hook_query_joins
WHERE thread.threadid IN (0$ids) $hook_query_where
ORDER BY thread.sticky DESC, $sqlsortfield $sqlsortorder" . (!empty($sqlsortfield2) ? ", $sqlsortfield2 $sqlsortorder" : '') . "
");