Quote:
Originally Posted by Alien
How exactly would I adjust this so ANYONE can view it, not just admins?
|
I don't know if I'm allowed to repost but this is what you would do.
PHP Code:
// Microstats hack
$pageendtime = microtime();
$starttime = explode(' ', $pagestarttime);
$endtime = explode(' ', $pageendtime);
$totaltime = vb_number_format($endtime[0] - $starttime[0] + $endtime[1] - $starttime[1], 5);
if ($stats=@exec('uptime')) {
preg_match('/averages?: ([0-9\.]+),[\s]+([0-9\.]+),[\s]+([0-9\.]+)/',$stats,$regs);
$serverload=' [Server Loads: <b>'.$regs[1].'</b> ? '.$regs[2].' : '.$regs[3].']';
}
$debughtml = "<center><span class=\"smallfont\">Page generated in <b>$totaltime</b> seconds with <b>$query_count</b> queries" . iif($_TEMPLATEQUERIES, " (<b>" . sizeof($_TEMPLATEQUERIES) . "</b> queries for uncached templates)", '') . "$serverload</span>";
$vartext = str_replace('</body>', "$debughtml\n</body>", $vartext);
//Microstats Hack
Place that in the same EXACT place as you would have for the orginal hack all this did was took out the check for the admin part.