Thread: End-User Options - Starred Posts
View Single Post
  #86  
Old 10-22-2017, 11:50 PM
MarkFL's Avatar
MarkFL MarkFL is offline
 
Join Date: Feb 2014
Location: St. Augustine, FL
Posts: 3,853
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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'') . "
    "
); 
Reply With Quote
 
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01081 seconds
  • Memory Usage 1,825KB
  • Queries Executed 11 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD_SHOWPOST
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (2)bbcode_php
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_box
  • (1)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit_info
  • (1)postbit
  • (1)postbit_onlinestatus
  • (1)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • reputationlevel
  • showthread
Included Files:
  • ./showpost.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showpost_start
  • bbcode_fetch_tags
  • bbcode_create
  • postbit_factory
  • showpost_post
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • showpost_complete