12) $month=date('m'); $order=$_GET['order'] ?? ''; if (!in_array($order, array('username', 'torrent_size', 'torrent_count'))) $order='username'; if ($order=='username') $order .=' ASC'; else $order .= ' DESC'; stdhead($lang_uploaders['head_uploaders']); begin_main_frame(); ?>
".$lang_uploaders['text_uploaders']." - ".date("Y-m",$timestart).""); $yearselection=""; $monthselection=""; ?>
    
= ".UC_UPLOADER) or sqlerr(__FILE__, __LINE__); $numrow = mysql_fetch_array($numres); $num=$numrow[0]; if (!$num) print("

".$lang_uploaders['text_no_uploaders_yet']."

"); else{ ?>
"); print("".$lang_uploaders['col_username'].""); print("".$lang_uploaders['col_torrents_size'].""); print("".$lang_uploaders['col_torrents_num'].""); print("".$lang_uploaders['col_last_upload_time'].""); print("".$lang_uploaders['col_last_upload'].""); print(""); $res = sql_query("SELECT users.id AS userid, users.username AS username, COUNT(torrents.id) AS torrent_count, SUM(torrents.size) AS torrent_size FROM torrents LEFT JOIN users ON torrents.owner=users.id WHERE users.class >= ".UC_UPLOADER." AND torrents.added > ".sqlesc($sqlstarttime)." AND torrents.added < ".sqlesc($sqlendtime)." GROUP BY userid ORDER BY ".$order); $hasupuserid=array(); while($row = mysql_fetch_array($res)) { $res2 = sql_query("SELECT torrents.id, torrents.name, torrents.added FROM torrents WHERE owner=".$row['userid']." ORDER BY id DESC LIMIT 1"); $row2 = mysql_fetch_array($res2); print(""); print("".get_username($row['userid'], false, true, true, false, false, true).""); print("".($row['torrent_size'] ? mksize($row['torrent_size']) : "0").""); print("".$row['torrent_count'].""); print("".($row2['added'] ? gettime($row2['added']) : $lang_uploaders['text_not_available']).""); print("".($row2['name'] ? "".htmlspecialchars($row2['name'])."" : $lang_uploaders['text_not_available']).""); print(""); $hasupuserid[]=$row['userid']; unset($row2); } $res3=sql_query("SELECT users.id AS userid, users.username AS username, 0 AS torrent_count, 0 AS torrent_size FROM users WHERE class >= ".UC_UPLOADER.(count($hasupuserid) ? " AND users.id NOT IN (".implode(",",$hasupuserid).")" : "")." ORDER BY username ASC") or sqlerr(__FILE__, __LINE__); $count = 0; while($row = mysql_fetch_array($res3)) { $res2 = sql_query("SELECT torrents.id, torrents.name, torrents.added FROM torrents WHERE owner=".$row['userid']." ORDER BY id DESC LIMIT 1"); $row2 = mysql_fetch_array($res2); print(""); print("".get_username($row['userid'], false, true, true, false, false, true).""); print("".($row['torrent_size'] ? mksize($row['torrent_size']) : "0").""); print("".$row['torrent_count'].""); print("".($row2['added'] ? gettime($row2['added']) : $lang_uploaders['text_not_available']).""); print("".($row2['name'] ? "".htmlspecialchars($row2['name'])."" : $lang_uploaders['text_not_available']).""); print(""); $count++; unset($row2); } print(""); ?>