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, 195 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 - errors from serverload.php -> fixed [ ]
 Forum FAQ  •  Search  •   •  Memberlist  •  Usergroups   •  Register  •  Profile •    •  Log in to check your private messages  •  Log in

 
This forum is locked: you cannot post, reply to, or edit topics.  This topic is locked: you cannot edit posts or make replies.printer-friendly view
View previous topic Log in to check your private messages View next topic
Author Message
intel352
Lieutenant
Lieutenant


Joined: Mar 11, 2003
Posts: 180


PostPosted: Fri Aug 08, 2003 3:05 pm Reply with quoteBack to top

i don't know why you put serverload.php into the bundle, without properly packaging it for nuke, but anywho, here the fixed code to make it work *properly*

Code:
<?PHP
require_once("mainfile.php");
function serverload() {   
   global $db, $prefix;
   
   // Use:x
   //   INCLUDE the file in your script (or cut and paste in)
   //   assign to a variable $serverload = serverload();
   //   This will ONLY track page counts from pages that call the
   //   serverload() function. If you want a page counted, but do
   //   not need the results, simply call the function without
   //   assigning a variable.
   //   
   // Requirements:
   //  MySQL database set up with a table (user selectable) in a
   //  database (user selectable). Table has one field, time, which
   //  is defined as INT(14) type.

   // Define variables
   
   $tablename = "nuke_serverload";   // Table in database above that information is stored in
   
   $duration = "300";    // How many seconds load will represent.

   // Delete old page counts
      $sql = "DELETE FROM $tablename WHERE time < " . (time()-$duration)  ;
        $result = $db->sql_query($sql);
   // Insert the current page count
   
      $sql = "INSERT INTO $tablename (time) VALUES (" . time() . ") ";
   
        $result = $db->sql_query($sql);
   // Get page count (number of rows in the table)
   
      $sql = "SELECT time FROM $tablename";
   
        $result = $db->sql_query($sql);
   
        return $db->sql_numrows ($result);

} // END FUNCTION serverload

?>


i wouldn't have noticed, since i use nuke 6.8, but i recommended a buddy of mine use the bundle, since i assumed it would be in excellent shape, and then i saw the errors at the bottom of his page

_________________
Image
CSMapCentral || NukeBBMods
Find all posts by intel352View user's profileSend private messageVisit poster's websiteICQ Number
Zhen-Xjell
Nuke Cops Founder
Nuke Cops Founder


Joined: Nov 14, 2002
Posts: 5939


PostPosted: Sat Aug 09, 2003 6:34 am Reply with quoteBack to top

Yes I may change this to pull from config.php instead.

_________________
Paul Laudanski, Microsoft MVP Windows-Security
CastleCops: [de] [en] [wiki]
Find all posts by Zhen-XjellView user's profileSend private messageSend e-mailVisit poster's website
Display posts from previous:      
This forum is locked: you cannot post, reply to, or edit topics.  This topic is locked: you cannot edit posts or make replies.printer-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.048 Seconds - 106 pages served in past 5 minutes. Nuke Cops Founded by Paul Laudanski (Zhen-Xjell)
:: FI Theme :: PHP-Nuke theme by coldblooded (www.nukemods.com) ::