Requests Section\n"); $order = "hits DESC"; $res = do_mysql_query("SELECT users.downloaded, users.uploaded, users.username, IF( users.downloaded > 0, ROUND(users.uploaded / users.downloaded, 3), '---') as ratio, requests.filled, requests.filledurl, requests.filledby, requests.id, requests.userid, requests.request, requests.added, UNIX_TIMESTAMP(requests.added) as utadded, requests.hits, categories.name as cat, categories.stylesheet as stylesheet FROM requests LEFT JOIN categories on requests.cat = categories.id LEFT JOIN users on requests.userid = users.id ORDER BY $order LIMIT 5") or sqlerr(); $num = mysql_num_rows($res); print("
\n"); print("To add a vote for a request, click on the link of the request.\n"); print("\n"); print("\n"); for ($i = 0; $i < $num; ++$i) { $arr = mysql_fetch_assoc($res); $timezone = $arr['added']; $ratio = "".$arr['ratio'].""; $res2 = do_mysql_query("SELECT username from users where id=" . $arr['filledby']); $arr2 = mysql_fetch_assoc($res2); if ($arr2['username']) $filledby = $arr2['username']; else $filledby = "Unknown"; $addedby = ""; $filled = $arr['filledurl']; if ($arr['filled'] == 'yes') $filled = "Yes"; else $filled = "No"; print(" ".$addedby." \n"); } print("\n"); print("
Requests (top 5 requested)CategoryAddedAdded ByFilled?Filled ByVotes
".$arr['username']." (".$ratio.")
".$arr['request']." ".$timezone."".$filled." ".$arr2['username']." ".$arr['hits']."
[Add vote]
\n"); ?> \n"); print("\n"); $where = "WHERE userid = " . $CURUSER["id"] . ""; $res2 = do_mysql_query("SELECT requests.*, UNIX_TIMESTAMP(requests.added) as utadded, users.username FROM requests LEFT JOIN users ON requests.userid = users.id $where ORDER BY hits DESC") or sqlerr(); $num2 = mysql_num_rows($res2); // ------------------ while ($arr = @mysql_fetch_assoc($res2)) { { $addedby = $arr['username']; $timezone = $arr['added']; if ($CURUSER['id'] == $arr['userid']) { ?> "; } ?> "); print("
\n"); ?>
RequestsAddedVotesDel
" . $arr['request'] . "" . $timezone . "" . $arr['hits'] . "
Search Requests (before adding a request)
in

Search Torrents (before adding a request)
in
\n"); if ($CURUSER["downloaded"]) $ratio=$CURUSER["uploaded"]/$CURUSER["downloaded"]; else $ratio=0; //if ($ratio>= .5) if ($ratio>= 0) { print("
\n"); print("\n"); print("\n"); print("
Request: Will be deleted after 3 weeks! (please use descriptive names)
Title: "); ?> \n"); print("
Additional Information
\n"); print("
\n"); print("\n"); print("
\n"); } print("
\n"); stdfoot(); die; ?>