Version: 2.00, by Trigunflame
Developer Last Online: Nov 2019
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');
// 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');
The only reason I haven't installed it personally, is because Jelsoft generally do a good job at optimising their code and queries. If they could have originally saved on this query without losing some kind of functionality, I'd be wondering why they didn't.
The only reason I haven't installed it personally, is because Jelsoft generally do a good job at optimising their code and queries. If they could have originally saved on this query without losing some kind of functionality, I'd be wondering why they didn't.
Well good thing you asked that actually. I just noticed earlier today that I need to update this hack to reflect a change in 3.5.x that I didnt account for when i ported it from vb3.
It deals with how sessions are updated; before in vb3 it was handled in a single function; now it uses 2 seperate functions for updating the user last active and the session.
So yes, it wont hurt anything to use this small addition.. but it does need to be expanded to deal with the session table as well; which would/could save 2 queries as opposed to the 1.
Well good thing you asked that actually. I just noticed earlier today that I need to update this hack to reflect a change in 3.5.x that I didnt account for when i ported it from vb3.
It deals with how sessions are updated; before in vb3 it was handled in a single function; now it uses 2 seperate functions for updating the user last active and the session.
So yes, it wont hurt anything to use this small addition.. but it does need to be expanded to deal with the session table as well; which would/could save 2 queries as opposed to the 1.