I still have problems this is the code for microstats:
HTML Code:
// Microstats 1.2.1 Plugin
$pageendtime = microtime();
$starttime = explode(' ', $pagestarttime);
$endtime = explode(' ', $pageendtime);
$totaltime = vb_number_format($endtime[0] - $starttime[0] + $endtime[1] - $starttime[1], 5);
$debughtml = '<center><span class="smallfont">Page generated in <b>' . $totaltime . '</b> seconds with <b>' . $vbulletin->db->querycount . '</b> queries';
if ($vbulletin->userinfo['usergroupid'] == 6) {
if ($loadavg = @file_get_contents("/proc/loadavg")) {
$regs = explode(" ",$loadavg);
$serverload = ' [Server Loads: <b>' . $regs[0] .'</b> ' . $regs[1] . ' : ' . $regs[2] . ']';
}elseif ($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] . ']';
}elseif ($loadavg = @`sysctl vm.loadavg|cut -d" " -f3-5`) {
$regs = explode(" ",$loadavg);
$serverload = ' [Server Loads: <b>' . $regs[0] .'</b> ' . $regs[1] . ' : ' . $regs[2] . ']';
}
$debughtml .= iif($_TEMPLATEQUERIES, ' (<b>' . sizeof($_TEMPLATEQUERIES) . '</b> queries for uncached templates)', '') . "$serverload";
ksort($tempusagecache);
foreach ($tempusagecache AS $tempname => $times) {
if ($_TEMPLATEQUERIES["$tempname"]){
$debughtml .= '<center><span class="smallfont">Uncached templates: <font color="red"><b>' . $tempname . '</b></font> (' . $times . ')</span></center>';
}
}
}
$debughtml .= "</span></center>";
if (!$vbulletin->config['Microstats']['replacementvariable']) {
$vbulletin->config['Microstats']['replacementvariable'] = '</body>';
}
if (($vbulletin->config['Microstats']['adminonly'] and $vbulletin->userinfo['usergroupid'] == 5 || $usergroupid == 6) or !$vbulletin->config['Microstats']['adminonly']){
$output = str_replace($vbulletin->config['Microstats']['replacementvariable'], $debughtml . $vbulletin->config['Microstats']['replacementvariable'], $output);
}
// Microstats 1.2.1 Plugin
And this are the lines in my config.php
Code:
$config['Microstats']['adminonly'] = true;
$config['Microstats']['replacementvariable'] = '<!-- display microstats here -->';
Now the problem is noone is able to view microstats.
I only want that microstats should display for Administrator and Super-Moderator group, it should not be visible to any other group
Adminstrator usergroup = 6
super-mod group = 5
Please help.