How would you make a single variable out of it so you can call it like this:
$sysuptime
I'm trying to put it in my Quick Stats in the admin cp. And where would I call the variable from? Still in my phpinclude?
Quote:
Originally posted by nuno
*gee* 
paste this into your phpinclude template
PHP Code:
$result = mysql_query("show status");
while ($row = mysql_fetch_array($result)){
if ($row['Variable_name'] == "Uptime") { $uptime = $row['Value']; }
}
$days = ((($uptime/60)/60)/24);
$wholeday = (int) $days;
$hours = (($days - $wholeday)*24);
$wholehour = (int) $hours;
$minutes = (($hours - $wholehour)*60);
$wholeminute = (int) $minutes;
paste this into your footer template, right after $copyrighttext<br>
Code:
<smallfont>System Uptime: $wholeday Days $wholehour Hours $wholeminute Minutes
</smallfont>
All done
|