Quote:
Originally Posted by Boofo
Thanks, Floren, for the update. I only posted this to help you out with all of the messages you'll get wanting to know how to update this great hack.
|
Bob, be aware, there are some other changes in the functions.php code beside the code you posted, like for example you need to globalize certain new variables...
Look at the global line there.
If I would be you, I would replace, in functions.php, the first block of code (first change) to make sure there is no confusion:
Code:
function print_output($vartext, $sendheader = 1)
{
global $pagestarttime, $query_count, $querytime, $DB_site, $bbuserinfo;
global $vbphrase, $vboptions, $stylevar, $_REQUEST, $_TEMPLATEQUERIES, $tempusagecache, $debug, $nozip, $ms;
$pageendtime = microtime();
// Number of decimals to show for microtime (ex 0.15227890)
$msdecimal = '8';
if ($vboptions['addtemplatename'])
{
if ($doctypepos = strpos($vartext, $stylevar['htmldoctype']))
{
$comment = substr($vartext, 0, $doctypepos);
$vartext = substr($vartext, $doctypepos + strlen($stylevar['htmldoctype']));
$vartext = $stylevar['htmldoctype'] . "\n" . $comment . $vartext;
}
}
$starttime = explode(' ', $pagestarttime);
$endtime = explode(' ', $pageendtime);
$totaltime = vb_number_format($endtime[0] - $starttime[0] + $endtime[1] - $starttime[1], $msdecimal);
$msphp = vb_number_format(((($totaltime - $querytime) / $totaltime) * 100), 2) . '% PHP';
$mssql = vb_number_format((($querytime / $totaltime) * 100), 2) . '% MySQL';
$ms = '<tr align="right">' . "\n";
$ms .= ' <td class="tcat"' . iif($vboptions['allowchangestyles'], ' colspan="2"') . '><div class="smallfont">';
$ms .= 'Page generated in ' . $totaltime . ' seconds (' . $msphp . ' - ' . $mssql . ') with ';
$ms .= $query_count . ' queries</div></td>' . "\n";
$ms .= '</tr>' . "\n";
if ($bbuserinfo['usergroupid'] == '6')
{
$mstemplates = '<select size="1" style="font-size: 10px">' . "\n";
if ($_TEMPLATEQUERIES)
{
$mstemplates .= '<option>' . sizeof($_TEMPLATEQUERIES) . ' Uncached Template';
$mstemplates .= iif(sizeof($_TEMPLATEQUERIES) != '1', 's') . '</option>';
if (is_array($tempusagecache))
{
global $vbcollapse;
ksort($tempusagecache);
foreach ($tempusagecache AS $tempname => $times)
{
if ($_TEMPLATEQUERIES["$tempname"])
{
$mstemplates .= '<option class="alt2">' . $tempname . ' (' . $times . ')</option>';
}
else
{
$mstemplates .= '<option>' . $tempname . ' (' . $times . ')</option>';
}
}
}
}
else
{
$mstemplates .= '<option>NO Uncached Templates</option>';
}
$mstemplates .= '</select>';
$msdebug = 'DEBUG Mode OFF | ';
if ($debug)
{
$msdebug = 'DEBUG Mode ON | ';
}
$msgzip = 'GZIP OFF | ';
if ($vboptions['gzipoutput'] AND !$nozip)
{
$msgzip = 'GZIP ON (level ' . $vboptions['gziplevel'] . ') | ';
}
$msserver = '';
if ($stats = @exec('uptime 2>&1') AND trim($stats) != '')
{
if (preg_match("/averages?: ([0-9\.]+),[\s]+([0-9\.]+),[\s]+([0-9\.]+)/", $stats, $regs))
{
$regs[1] = vb_number_format($regs[1], 2);
$regs[2] = vb_number_format($regs[2], 2);
$regs[3] = vb_number_format($regs[3], 2);
$msserver = '<b>' . $regs[1] . '</b> : ' . $regs[2] . ' : ' . $regs[3] . ' | ';
}
}
$ms .= '<tr align="right">' . "\n";
$ms .= ' <td class="alt1"' . iif($vboptions['allowchangestyles'], ' colspan="2"') . '><div class="smallfont">';
$ms .= $msdebug . $msgzip . $msserver . $mstemplates . '</div></td>' . "\n";
$ms .= '</tr>' . "\n";
}
if (DB_QUERIES)
{
$ms = '';
$vartext .= "<!-- Page generated in " . $totaltime . " seconds with $query_count queries -->";
}
// ####################################################################
// temporary code
global $DEVDEBUG, $_SERVER;
if ($debug)
{
That will fix the space issue mentioned before by other people as well globalize the templates cache, $tempusagecache.
Let me know if that makes sense. Thanks Bob.