The Arcive of vBulletin Modifications Site. |
|
Server Uptime Details »»
|
|||||||||||||||||||||||||
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! Show Your Support
|
|||||||||||||||||||||||||
| Comments |
|
#2
|
|||
|
|||
|
You can also put that in your phpinclude template and then write the variables in the footer template.
|
|
#3
|
||||
|
||||
|
Cool!
Satan |
|
#4
|
||||
|
||||
|
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 |
|
#5
|
||||
|
||||
|
Just incase you want to know
![]() Satan |
|
#6
|
||||
|
||||
|
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); |
|
#7
|
||||
|
||||
|
Just put the php in a file called "uptime.php", and upload it to your admin folder...
Satan |
|
#8
|
|||
|
|||
|
How would I change the text color to white ? Sorry newbie to PHP..
|
|
#9
|
||||
|
||||
|
I believe you would enter this :
PHP Code:
|
|
#10
|
|||
|
|||
|
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 |
![]() |
|
|