diff -r 8f6143115bf5 -r a8a21e1c7afa punbb/include/cache.php --- a/punbb/include/cache.php Wed Jul 11 21:28:39 2007 -0400 +++ b/punbb/include/cache.php Thu Jul 12 01:04:01 2007 -0400 @@ -78,11 +78,11 @@ // function generate_config_cache() { - global $db; + global $pun_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)) + $result = $pun_db->query('SELECT * FROM '.$pun_db->prefix.'config', true) or error('Unable to fetch forum config', __FILE__, __LINE__, $pun_db->error()); + while ($cur_config_item = $pun_db->fetch_row($result)) $output[$cur_config_item[0]] = $cur_config_item[1]; // Output config as PHP code @@ -101,13 +101,13 @@ // function generate_bans_cache() { - global $db; + global $pun_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()); + $result = $pun_db->query('SELECT * FROM '.$pun_db->prefix.'bans', true) or error('Unable to fetch ban list', __FILE__, __LINE__, $pun_db->error()); $output = array(); - while ($cur_ban = $db->fetch_assoc($result)) + while ($cur_ban = $pun_db->fetch_assoc($result)) $output[] = $cur_ban; // Output ban list as PHP code @@ -126,13 +126,13 @@ // function generate_ranks_cache() { - global $db; + global $pun_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()); + $result = $pun_db->query('SELECT * FROM '.$pun_db->prefix.'ranks ORDER BY min_posts', true) or error('Unable to fetch rank list', __FILE__, __LINE__, $pun_db->error()); $output = array(); - while ($cur_rank = $db->fetch_assoc($result)) + while ($cur_rank = $pun_db->fetch_assoc($result)) $output[] = $cur_rank; // Output ranks list as PHP code @@ -151,7 +151,7 @@ // function generate_quickjump_cache($group_id = false) { - global $db, $lang_common, $pun_user; + global $pun_db, $lang_common, $pun_user; // If a group_id was supplied, we generate the quickjump cache for that group only if ($group_id !== false) @@ -159,11 +159,11 @@ else { // A group_id was now supplied, so we generate the quickjump cache for all groups - $result = $db->query('SELECT g_id FROM '.$db->prefix.'groups') or error('Unable to fetch user group list', __FILE__, __LINE__, $db->error()); - $num_groups = $db->num_rows($result); + $result = $pun_db->query('SELECT g_id FROM '.$pun_db->prefix.'groups') or error('Unable to fetch user group list', __FILE__, __LINE__, $pun_db->error()); + $num_groups = $pun_db->num_rows($result); for ($i = 0; $i < $num_groups; ++$i) - $groups[] = $db->result($result, $i); + $groups[] = $pun_db->result($result, $i); } // Loop through the groups in $groups and output the cache for each of them @@ -178,10 +178,10 @@ $output .= "\t\t\t\t".'
'."\n\t\t\t\t\t".'