require_once("include/bittorrent.php"); dbconn(); loggedinorreturn(); stdhead("Vote"); function bark($msg) { stdmsg("Add request failed!", $msg); stdfoot(); exit; } if( !$GLOBALS['settings']['mod_requests'] ) { stderr( _("Error"), _("Permission denied")); } $requestid = (int) $_GET["id"]; if (!is_valid_id($requestid)) bark( _("Not a valid id!") ); $userid = $CURUSER["id"]; $res = do_mysql_query("SELECT * FROM addedrequests WHERE requestid=".$requestid." and userid = ".$userid) or sqlerr(); $arr = mysql_fetch_assoc($res); $voted = $arr; if ($voted) { ?>
You've already voted for this request, only 1 vote for each request is allowed
Back to /viewrequests.php>requests
} else { do_mysql_query("UPDATE LOW_PRIORITY requests SET hits = hits + 1 WHERE id=".$requestid) or sqlerr(); @do_mysql_query("INSERT INTO addedrequests VALUES('', ".$requestid.", ".$userid.")") or sqlerr(); print("Successfully voted for request ".$requestid."
Back to requests
"); } stdfoot(); ?>