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
  #32  
Old 03-24-2006, 12:25 AM
Alien's Avatar
Alien Alien is offline
 
Join Date: Oct 2001
Posts: 827
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

World will be perfect if someone can confirm this doesn't mess anything up in 3.5.4 so i can use it until he updates it further. The "sessions" thing he mentioned made me nervous so wanted confirmation.
Reply With Quote
  #33  
Old 03-24-2006, 12:34 AM
MissKalunji's Avatar
MissKalunji MissKalunji is offline
 
Join Date: Aug 2003
Location: Canada
Posts: 2,845
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

what session thing?
Reply With Quote
  #34  
Old 03-24-2006, 12:38 AM
Alien's Avatar
Alien Alien is offline
 
Join Date: Oct 2001
Posts: 827
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Umm?

Post #23 in this thread...
Reply With Quote
  #35  
Old 03-26-2006, 08:52 PM
Alien's Avatar
Alien Alien is offline
 
Join Date: Oct 2001
Posts: 827
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Does anyone have an answer to this question?
Reply With Quote
  #36  
Old 03-27-2006, 10:18 PM
Trigunflame's Avatar
Trigunflame Trigunflame is offline
 
Join Date: Aug 2002
Posts: 742
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

It shouldnt mess up anything.
Reply With Quote
  #37  
Old 03-28-2006, 12:06 AM
Alien's Avatar
Alien Alien is offline
 
Join Date: Oct 2001
Posts: 827
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thank you so much!
Reply With Quote
  #38  
Old 06-24-2006, 08:04 AM
mark99 mark99 is offline
 
Join Date: Oct 2002
Posts: 61
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Does it work with 3.6?
Reply With Quote
  #39  
Old 06-24-2006, 08:27 AM
Skyline_GT Skyline_GT is offline
 
Join Date: May 2003
Location: Vancouver, BC
Posts: 482
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

wow thanks. Very useful
Reply With Quote
  #40  
Old 02-10-2007, 09:29 AM
rjmjr69's Avatar
rjmjr69 rjmjr69 is offline
 
Join Date: Jan 2007
Location: Southie
Posts: 876
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Does this work in 3.6.4?
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 01:22 AM.


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.06144 seconds
  • Memory Usage 2,319KB
  • Queries Executed 24 (?)
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
  • (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