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)

Brad 06-29-2002 08:42 PM

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

Boofo 06-29-2002 08:46 PM

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.

SemperFidelis 07-01-2002 12:06 AM

Has anyone come up with a way to do this
https://vborg.vbsupport.ru/showthrea...264#post267264

Boofo 07-01-2002 12:17 AM

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


SemperFidelis 07-01-2002 12:34 AM

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.

Boofo 07-01-2002 01:02 AM

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



SemperFidelis 07-01-2002 01:12 AM

Looks pretty cool so far
Good luck
:)

Boofo 07-01-2002 01:17 AM

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

hypedave 07-01-2002 11:39 AM

jus moved my forum over to a new forum, and now the uptime is stuck on my last server's uptime, any suggestions

Boofo 07-01-2002 11:52 AM

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


All times are GMT. The time now is 09:29 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.01447 seconds
  • Memory Usage 1,744KB
  • 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
  • (6)bbcode_code_printable
  • (2)bbcode_php_printable
  • (3)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (3)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