BlackStorm
New member
Hey,
This is the code of the script for the time online hack, can anyone find the error which is giving division by zero?
There is a line to stop division by zero but it doesnt seem to be working.
This is the code of the script for the time online hack, can anyone find the error which is giving division by zero?
There is a line to stop division by zero but it doesnt seem to be working.
<?php
error_reporting(7);
/* Total Time Online Hack v1.0
Created on Thursday August 22, 2002
Copyright g-force2k2
Notice :: Please do not edit (including addons) this hack. Thanks for respecting my work! */
$templatesused = "time,time_leader";
require('./global.php');
// +++++++ Time Online Hack Configuration [ Edit Below Only ] +++++++
$usersperpage = "10"; // Configure this to show the number per page on the leader board!
// +++++++ Time Online Hack Configuration [ Don't Edit Below This Line ] +++++++
if(trim($action) == "") {
$action = "view_leader";
}
// +++++++ Start Viewing Total Time Online Users +++++++
if($action == "view_leader") {
$perpage = $usersperpage;
$totalusers = $DB_site->query_first("
SELECT COUNT(*) AS users
FROM user");
$totalpages = ceil($totalusers[0] / $perpage);
if($page == "") {
$page = 1;
}
$startat = ($page-1)*$perpage;
$leadtime = $DB_site->query("
SELECT userid, username, joindate, timeonline
FROM user
WHERE userid!=0
ORDER by timeonline DESC LIMIT $startat,$perpage");
while($lead = $DB_site->fetch_array($leadtime)) {
$userid = $lead[0]; $username = $lead[1]; $joindate = vbdate($dateformat,$lead[2]); $timeonline = dotimeonline($lead[3]);
$daysreg = floor((time() - $lead[2]) / 86400);
$daysreg = iif($daysreg == 0,'1','$daysreg'); // checking to see if not registered for more then a day to prevent division by zero
$dotimeperday = floor($lead[3] / $daysreg);
$timeperday = dotimeonline($dotimeperday);
eval("\$time_leader.= \"".gettemplate("time_leader")."\";");
}
if($page!=1) {
$prv = $page - 1;
$firstpage = "<a href='timeonline.php?s=$session[sessionhash]&action=view_leader&perpage=$perpage&page=1'\">[ First Page ]</a>";
$prevpage = "<a href='timeonline.php?s=$session[sessionhash]&action=view_leader&perpage=$perpage&page=$prv'\">[ Previous Page ]</a>";
}
if ($page!=$totalpages) {
$nxt = $page+1;
$nextpage = "<a href='timeonline.php?s=$session[sessionhash]&action=view_leader&perpage=$perpage&page=$nxt'\">[ Next Page ]</a>";
$lastpage = "<a href='timeonline.php?s=$session[sessionhash]&action=view_leader&perpage=$perpage&page=$totalpages'\">[ Last Page ]</a>";
}
eval("dooutput(\"".gettemplate("time")."\");");
}
?>