And on that note (this is untested btw, you'll have to tell me if you have problems: oh, and in the interest of saving some time I've "disabled" quickjump altogether, to save me having to rework the cache for it):
One "new" file (redone enough that I didn't do just line by line replacements):
include/cache.php
<?php
/***********************************************************************
Copyright (C) 2002-2005 Rickard Andersson (rickard@punbb.org)
This file is part of PunBB.
PunBB is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published
by the Free Software Foundation; either version 2 of the License,
or (at your option) any later version.
PunBB is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston,
MA 02111-1307 USA
************************************************************************/
// Make sure no one attempts to run this script "directly"
if (!defined('PUN'))
exit;
//
// Generate the config cache PHP script
//
function generate_config_cache()
{
global $pun_config, $db;
// Get the forum config from the DB
$result = $db->query('SELECT * FROM '.$db->prefix.'config', true) or error('Unable to fetch forum config', __FILE__, __LINE__, $db->error());
while ($cur_config_item = $db->fetch_row($result))
$pun_config[$cur_config_item[0]] = $cur_config_item[1];
}
//
// Generate the bans cache PHP script
//
function generate_bans_cache()
{
global $pun_bans, $db;
// Get the ban list from the DB
$result = $db->query('SELECT * FROM '.$db->prefix.'bans', true) or error('Unable to fetch ban list', __FILE__, __LINE__, $db->error());
$pun_bans = array();
while ($cur_ban = $db->fetch_assoc($result))
$pun_bans[] = $cur_ban;
}
//
// Generate the ranks cache PHP script
//
function generate_ranks_cache()
{
global $pun_ranks, $db;
// Get the rank list from the DB
$result = $db->query('SELECT * FROM '.$db->prefix.'ranks ORDER BY min_posts', true) or error('Unable to fetch rank list', __FILE__, __LINE__, $db->error());
$pun_ranks = array();
while ($cur_rank = $db->fetch_assoc($result))
$pun_ranks[] = $cur_rank;
}
And now for the edits!
include/common.php
FIND
// Load cached config
@include PUN_ROOT.'cache/cache_config.php';
if (!defined('PUN_CONFIG_LOADED'))
{
require PUN_ROOT.'include/cache.php';
generate_config_cache();
require PUN_ROOT.'cache/cache_config.php';
}
REPLACE WITH
require PUN_ROOT.'include/cache.php';
generate_config_cache();
FIND
// Load cached bans
@include PUN_ROOT.'cache/cache_bans.php';
if (!defined('PUN_BANS_LOADED'))
{
require_once PUN_ROOT.'include/cache.php';
generate_bans_cache();
require PUN_ROOT.'cache/cache_bans.php';
}
REPLACE WITH
require_once PUN_ROOT.'include/cache.php';
generate_bans_cache();
include/functions.php
FIND
// If not already loaded in a previous call, load the cached ranks
if ($pun_config['o_ranks'] == '1' && empty($pun_ranks))
{
@include PUN_ROOT.'cache/cache_ranks.php';
if (!defined('PUN_RANKS_LOADED'))
{
require_once PUN_ROOT.'include/cache.php';
generate_ranks_cache();
require PUN_ROOT.'cache/cache_ranks.php';
}
}
REPLACE WITH
// If not already loaded in a previous call, load the cached ranks
if ($pun_config['o_ranks'] == '1' && empty($pun_ranks))
{
require_once PUN_ROOT.'include/cache.php';
generate_ranks_cache();
}
footer.php
FIND
// Display the "Jump to" drop list
if ($pun_config['o_quickjump'] == '1')
REPLACE WITH
// Display the "Jump to" drop list
if ($pun_config['o_quickjump'] == '1' && 1 == 2)