You are missing our premiere tool bar navigation system! Register and use it for FREE!

NukeCops  
•  Home •  Downloads •  Gallery •  Your Account •  Forums • 
Readme First
- Readme First! -

Read and follow the rules, otherwise your posts will be closed
Modules
· Home
· FAQ
· Buy a Theme
· Advertising
· AvantGo
· Bookmarks
· Columbia
· Community
· Donations
· Downloads
· Feedback
· Forums
· PHP-Nuke HOWTO
· Private Messages
· Search
· Statistics
· Stories Archive
· Submit News
· Surveys
· Theme Gallery
· Top
· Topics
· Your Account
Who's Online
There are currently, 188 guest(s) and 0 member(s) that are online.

You are Anonymous user. You can register for free by clicking here
Nuke Cops :: View topic - The Serverload.php Install Help [ ]
 Forum FAQ  •  Search  •   •  Memberlist  •  Usergroups   •  Register  •  Profile •    •  Log in to check your private messages  •  Log in

 
Post new topic  Reply to topicprinter-friendly view
View previous topic Log in to check your private messages View next topic
Author Message
BeatJunkie
Nuke Cadet
Nuke Cadet


Joined: Jun 13, 2004
Posts: 3


PostPosted: Sun Jun 13, 2004 5:33 pm Reply with quoteBack to top

I am going nuts, I have searched the forum up and down and all the answers are unclear too me. I have serverload.php in my Nuke Root directory. Where do I add the include and how how do I call it? Please give me step by step. Many thanks in advance.
Find all posts by BeatJunkieView user's profileSend private message
NukeFanatic
Sergeant
Sergeant


Joined: May 20, 2004
Posts: 89


PostPosted: Sun Jun 13, 2004 6:03 pm Reply with quoteBack to top

im not familiar with serverload.php - what is it and where can you get it?

have you tried:
http://www.nukecops.com/postt7091.html

Quote:

"Where do I add the include and how how do I call it?"


"add the include?" <- is this part of th install?

"how do i call it" <- you call php programs by typing therir name in the addressbar
of your browser. ie http://mydomain.com/serverload.php

don
Find all posts by NukeFanaticView user's profileSend private message
Tank863
Lieutenant
Lieutenant


Joined: Feb 21, 2003
Posts: 195

Location: Philadelphia

PostPosted: Sun Jun 13, 2004 6:34 pm Reply with quoteBack to top

Open footer.php and search for:
Code:
function foot() {


Before add:
Code:

// SERVER LOAD
   include("serverload.php");
   $serverload=serverload();
//
// Compress buffered output if required and send to browser
//
if ( $do_gzip_compress )
{
   //
   // Borrowed from php.net!
   //
   $gzip_contents = ob_get_contents();
   ob_end_clean();
   $gzip_size = strlen($gzip_contents);
   $gzip_crc = crc32($gzip_contents);
   $gzip_contents = gzcompress($gzip_contents, 9);
   $gzip_contents = substr($gzip_contents, 0, strlen($gzip_contents) - 4);
   echo "\x1f\x8b\x08\x00\x00\x00\x00\x00";
   echo $gzip_contents;
   echo pack('V', $gzip_crc);
   echo pack('V', $gzip_size);
}
/* Un-comment the line below to restrict Admins only to view page generation info */
//if( ($userdata['session_logged_in']) and ($userdata['user_level'] == ADMIN) )
{
   $gzip_text = ($board_config['gzip_compress']) ? 'GZIP enabled' : 'GZIP disabled';
   $debug_text = (DEBUG == 1) ? 'Debug on' : 'Debug off';
   $excuted_queries = $db->num_queries;
   $mtime = microtime();
   $mtime = explode(" ",$mtime);
   $mtime = $mtime[1] + $mtime[0];
   $endtime = $mtime;
   $total_time = round(($endtime - $start_time), 4);
   $sql_time = round($db->sql_time, 4);
   $sql_part = round($sql_time / $total_time * 100);
   $php_part = 100 - $sql_part;
   echo '<div style="font-family: Verdana; font-size: 10px; color: #000000; letter-spacing: -1px" align="center">[ Page generation time: '. $total_time .'s (PHP: '. $php_part .'% - SQL: '. $sql_part .'%) ] - [ SQL queries: '. $excuted_queries .' ] - [ Pages served in past 5 minutes : '. $serverload .' ] - [ '. $gzip_text .' ] - [ '. $debug_text .' ]</div><br>';
}

echo "<div style=\"font-family: Verdana; font-size: 10px; color: #000000; letter-spacing: -1px\" align=\"center\">$copyright</div>";
echo "<div style=\"font-family: Verdana; font-size: 10px; color: #000000; letter-spacing: -1px\" align=\"center\">All graphics, contents and trademarks are property of their respective owner. The comments are property of their posters.</div>";
echo "<div style=\"font-family: Verdana; font-size: 10px; color: #000000; letter-spacing: -1px\" align=\"center\">Unless stated otherwise, all the rest © 2003 <a href=\"http://YOURSITE.COM\" target=\"_blank\">YOURSITE.COM</a> all rights reserved.</div>";
}


Change the last line by putting in the name of your site.. where it says yoursite.com....
And your done. Now you should have something similar as this:
Code:

[Page generation time: 2.4016s (PHP: 25% - SQL: 75%) ] - [ SQL queries: 158 ] - [ Pages served in past 5 minutes : 50 ] - [ GZIP disabled ] - [ Debug off ]


If you have any problems let me know.. it took me a few tries to get it to work correctly..
Find all posts by Tank863View user's profileSend private messageVisit poster's websiteICQ Number
telli
Support Mod
Support Mod


Joined: Aug 21, 2003
Posts: 335


PostPosted: Sun Jun 13, 2004 7:34 pm Reply with quoteBack to top

You may also want to update the serverload.php if it is the original from kc33. I rewrote the function and released it as a download last week if you want it. Or you can just replace the whole function serverload:

Code:

<?php
/*****************************************************/
/* Function serverload taken from Kc-gentime         */
/* Original author kc33                              */
/* Optimized and cleaned up by Telli                 */
/* telli@codezwiz.com - http://codezwiz.com               */
/* Come and see us for more great scripts!           */
/*****************************************************/ 
function serverload() {
     global $prefix, $db;
   $duration = "300"; //set for time for # of page loads default is 5 mins
      $db->sql_query("DELETE FROM ".$prefix."_serverload WHERE time < " . (time()-$duration));
      $db->sql_query("INSERT INTO ".$prefix."_serverload (time) VALUES (" . time() . ")");
      $numrow = $db->sql_numrows($db->sql_query("SELECT time FROM ".$prefix."_serverload"));
      return ($numrow);
}
?>


The whole version is available here without registering.

http://www.codezwiz.com/downloadview-details-309-Kc_Gen_Time_Revisited.html

_________________
[img]http://www.codezwiz.com/extern.php?get=sig[/img]
http://www.codezwiz.com
PHPNuke Themes
$3.99 500 MB Storage & 20 GIG Trans w/ NO limit MYSQL
Click Me

Last edited by telli on Sun Jun 13, 2004 8:26 pm; edited 2 times in total
Find all posts by telliView user's profileSend private message
BeatJunkie
Nuke Cadet
Nuke Cadet


Joined: Jun 13, 2004
Posts: 3


PostPosted: Sun Jun 13, 2004 7:43 pm Reply with quoteBack to top

Your site gives a 403 Error.... =( Anyways, I finally got the code too work but.... Check this out, the page generation times can't be this high...

[ Page generation time: 1087184429.13s (PHP: 100% - SQL: 0%) ] - [ SQL queries: 0 ] - [ Pages served in past 5 minutes : 5 ] - [ GZIP disabled ] - [ Debug off ]

Can someone check my site and tell me what I did wrong?
http://www.beat-junkies.net
Find all posts by BeatJunkieView user's profileSend private message
telli
Support Mod
Support Mod


Joined: Aug 21, 2003
Posts: 335


PostPosted: Sun Jun 13, 2004 8:21 pm Reply with quoteBack to top

What's your IP?

Looks you need to global the $total_time and the $start_time. You also should have had a new db/mysql.php to upload which has the added functions for counting the queries and the the query time.

_________________
[img]http://www.codezwiz.com/extern.php?get=sig[/img]
http://www.codezwiz.com
PHPNuke Themes
$3.99 500 MB Storage & 20 GIG Trans w/ NO limit MYSQL
Click Me
Find all posts by telliView user's profileSend private message
BeatJunkie
Nuke Cadet
Nuke Cadet


Joined: Jun 13, 2004
Posts: 3


PostPosted: Mon Jun 14, 2004 1:14 pm Reply with quoteBack to top

Hey Telli, any word on those other tables I need too add so that my SQL Inquiries and Page Load times show correctly?
Find all posts by BeatJunkieView user's profileSend private message
Display posts from previous:      
Post new topic  Reply to topicprinter-friendly view
View previous topic Log in to check your private messages View next topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum



Powered by phpBB © 2001, 2005 phpBB Group

Ported by Nuke Cops © 2003 www.nukecops.com
:: FI Theme :: PHP-Nuke theme by coldblooded (www.nukemods.com) ::
Powered by TOGETHER TEAM srl ITALY http://www.togetherteam.it - DONDELEO E-COMMERCE http://www.DonDeLeo.com - TUTTISU E-COMMERCE http://www.tuttisu.it
Web site engine's code is Copyright © 2002 by PHP-Nuke. All Rights Reserved. PHP-Nuke is Free Software released under the GNU/GPL license.
Page Generation: 0.060 Seconds - 338 pages served in past 5 minutes. Nuke Cops Founded by Paul Laudanski (Zhen-Xjell)
:: FI Theme :: PHP-Nuke theme by coldblooded (www.nukemods.com) ::