View Single Post
  #555  
Old 03-18-2012, 11:24 AM
BirdOPrey5's Avatar
BirdOPrey5 BirdOPrey5 is offline
Senior Member
 
Join Date: Jun 2008
Location: New York
Posts: 10,610
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

OK I believe I have a fix for the extra 50 query issue.

I have posted it in JIRA for comment: http://tracker.vbulletin.com/browse/VBIV-14451

I know it solves the query issue on the front end, the only discussion is if it will still fix the bug that brought about this edit to begin with.

The bug only involved exporting styles when using a language other than the master language so if you don't ever do that you can use the fix without issue.

It has reduced query usage on my forum for a post from 77 to 27.

This mod is not the only one that uses adminfunctions_template.php but this fix will fix the query issue for all of them.

The fix is to edit adminfunctions_template.php in the /includes/ direcotry.'

There's a big block of code starting at line 5855 we want to put in an if condition.

So change:
PHP Code:
$only = array
(
  
// phrased groups
  
'buddylist'      => fetch_phrase('group_buddy_list''style'''falsefalse$languageid),
  
'calendar'       => fetch_phrase('group_calendar''style'''falsefalse$languageid),
  
'faq'            => fetch_phrase('group_faq''style'''falsefalse$languageid),
  
'reputation'     => fetch_phrase('group_user_reputation''style'''falsefalse$languageid),
  
'poll'           => fetch_phrase('group_poll''style'''falsefalse$languageid),
  
'pm'             => fetch_phrase('group_private_message''style'''falsefalse$languageid),
  
'register'       => fetch_phrase('group_registration''style'''falsefalse$languageid),
  
'search'         => fetch_phrase('group_search''style'''falsefalse$languageid),
  
'usercp'         => fetch_phrase('group_user_control_panel''style'''falsefalse$languageid),
  
'usernote'       => fetch_phrase('group_user_note''style'''falsefalse$languageid),
  
'whosonline'     => fetch_phrase('group_whos_online''style'''falsefalse$languageid),
  
'showgroup'      => fetch_phrase('group_show_groups''style'''falsefalse$languageid),
  
'posticon'       => fetch_phrase('group_post_icon''style'''falsefalse$languageid),
  
'userfield'      => fetch_phrase('group_user_profile_field''style'''falsefalse$languageid),
  
'bbcode'         => fetch_phrase('group_bb_code_layout''style'''falsefalse$languageid),
  
'help'           => fetch_phrase('group_help''style'''falsefalse$languageid),
  
'editor'         => fetch_phrase('group_editor''style'''falsefalse$languageid),
  
'forumdisplay'   => fetch_phrase('group_forum_display''style'''falsefalse$languageid),
  
'forumhome'      => fetch_phrase('group_forum_home''style'''falsefalse$languageid),
  
'pagenav'        => fetch_phrase('group_page_navigation''style'''falsefalse$languageid),
  
'postbit'        => fetch_phrase('group_postbit''style'''falsefalse$languageid),
  
'posthistory'    => fetch_phrase('group_posthistory''style'''falsefalse$languageid),
  
'threadbit'      => fetch_phrase('group_threadbit''style'''falsefalse$languageid),
  
'im_'            => fetch_phrase('group_instant_messaging''style'''falsefalse$languageid),
  
'memberinfo'     => fetch_phrase('group_member_info''style'''falsefalse$languageid),
  
'memberlist'     => fetch_phrase('group_members_list''style'''falsefalse$languageid),
  
'moderation'     => fetch_phrase('group_moderation''style'''falsefalse$languageid),
  
'modify'         => fetch_phrase('group_modify_user_option''style'''falsefalse$languageid),
  
'new'            => fetch_phrase('group_new_posting''style'''falsefalse$languageid),
  
'showthread'     => fetch_phrase('group_show_thread''style'''falsefalse$languageid),
  
'smiliepopup'    => fetch_phrase('group_smilie_popup''style'''falsefalse$languageid),
  
'subscribe'      => fetch_phrase('group_subscribed_thread''style'''falsefalse$languageid),
  
'whoposted'      => fetch_phrase('group_who_posted''style'''falsefalse$languageid),
  
'threadadmin'    => fetch_phrase('group_thread_administration''style'''falsefalse$languageid),
  
'navbar'         => fetch_phrase('group_navigation_breadcrumb''style'''falsefalse$languageid),
  
'printthread'    => fetch_phrase('group_printable_thread''style'''falsefalse$languageid),
  
'attachmentlist' => fetch_phrase('group_attachment_list''style'''falsefalse$languageid),
  
'userinfraction' => fetch_phrase('group_user_infraction''style'''falsefalse$languageid),
  
'subscription'   => fetch_phrase('group_paid_subscriptions''style'''falsefalse$languageid),
  
'announcement'   => fetch_phrase('announcement''global'''falsefalse$languageid),
  
'visitormessage' => fetch_phrase('group_visitor_message''style'''falsefalse$languageid),
  
'humanverify'    => fetch_phrase('group_human_verification''style'''falsefalse$languageid),
  
'socialgroups'     => fetch_phrase('group_socialgroups''style'''falsefalse$languageid),
  
'picture'        => fetch_phrase('group_picture_comment''style'''falsefalse$languageid),
  
'ad_'            => fetch_phrase('group_ad_location''style'''falsefalse$languageid),
  
'album'          => fetch_phrase('group_album''style'''falsefalse$languageid),
  
'tag'            => fetch_phrase('tag''global'''falsefalse$languageid),
  
'assetmanager'   => fetch_phrase('group_asset_manager''style'''falsefalse$languageid),
  
'css'            => fetch_phrase('group_css''style'''falsefalse$languageid),
  
'block'          => fetch_phrase('group_block''style'''falsefalse$languageid),
  
'facebook'           => fetch_phrase('group_facebook''global'''falsefalse$languageid),
  
'aaa'            => 'AAA Old Backup'
); 
to

PHP Code:
if (THIS_SCRIPT == "")  //Check if being run from front end or back end. Admincp-template.php has no script defined
{
  
$only = array
  (
    
// phrased groups
    
'buddylist'      => fetch_phrase('group_buddy_list''style'''falsefalse$languageid),
    
'calendar'       => fetch_phrase('group_calendar''style'''falsefalse$languageid),
    
'faq'            => fetch_phrase('group_faq''style'''falsefalse$languageid),
    
'reputation'     => fetch_phrase('group_user_reputation''style'''falsefalse$languageid),
    
'poll'           => fetch_phrase('group_poll''style'''falsefalse$languageid),
    
'pm'             => fetch_phrase('group_private_message''style'''falsefalse$languageid),
    
'register'       => fetch_phrase('group_registration''style'''falsefalse$languageid),
    
'search'         => fetch_phrase('group_search''style'''falsefalse$languageid),
    
'usercp'         => fetch_phrase('group_user_control_panel''style'''falsefalse$languageid),
    
'usernote'       => fetch_phrase('group_user_note''style'''falsefalse$languageid),
    
'whosonline'     => fetch_phrase('group_whos_online''style'''falsefalse$languageid),
    
'showgroup'      => fetch_phrase('group_show_groups''style'''falsefalse$languageid),
    
'posticon'       => fetch_phrase('group_post_icon''style'''falsefalse$languageid),
    
'userfield'      => fetch_phrase('group_user_profile_field''style'''falsefalse$languageid),
    
'bbcode'         => fetch_phrase('group_bb_code_layout''style'''falsefalse$languageid),
    
'help'           => fetch_phrase('group_help''style'''falsefalse$languageid),
    
'editor'         => fetch_phrase('group_editor''style'''falsefalse$languageid),
    
'forumdisplay'   => fetch_phrase('group_forum_display''style'''falsefalse$languageid),
    
'forumhome'      => fetch_phrase('group_forum_home''style'''falsefalse$languageid),
    
'pagenav'        => fetch_phrase('group_page_navigation''style'''falsefalse$languageid),
    
'postbit'        => fetch_phrase('group_postbit''style'''falsefalse$languageid),
    
'posthistory'    => fetch_phrase('group_posthistory''style'''falsefalse$languageid),
    
'threadbit'      => fetch_phrase('group_threadbit''style'''falsefalse$languageid),
    
'im_'            => fetch_phrase('group_instant_messaging''style'''falsefalse$languageid),
    
'memberinfo'     => fetch_phrase('group_member_info''style'''falsefalse$languageid),
    
'memberlist'     => fetch_phrase('group_members_list''style'''falsefalse$languageid),
    
'moderation'     => fetch_phrase('group_moderation''style'''falsefalse$languageid),
    
'modify'         => fetch_phrase('group_modify_user_option''style'''falsefalse$languageid),
    
'new'            => fetch_phrase('group_new_posting''style'''falsefalse$languageid),
    
'showthread'     => fetch_phrase('group_show_thread''style'''falsefalse$languageid),
    
'smiliepopup'    => fetch_phrase('group_smilie_popup''style'''falsefalse$languageid),
    
'subscribe'      => fetch_phrase('group_subscribed_thread''style'''falsefalse$languageid),
    
'whoposted'      => fetch_phrase('group_who_posted''style'''falsefalse$languageid),
    
'threadadmin'    => fetch_phrase('group_thread_administration''style'''falsefalse$languageid),
    
'navbar'         => fetch_phrase('group_navigation_breadcrumb''style'''falsefalse$languageid),
    
'printthread'    => fetch_phrase('group_printable_thread''style'''falsefalse$languageid),
    
'attachmentlist' => fetch_phrase('group_attachment_list''style'''falsefalse$languageid),
    
'userinfraction' => fetch_phrase('group_user_infraction''style'''falsefalse$languageid),
    
'subscription'   => fetch_phrase('group_paid_subscriptions''style'''falsefalse$languageid),
    
'announcement'   => fetch_phrase('announcement''global'''falsefalse$languageid),
    
'visitormessage' => fetch_phrase('group_visitor_message''style'''falsefalse$languageid),
    
'humanverify'    => fetch_phrase('group_human_verification''style'''falsefalse$languageid),
    
'socialgroups'     => fetch_phrase('group_socialgroups''style'''falsefalse$languageid),
    
'picture'        => fetch_phrase('group_picture_comment''style'''falsefalse$languageid),
    
'ad_'            => fetch_phrase('group_ad_location''style'''falsefalse$languageid),
    
'album'          => fetch_phrase('group_album''style'''falsefalse$languageid),
    
'tag'            => fetch_phrase('tag''global'''falsefalse$languageid),
    
'assetmanager'   => fetch_phrase('group_asset_manager''style'''falsefalse$languageid),
    
'css'            => fetch_phrase('group_css''style'''falsefalse$languageid),
    
'block'          => fetch_phrase('group_block''style'''falsefalse$languageid),
    
'facebook'           => fetch_phrase('group_facebook''global'''falsefalse$languageid),
    
'aaa'            => 'AAA Old Backup'
  
);
}
else 
//Used in the front end, use the less-query version
{
  
$only = array
  (
    
// phrased groups
    
'buddylist'      => $vbphrase['group_buddy_list'],
    
'calendar'       => $vbphrase['group_calendar'],
    
'faq'            => $vbphrase['group_faq'],
    
'reputation'     => $vbphrase['group_user_reputation'],
    
'poll'           => $vbphrase['group_poll'],
    
'pm'             => $vbphrase['group_private_message'],
    
'register'       => $vbphrase['group_registration'],
    
'search'         => $vbphrase['group_search'],
    
'usercp'         => $vbphrase['group_user_control_panel'],
    
'usernote'       => $vbphrase['group_user_note'],
    
'whosonline'     => $vbphrase['group_whos_online'],
    
'showgroup'      => $vbphrase['group_show_groups'],
    
'posticon'       => $vbphrase['group_post_icon'],
    
'userfield'      => $vbphrase['group_user_profile_field'],
    
'bbcode'         => $vbphrase['group_bb_code_layout'],
    
'help'           => $vbphrase['group_help'],
    
'editor'         => $vbphrase['group_editor'],
    
'forumdisplay'   => $vbphrase['group_forum_display'],
    
'forumhome'      => $vbphrase['group_forum_home'],
    
'pagenav'        => $vbphrase['group_page_navigation'],
    
'postbit'        => $vbphrase['group_postbit'],
    
'posthistory'    => $vbphrase['group_posthistory'],
    
'threadbit'      => $vbphrase['group_threadbit'],
    
'im_'            => $vbphrase['group_instant_messaging'],
    
'memberinfo'     => $vbphrase['group_member_info'],
    
'memberlist'     => $vbphrase['group_members_list'],
    
'moderation'     => $vbphrase['group_moderation'],
    
'modify'         => $vbphrase['group_modify_user_option'],
    
'new'            => $vbphrase['group_new_posting'],
    
'showthread'     => $vbphrase['group_show_thread'],
    
'smiliepopup'    => $vbphrase['group_smilie_popup'],
    
'subscribe'      => $vbphrase['group_subscribed_thread'],
    
'whoposted'      => $vbphrase['group_who_posted'],
    
'threadadmin'    => $vbphrase['group_thread_administration'],
    
'navbar'         => $vbphrase['group_navigation_breadcrumb'],
    
'printthread'    => $vbphrase['group_printable_thread'],
    
'attachmentlist' => $vbphrase['group_attachment_list'],
    
'userinfraction' => $vbphrase['group_user_infraction'],
    
'subscription'   => $vbphrase['group_paid_subscriptions'],
    
'announcement'   => $vbphrase['announcement'],
    
'visitormessage' => $vbphrase['group_visitor_message'],
    
'humanverify'    => $vbphrase['group_human_verification'],
    
'socialgroups'     => $vbphrase['group_socialgroups'],
    
'picture'        => $vbphrase['group_picture_comment'],
    
'ad_'            => $vbphrase['group_ad_location'],
    
'album'          => $vbphrase['group_album'],
    
'tag'            => $vbphrase['tag'],
    
'assetmanager'   => $vbphrase['group_asset_manager'],
    
'css'            => $vbphrase['group_css'],
    
'block'          => $vbphrase['group_block'],
    
'facebook'           => $vbphrase['group_facebook']
  );

Reply With Quote
 
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01346 seconds
  • Memory Usage 2,096KB
  • 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