Back to vBulletin 3.5 Add-ons

Remove 1 Query Per Page
Mod Version: 2.00, by Trigunflame

This modification is in the archives.
vB Version: 3.5.3 Rating: (1 vote - 5.00 average) Installs: 31
Released: 11 Feb 2006 Last Update: Never Downloads: 10
Not Supported Code Changes  

[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');
                }
            } 

Download

No files for download.

Similar Mods

Remove 1 Database Query Per Page vBulletin 3.0 Full Releases

vblts.ru supports vBulletin®, 2022-2024