stats.php error message...
PHP Code:
after table top 10 sharers i get this message: Code:
BIGINT UNSIGNED value is out of range in '(`hostz_11543320_1`.`torrent_users`.`downloaded` - `hostz_11543320_1`.`torrent_users`.`uploaded`)' i looked at the code and this is the only i can think of.... |
try this one ";Code:
/* } } function _torrenttable($res, $frame_caption) { $menu = ''; print (" $frame_caption ";"); if (mysql_num_rows($res) > 0) { print("
}else{ echo ""._btstats_noshow." } } function countriestable($res, $frame_caption) { OpenTable2($frame_caption); if (mysql_num_rows($res) > 0) { print("
CloseTable2(); }else{ echo ""._btstats_noshow.""; } } function postertable($res, $frame_caption) { OpenTable2($frame_caption); if (mysql_num_rows($res) > 0) { print("
CloseTable2(); }else{ echo ""._btstats_noshow.""; CloseTable2(); } } //main stats here $a = @mysql_fetch_assoc(@mysql_query("SELECT id,username FROM ".$db_prefix."_users WHERE active = '1' ORDER BY id DESC LIMIT 5")); if ($user->user) $latestuser = "" . $a["username"] . ""; else $latestuser = "$a[username]"; $registered = number_format(get_row_count("".$db_prefix."_users")); $torrents = number_format(get_row_count("".$db_prefix."_torrents")); $result = mysql_query("SELECT SUM(downloaded) AS totaldl FROM ".$db_prefix."_users") or sqlerr(__FILE__, __LINE__); while ($row = mysql_fetch_array ($result)) { $totaldownloaded = $row["totaldl"]; } $result = mysql_query("SELECT SUM(uploaded) AS totalul FROM ".$db_prefix."_users") or sqlerr(__FILE__, __LINE__); while ($row = mysql_fetch_array ($result)) { $totaluploaded = $row["totalul"]; } $seeders = get_row_count("".$db_prefix."_peers", "WHERE seeder='yes'"); $leechers = get_row_count("".$db_prefix."_peers", "WHERE seeder='no'"); $localtorrent = number_format(get_row_count("".$db_prefix."_torrents", "WHERE tracker IS NULL AND exeem IS NOT NULL")); $externaltorrent = number_format(get_row_count("".$db_prefix."_torrents", "WHERE tracker IS NOT NULL")); $usersactive = 0; if ($leechers == 0) $ratio = "100"; else $ratio = round($seeders / $leechers * 100); if ($ratio < 20) $ratio = "" . $ratio . "%"; else $ratio .= "%"; $peers = number_format($seeders + $leechers); $seeders = number_format($seeders); $leechers = number_format($leechers); // start count registered today $res = mysql_query("SELECT COUNT(*) FROM ".$db_prefix."_users WHERE UNIX_TIMESTAMP(" . gmdate("YmdHis") . ") - UNIX_TIMESTAMP(regdate) < 86400"); $arr44 = mysql_fetch_row($res); $regtoday = $arr44[0]; function getmicrotime(){ list($usec, $sec) = explode(" ",microtime()); return ((float)$usec + (float)$sec); } $time_start = getmicrotime(); //end here ///////////////////////////////////////// PAGE LAYOUT ////////////////////////////// OpenTable(_btstats_extra); echo " "._btstats_welcome." $latestuser"; ";echo ""._btstats_total." $registered "; echo ""._btstats_new_today." $regtoday "; echo ""._btstats_active." $peers "; ECHO ""._btstats_downloaded." ".mksize($totaldownloaded)." "; ECHO ""._btstats_uploaded." ".mksize($totaluploaded)." "; echo ""._btstats_tracking." $torrents "._btstats_torrents.""; echo ""._btstats_local." $localtorrent Torrents "; echo ""._btstats_external." $externaltorrent Torrents "; echo ""._btstats_seeds."$seeders "; echo ""._btstats_leech."$leechers "; echo ""._btstats_seed_ratio." $ratio "; echo " $r = mysql_query("SELECT ".$db_prefix."_users.id, ".$db_prefix."_users.username, COUNT(".$db_prefix."_torrents.owner) as num FROM ".$db_prefix."_torrents LEFT JOIN ".$db_prefix."_users ON ".$db_prefix."_users.id = ".$db_prefix."_torrents.owner GROUP BY owner ORDER BY num DESC LIMIT 10") or sqlerr(); postertable($r, _btstats_top10_posters); echo ""; $r = mysql_query("SELECT id, username, uploaded, downloaded FROM ".$db_prefix."_users ORDER BY uploaded DESC LIMIT 10") or die; usertable($r, _btstats_top10_uploaders); echo ""; $r = mysql_query("SELECT id, username, uploaded, downloaded FROM ".$db_prefix."_users ORDER BY downloaded DESC LIMIT 10") or die; usertable($r, _btstats_top10_leechers); echo ""; $r = mysql_query("SELECT id, username, uploaded, downloaded FROM ".$db_prefix."_users WHERE downloaded > 104857600 ORDER BY (CAST(uploaded AS SIGNED) - CAST(downloaded AS SIGNED)) DESC LIMIT 10") or die(mysql_error()); usertable($r, ""._btstats_top10_best_shares.""._btstats_100mb.""); echo ""; $r = mysql_query("SELECT id, username, uploaded, downloaded FROM ".$db_prefix."_users WHERE downloaded > 104857600 ORDER BY (CAST(downloaded AS SIGNED) - CAST(uploaded AS SIGNED)) DESC, downloaded DESC LIMIT 10") or die(mysql_error()); usertable($r, ""._btstats_top10_worst_shares.""._btstats_100mb.""); echo ""; $r = mysql_query("SELECT * FROM ".$db_prefix."_torrents ORDER BY seeders + leechers DESC, seeders DESC, added ASC LIMIT 10") or sqlerr(); _torrenttable($r, ""._btstats_top10_active.""); echo ""; $r = mysql_query("SELECT * FROM ".$db_prefix."_torrents WHERE seeders >= 5 ORDER BY seeders / leechers DESC, seeders DESC, added ASC LIMIT 10") or sqlerr(); _torrenttable($r, ""._btstats_top10_best_seed.""._btstats_top10_5seeds.""); echo ""; $r = mysql_query("SELECT * FROM ".$db_prefix."_torrents WHERE leechers >= 5 AND completed > 0 ORDER BY seeders / leechers ASC, leechers DESC LIMIT 10") or sqlerr(); _torrenttable($r, ""._btstats_top10_worst_seeded.""._btstats_top10_5leech.""); echo ""; $r = mysql_query("SELECT * FROM ".$db_prefix."_torrents WHERE completed > 0 ORDER BY seeders / leechers ASC, completed DESC LIMIT 10") or sqlerr(); _torrenttable($r, ""._btstats_top10_most_complete.""); echo ""; $r = mysql_query("SELECT ".$db_prefix."_countries.name, flagpic, COUNT(".$db_prefix."_users.country) as num FROM ".$db_prefix."_countries LEFT JOIN ".$db_prefix."_users ON ".$db_prefix."_users.country = ".$db_prefix."_countries.id GROUP BY ".$db_prefix."_countries.name ORDER BY num DESC LIMIT 10") or sqlerr(); countriestable($r, ""._btstats_top10_countries."");echo ""; CloseTable(); include ("footer.php"); ?> |
Worked like a charm!Thanks Joe!
|
All times are GMT +2. The time now is 14:33. |
Powered by vBulletin® Version 3.8.11 Beta 3
Copyright ©2000 - 2024, vBulletin Solutions Inc.