require "include/bittorrent.php";
dbconn();
loggedinorreturn();
if( !$GLOBALS['settings']['mod_requests'] )
{
stderr( _("Error"), _("Permission denied."));
}
stdhead("Requests Page");
print("
\n");
print("To add a vote for a request, click on the link of the request.\n");
print("\n");
print("Requests (top 5 requested) | Category | Added | Added By | Filled? | Filled By | Votes | \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 = "".$arr['username']." (".$ratio.") | ";
$filled = $arr['filledurl'];
if ($arr['filled'] == 'yes')
$filled = "Yes";
else
$filled = "No";
print("".$arr['request']." |
|
".$timezone." |
".$addedby."
".$filled." |
".$arr2['username']." |
".$arr['hits']." [Add vote] | \n");
}
print(" | \n");
print(" \n");
?>
print(" \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(" ");
print(" \n"); ?>
Search Requests (before adding a request) |
|
Search Torrents (before adding a request) |
|
print(" \n");
if ($CURUSER["downloaded"])
$ratio=$CURUSER["uploaded"]/$CURUSER["downloaded"];
else
$ratio=0;
//if ($ratio>= .5)
if ($ratio>= 0)
{
print(" |
\n");
stdfoot();
die;
?>