Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 3.5 > vBulletin 3.5 Add-ons

Reply
 
Thread Tools
Remove 1 Query Per Page Details »»
Remove 1 Query Per Page
Version: 2.00, by Trigunflame Trigunflame is offline
Developer Last Online: Nov 2019 Show Printable Version Email this Page

Version: 3.5.3 Rating:
Released: 02-10-2006 Last Update: Never Installs: 31
Code Changes  
No support by the author.

[CENTER]Remove 1 Database Query Per Page
Reduce your forums query usage !

Summary: (Quoted From Original Hack for vb3)

Removes 1 Query Per Page.

Instructions:

1. Open includes/class_core.php
2. Go to about line 2538 and look for
PHP Code:
$this->set('location'WOLPATH); 
3. Above that, paste the following.
PHP Code:
$this->set('old_location'$session['location']); 
4. Go to about line 2818 and look for the following:
PHP Code:
            // registered user
            
if (!SESSION_BYPASS)
            {
                if (
TIMENOW $this->userinfo['lastactivity'] > $this->registry->options['cookietimeout'])
                {
                    
// see if session has 'expired' and if new post indicators need resetting
                    
$this->registry->db->shutdown_query("
                        UPDATE " 
TABLE_PREFIX "user
                        SET
                            lastvisit = lastactivity,
                            lastactivity = " 
TIMENOW "
                        WHERE userid = " 
$this->userinfo['userid'] . "
                    "
'lastvisit');

                    
$this->userinfo['lastvisit'] = $this->userinfo['lastactivity'];
                }
                else
                {
                        
$this->registry->db->shutdown_query("
                            UPDATE " 
TABLE_PREFIX "user
                            SET lastactivity = " 
TIMENOW "
                            WHERE userid = " 
$this->userinfo['userid'] . "
                            "
'lastvisit');
                }
            } 
5. Replace that with the following:
PHP Code:
            // registered user
            
if (!SESSION_BYPASS)
            {
                if (
TIMENOW $this->userinfo['lastactivity'] > $this->registry->options['cookietimeout'])
                {
                    
// see if session has 'expired' and if new post indicators need resetting
                    
$this->registry->db->shutdown_query("
                        UPDATE " 
TABLE_PREFIX "user
                        SET
                            lastvisit = lastactivity,
                            lastactivity = " 
TIMENOW "
                        WHERE userid = " 
$this->userinfo['userid'] . "
                    "
'lastvisit');

                    
$this->userinfo['lastvisit'] = $this->userinfo['lastactivity'];
                }
                elseif (
$this->vars['old_location'] != WOLPATH || THIS_SCRIPT == 'misc' || THIS_SCRIPT == 'online')
                {
                    
$this->registry->db->shutdown_query("
                        UPDATE " 
TABLE_PREFIX "user
                        SET lastactivity = " 
TIMENOW "
                        WHERE userid = " 
$this->userinfo['userid'] . "
                        "
'lastvisit');
                }
            } 

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #2  
Old 02-11-2006, 08:42 AM
Corriewf's Avatar
Corriewf Corriewf is offline
 
Join Date: Dec 2004
Location: parse error
Posts: 799
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Awesome! Thanks!
Reply With Quote
  #3  
Old 02-11-2006, 09:38 AM
Trigunflame's Avatar
Trigunflame Trigunflame is offline
 
Join Date: Aug 2002
Posts: 742
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Corriewf
Awesome! Thanks!
Welcomez
Reply With Quote
  #4  
Old 02-11-2006, 01:56 PM
Protoman's Avatar
Protoman Protoman is offline
 
Join Date: Jan 2005
Posts: 237
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

think the vB team will add this to the next version??
Reply With Quote
  #5  
Old 02-11-2006, 02:40 PM
Zia's Avatar
Zia Zia is offline
 
Join Date: Dec 2005
Location: golpo.net
Posts: 931
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

[high]* Zia kliks install
[/high]

Trigunflame what is next tremendious idea to make page laod faster & fatser ?

Reply With Quote
  #6  
Old 02-11-2006, 04:40 PM
Kihon Kata Kihon Kata is offline
 
Join Date: Nov 2003
Posts: 763
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

INstalled! Thanks! but I am running ministats and I am not seeing a decrease on queries listed in there during page loads.
Reply With Quote
  #7  
Old 02-11-2006, 06:29 PM
Trigunflame's Avatar
Trigunflame Trigunflame is offline
 
Join Date: Aug 2002
Posts: 742
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Because if you would look at the query:

$this->registry->db->shutdown_query()

It is a shutdown query that is run as the script is ending, and is not shown in any query counters. Nevertheless it is still sending that query to your forums mysql database which affects the system.

I didnt say this would necessarily make your forum "Faster", I just said it would reduce a query, lol.

Go read my thread in vb3 if you dont believe me...
Reply With Quote
  #8  
Old 02-11-2006, 08:08 PM
GenSec GenSec is offline
 
Join Date: Oct 2001
Posts: 156
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

/me cliks install

Thank you, very usefull!
Reply With Quote
  #9  
Old 02-11-2006, 08:24 PM
GenSec GenSec is offline
 
Join Date: Oct 2001
Posts: 156
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

/me cliks install

Thank you, very usefull!
Reply With Quote
  #10  
Old 02-11-2006, 10:29 PM
Trigunflame's Avatar
Trigunflame Trigunflame is offline
 
Join Date: Aug 2002
Posts: 742
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by GenSec
[high]* GenSec cliks install
[/high]

Thank you, very usefull!
Doublepost, might wanna delete one; lol.
Reply With Quote
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 08:25 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.06776 seconds
  • Memory Usage 2,320KB
  • Queries Executed 23 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (4)bbcode_php
  • (2)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (9)postbit
  • (10)postbit_onlinestatus
  • (10)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • 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
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete