![]() |
Server Uptime
Not really a HACK, but nice little script for information...
I added "System Uptime" to the footer of my site: Save this as uptime.php: <?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>"; ?> Then "include" that file in your footer, or anywhere else you want it displayed. The actual uptime is a check of mySQL dB. Enjoy! |
You can also put that in your phpinclude template and then write the variables in the footer template.
|
Cool!
Satan |
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:
PHP Code:
PHP Code:
Satan |
Just incase you want to know:)
Satan |
How would I use the code for this? Where would I put the code and how would I call it in here?
makelabelcode('Server Uptime', uptime.php); |
Just put the php in a file called "uptime.php", and upload it to your admin folder...
Satan |
How would I change the text color to white ? Sorry newbie to PHP..
|
I believe you would enter this :
PHP Code:
|
Thanks for the reply but nope, bot this error...
Parse error: parse error, expecting `','' or `';'' in /home/sites/site33/web/uptime.php on line 15 |
All times are GMT. The time now is 06:54 AM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|