Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 2.x > vBulletin 2.x Full Releases
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Server Uptime Details »»
Server Uptime
Version: 1.00, by Etcher Etcher is offline
Developer Last Online: Aug 2004 Show Printable Version Email this Page

Version: 2.2.x Rating:
Released: 06-27-2002 Last Update: Never Installs: 14
 
No support by the author.

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

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #32  
Old 06-29-2002, 08:42 PM
Brad Brad is offline
 
Join Date: Nov 2001
Posts: 4,765
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

You can also call it via its own template. use nuno's code then do this


in global.php find

PHP Code:
$header='';
$footer=''
under that code add

PHP Code:
eval("\$uptime = \"".gettemplate('uptime')."\";"); 

go to your admin cp and add a new template called uptime and paste this into it


Code:
<smallfont>System Uptime: $wholeday Days $wholehour Hours $wholeminute Minutes
</smallfont>

in the footer replace this

Code:
$copyrighttext<br>
with this

Code:
$copyrighttext<br>$uptime

untested but sould work
Reply With Quote
  #33  
Old 06-29-2002, 08:46 PM
Boofo's Avatar
Boofo Boofo is offline
 
Join Date: Mar 2002
Location: Des Moines, IA (USA)
Posts: 15,776
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

How would I use this in the admin cp in the index file? It doesn't seem to like it when I try to call it from phpinclude...nothing show up.
Reply With Quote
  #34  
Old 07-01-2002, 12:06 AM
SemperFidelis SemperFidelis is offline
 
Join Date: May 2002
Posts: 188
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Has anyone come up with a way to do this
https://vborg.vbsupport.ru/showthrea...264#post267264
Reply With Quote
  #35  
Old 07-01-2002, 12:17 AM
Boofo's Avatar
Boofo Boofo is offline
 
Join Date: Mar 2002
Location: Des Moines, IA (USA)
Posts: 15,776
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Do the following:

In your admin/index.php add this:

Code:
//Server Uptime 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; 
$a='s';
if (intval($wholeday)<1){
	$wholeday=0;
}if (intval($wholeday)==1){
	$a='';
}
$hours = (($days - $wholeday)*24); 
$wholehour = (int) $hours; 
$b='s';
if (intval($wholehour)<1){
	$wholehour=0;
}if (intval($wholehour)==1){
	$b='';
}
$minutes = (($hours - $wholehour)*60); 
$wholeminute = (int) $minutes;
$c='s';
if (intval($wholeminute)<1){
	$wholeminute=0;
}if (intval($wholeminute)==1){
	$c='';
}
$seconds = (($minutes - $wholeminute)*60);
$wholesecond = (int) $seconds;
$d='s';
if (intval($wholesecond)<1){
	$wholesecond=0;
}if (intval($wholesecond)==1){
	$d='';
}

makelabelcode('Server Uptime', "$wholeday day$a, $wholehour hour$b, $wholeminute minute$c and $wholesecond second$d.");
right above this:

Code:
makelabelcode('MySQL', 'v' . $mysqlversion['version']);
and you'll be all set. I even added code that will make it say 1 day or 1 minute instead of days or minutes (plural).

Enjoy!

Quote:
Originally posted by v-net
Has anyone come up with a way to do this
https://vborg.vbsupport.ru/showthrea...264#post267264
Reply With Quote
  #36  
Old 07-01-2002, 12:34 AM
SemperFidelis SemperFidelis is offline
 
Join Date: May 2002
Posts: 188
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Cheers Boofo
Worked like a charm


Quote:
Server Type Linux / PHP v4.1.2
MySQL v3.23.49-log
Server Uptime 149 days, 6 hours, 7 minutes and 23 seconds.
Reply With Quote
  #37  
Old 07-01-2002, 01:02 AM
Boofo's Avatar
Boofo Boofo is offline
 
Join Date: Mar 2002
Location: Des Moines, IA (USA)
Posts: 15,776
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I'm also working on an extention to the Quick Stats that will give you even more information. This is just a start.

Code:
Server Type
 Linux / PHP v4.2.1 | Protocol:HTTP/1.0 | Port:80
 
Server Load Averages
 0.85, 1.01, 0.81
 
Server Uptime
 2 days, 1 hour, 55 minutes and 41 seconds.
 
Current Online Users
 1 users online (1 members & 0 guests).
 
MySQL
 v3.23.45
By the way, notice the "1 hour" above instead of "1 hours" with an s.

Quote:
Originally posted by v-net
Cheers Boofo
Worked like a charm


Reply With Quote
  #38  
Old 07-01-2002, 01:12 AM
SemperFidelis SemperFidelis is offline
 
Join Date: May 2002
Posts: 188
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Looks pretty cool so far
Good luck
Reply With Quote
  #39  
Old 07-01-2002, 01:17 AM
Boofo's Avatar
Boofo Boofo is offline
 
Join Date: Mar 2002
Location: Des Moines, IA (USA)
Posts: 15,776
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Here's the top part of it that I have done and working so far. It is in a table like the Quick Stas but shorter.

vBulletin Extra Options Menu

vBulletin Options
Modify Replacements
Private Messages
View Main Forum
View Memberlist

Run a SQL query
Modify Templates
Spin Threads
New Message Posts
View Online Users

Quick Template Search
Reply With Quote
  #40  
Old 07-01-2002, 11:39 AM
hypedave's Avatar
hypedave hypedave is offline
 
Join Date: Nov 2001
Location: Dallas, Tx
Posts: 320
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

jus moved my forum over to a new forum, and now the uptime is stuck on my last server's uptime, any suggestions
Reply With Quote
  #41  
Old 07-01-2002, 11:52 AM
Boofo's Avatar
Boofo Boofo is offline
 
Join Date: Mar 2002
Location: Des Moines, IA (USA)
Posts: 15,776
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Use myphpadmin and go to the table and delete the row, I think. Look in the database and it should be pretty self-explanatory.
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 12:44 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04892 seconds
  • Memory Usage 2,315KB
  • Queries Executed 25 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (6)bbcode_code
  • (2)bbcode_php
  • (3)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (3)pagenav_pagelink
  • (11)post_thanks_box
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (11)postbit_onlinestatus
  • (11)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete