mysqli_query($GLOBALS["___mysqli_ston"], "UPDATE LOW_PRIORITY ips SET lastannounce = " . TIME_NOW . " WHERE ip = " . ann_sqlesc($ip) . " AND userid =" . ann_sqlesc($userid)) or ann_sqlerr(__FILE__, __LINE__); $mc1->delete_value('ip_history_' . $userid); $mc1->delete_value('u_passkey_' . $passkey); } } // End Ip logger $realip = $_SERVER['REMOTE_ADDR']; $torrent = get_torrent_from_hash($info_hash, $userid); if (!$torrent) { err("torrent query error - contact site admin"); } $torrentid = (int) $torrent["id"]; $torrent_modifier = get_slots($torrentid, $userid); $torrent['freeslot'] = $torrent_modifier['freeslot']; $torrent['doubleslot'] = $torrent_modifier['doubleslot']; $happy_multiplier = get_happy($torrentid, $userid); $fields = 'seeder, peer_id, ip, port, uploaded, downloaded, userid, (' . TIME_NOW . ' - last_action) AS announcetime, last_action AS ts, ' . TIME_NOW . ' AS nowts, prev_action AS prevts'; //== Wantseeds - Retro $limit = ''; if ($torrent['numpeers'] > $rsize) { $limit = "ORDER BY RAND() LIMIT {$rsize}"; } // if user is a seeder, then only supply leechers. $wantseeds = ''; if ($seeder == 'yes') { $wantseeds = 'AND seeder = "no"'; } $res = mysqli_query($GLOBALS["___mysqli_ston"], "SELECT {$fields} FROM peers WHERE torrent = {$torrentid} {$wantseeds} {$limit}") or ann_sqlerr(__FILE__, __LINE__); unset($wantseeds); //== compact mod if ($_GET['compact'] != 1) {
ann_sql_query("UPDATE LOW_PRIORITY ips SET lastannounce = " . TIME_NOW . " WHERE ip = " . ann_sqlesc($ip) . " AND userid =" . ann_sqlesc($userid)) or ann_sqlerr(__FILE__, __LINE__); $mc1->delete_value('ip_history_' . $userid); } } } // End Ip logger $realip = $_SERVER['REMOTE_ADDR']; $torrent = get_torrent_from_hash($info_hash, $userid); if (!$torrent) { err("torrent query error - contact site admin"); } $torrentid = (int) $torrent["id"]; $torrent_modifier = get_slots($torrentid, $userid); $torrent['freeslot'] = $torrent_modifier['freeslot']; $torrent['doubleslot'] = $torrent_modifier['doubleslot']; $happy_multiplier = $INSTALLER09['happy_hour'] ? get_happy($torrentid, $userid) : 0; $fields = 'seeder, peer_id, ip, port, uploaded, downloaded, userid, last_action, (' . TIME_NOW . ' - last_action) AS announcetime, last_action AS ts, ' . TIME_NOW . ' AS nowts, prev_action AS prevts'; //== Wantseeds - Retro $limit = ''; if ($torrent['numpeers'] > $rsize) { $limit = "ORDER BY RAND() LIMIT {$rsize}"; } // if user is a seeder, then only supply leechers. $wantseeds = ''; if ($seeder == 'yes') { $wantseeds = 'AND seeder = "no"'; } $res = ann_sql_query("SELECT {$fields} FROM peers WHERE torrent = {$torrentid} {$wantseeds} {$limit}") or ann_sqlerr(__FILE__, __LINE__); unset($wantseeds); //== compact mod if ($_GET['compact'] != 1) {