I think you will find that if you wanted add it to the Admin CP, you could do this :
in admin/index.php
Find :
PHP Code:
makenavselect("Options","<hr>");
// *************************************************
And add below :
PHP Code:
makenavoption("Uptime","uptime.php?s=");
makenavselect("Database");
// ***
Then create a new file called uptime.php, and enter :
PHP Code:
<html>
<head>
<link rel="stylesheet" href="../cp.css">
</head>
</html>
<?PHP
$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;
echo "<center><font size=1>";
echo "System Uptime: ";
echo $wholeday . " Days ";
echo $wholehour . " Hours ";
echo $wholeminute . " Minutes <br>";
echo "</font></center>";
?>
(The difference is, that this takes the CP colours and uses them instead of just white and black)
Satan