vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 2.x Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=4)
-   -   Server Uptime (https://vborg.vbsupport.ru/showthread.php?t=40401)

Chris M 06-29-2002 12:30 PM

What...

You mean :
PHP Code:

include("./uptime.php"); 

That wasnt for you, it was for the person who replied after you:)

Satan

TheWulff 06-29-2002 01:47 PM

hehe I now that but I dont know how to include it in my footer ;(

SemperFidelis 06-29-2002 02:53 PM

Now this is a pretty cool idea
Cheers to evryone for their input so far
:)

Does anyone have an idea on what the best way would be to integrate this with Admin Quick Stats ?

This is what currently is displayed in my /admin/index.php

http://www.vianet.net.au/~daren/vbul...quickstats.jpg

And I would like to add its content directly below
-Server Type
-MYSQL
entries if possible

firewars 06-29-2002 02:54 PM

Neither way is working.
I tried including it in the footer: how would that work anyway? No PHP parsing down there.
I tried parsing the code in the phpinclude-template and then used echo to show the values: there are none.

Somehow I just can't get values to show - not even running "uptime.php" directly gives me valid numbers (0 0 0 must be wrong).

nuno 06-29-2002 03:02 PM

*gee* :eek:
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 :)

firewars 06-29-2002 03:27 PM

I told you I did that.
And as I said, it's (still) not working.

firewars 06-29-2002 03:34 PM

Ok, it's somehow my fault.
I've already got a "script" in my phpinclude-template and it looks like it doesn't really like yours.
Any way to let the vB know where one "script" ends and where another one starts?

firewars 06-29-2002 03:36 PM

Never mind.
I just cut the script there was out and pasted it back in - it seems to work now.
Thanks ;)

Boofo 06-29-2002 05:19 PM

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* :eek:
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 :)


firewars 06-29-2002 05:33 PM

For those that want seconds as well, here you go :)

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;
$seconds = (($minutes $wholeminute)*60);
$wholesecond = (int) $seconds

..for those who want 1 variable that has all the stuff in it, add this line below all the code:

PHP Code:

$sysuptime "System Uptime: $wholeday Days $wholehour Hours $wholeminute Minutes"

..with seconds (see my code):

PHP Code:

$sysuptime "System Uptime: $wholeday Days $wholehour Hours $wholeminute Minutes $wholesecond Seconds"

..then put $sysuptime where you want that line to show - enjoy.


All times are GMT. The time now is 07:04 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.01281 seconds
  • Memory Usage 1,760KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (2)bbcode_code_printable
  • (6)bbcode_php_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.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/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.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
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete