Переделанный блок статистики с 0 запросов! - Форум вебмастеров-Моды и хаки для трекера
Страница 1 из 11
Форум вебмастеров-Моды и хаки для трекера » Моды и Хаки » Готовые моды и хаки » Переделанный блок статистики с 0 запросов! (Переделанный блок статистики с 0 запросов!)
Переделанный блок статистики с 0 запросов!
InDiGoДата: Воскресенье, 27.06.2010, 20:46 | Сообщение # 1
Administrator
Группа: Администраторы
Сообщений: 21
Репутация: 4
Статус: Offline

Code
<?php   

if (!defined('BLOCK_FILE')) {   
location("../index.php");   
   exit;   
}   

global $tracker_lang, $ss_uri, $maxusers, $CURUSER, $use_sessions;   
$blocktitle = $tracker_lang['statistic'];   
$sql = mysql_query("SELECT id, username, downloaded, (SELECT COUNT(*) FROM users WHERE warned='yes') AS warneds, (SELECT COUNT(*) FROM users WHERE enabled='no') AS disabled, (SELECT COUNT(*) FROM users WHERE gender='1') AS males, (SELECT COUNT(*) FROM users WHERE gender='2') AS females, (SELECT COUNT(*) FROM users WHERE status='pending') AS pendings, (SELECT COUNT(*) FROM torrents WHERE filename<>'') AS torrents, (SELECT COUNT(*) FROM torrents WHERE filename<>'' AND visible='no') AS dead, (SELECT COUNT(*) FROM torrents WHERE times_completed>0) AS downtor, (SELECT COUNT(*) FROM peers WHERE seeder='yes') AS seeders, (SELECT COUNT(*) FROM peers WHERE seeder='no') AS leechers FROM users WHERE status='confirmed' ORDER BY id") or sqlerr(__FILE__,__LINE__);   
$num = 0;   
while ($us = mysql_fetch_array($sql)) {   
$num++;   
$downloaded += $us["downloaded"];    
if ($num == mysql_num_rows($sql)) {   
if ($CURUSER)   
      $latestuser = "<a href=userdetails.php?id=" . $us["id"] . " class=\"online\">" . $us["username"] . "</a>";   
else   
      $latestuser = $us['username'];   
$registered = number_format($us["males"]+$us["females"]);   
$unverified = number_format($us["pendings"]);   
$male = number_format($us["males"]);   
$female = number_format($us["females"]);   
$torrents = number_format($us["torrents"]);   
$dead = number_format($us["dead"]);   
$downtor = number_format($us["downtor"]);   
$seeders = $us["seeders"];   
$leechers = $us["leechers"];   
$warned_users = number_format($us["warneds"]);   
$disabled = number_format($us["disabled"]);
$downstat = 0;   
$upsta = 0;   
}   
}   
while ($upl = mysql_fetch_array($sql)) {   

}   
$downstatu = mksize($downstat);   
$dow = mysql_query("SELECT size FROM torrents") or sqlerr(__FILE__,__LINE__);   
while ($down = mysql_fetch_array($dow)) {   
$upsta = $upsta + $down["size"];   
}   
$upstat = mksize($upsta);   
if ($leechers == 0)   
    $ratio = 0;   
else   
    $ratio = round($seeders / $leechers * 100);   
$peers = number_format($seeders + $leechers);   
$seeders = number_format($seeders);   
$leechers = number_format($leechers);   

$content .= "<table width=\"100%\" class=\"main\" border=\"0\" cellspacing=\"0\" cellpadding=\"2\"><td align=\"center\">
<table class=\"main\" border=\"1\" cellspacing=\"0\" cellpadding=\"5\">

<table width=\"100%\" class=\"main\" border=\"0\" cellspacing=\"0\" cellpadding=\"10\">
    <tr>
      <td width=\"50%\" align=\"center\" style=\"border: none;\"><table class=\"main\" border=\"1\" cellspacing=\"0\" cellpadding=\"5\">
<tr><td class=\"rowhead\">".$tracker_lang['users_registered']."</td><td align=right><img src=\"pic/male.gif\" alt=\"Парни\">$male<img src=\"pic/female.gif\" alt=\"Девушки\">$female<br />".$tracker_lang['total'].": $registered</td></tr>
<tr><td colspan=\"2\" class=\"rowhead\"><table width=\"100%\" border=\"1\" cellspacing=\"0\" cellpadding=\"5\"><tr><td style=\"text-align: right; font-weight: bold; vertical-align: top;\">Мест на трекере</td><td align=\"right\">$maxusers</td></tr></table></td></tr>
<tr><td class=\"rowhead\">".$tracker_lang['users_unconfirmed']."</td><td align=right>$unverified</td></tr>
<tr><td class=\"rowhead\">".$tracker_lang['users_warned']." <img src=\"pic/warned.gif\" border=0 align=absbottom></td><td align=right>$warned_users</td></tr>
<tr><td class=\"rowhead\">".$tracker_lang['users_disabled']." <img src=\"pic/disabled.gif\" border=0 align=absbottom></td><td align=right>$disabled</td></tr>

</table></td>
<td width=\"50%\" align=\"center\" style=\"border: none;\"><table class=main border=1 cellspacing=0 cellpadding=5>
<tr><td class=\"rowhead\">".$tracker_lang['tracker_torrents']."</td><td align=right>$torrents</td></tr>
<tr><td class=\"rowhead\">".$tracker_lang['tracker_dead_torrents']."</td><td align=right>$dead</td></tr>
<tr><td class=\"rowhead\">".$tracker_lang['tracker_peers']."</td><td align=right>$peers</td></tr>";
if (isset($peers)) {
$content .= "<tr><td class=\"rowhead\">".$tracker_lang['tracker_seeders']."  <img src=\"./themes/$ss_uri/images/arrowup.gif\" border=0 align=absbottom></td><td align=right>$seeders</td></tr>
<tr><td class=\"rowhead\">".$tracker_lang['tracker_leechers']."  <img src=\"./themes/$ss_uri/images/arrowdown.gif\" border=0 align=absbottom></td><td align=right>$leechers</td></tr>
<tr><td class=\"rowhead\">".$tracker_lang['tracker_seed_peer']."</td><td align=right>$ratio</td></tr>";
}
$content .= "</table></td>";   
$content .="</table>   
</td></tr></table>";   

?>



я бы изменил мир, но бог не даёт исходники
 
Форум вебмастеров-Моды и хаки для трекера » Моды и Хаки » Готовые моды и хаки » Переделанный блок статистики с 0 запросов! (Переделанный блок статистики с 0 запросов!)
Страница 1 из 11
Поиск: