Example #1
0
    }
}
if ($seeder == 'yes') {
    if ($torrent['banned'] != 'yes') {
        $torrent_updateset[] = 'visible = \'yes\'';
    }
    $torrent_updateset[] = 'last_action = ' . TIME_NOW;
    $mc1->begin_transaction('torrent_details_' . $torrentid);
    $mc1->update_row(false, array('visible' => 'yes'));
    $mc1->commit_transaction($INSTALLER09['expires']['torrent_details']);
    $mc1->begin_transaction('last_action_' . $torrentid);
    $mc1->update_row(false, array('lastseed' => TIME_NOW));
    $mc1->commit_transaction(1800);
}
if (count($torrent_updateset)) {
    ann_sql_query('UPDATE LOW_PRIORITY torrents SET ' . join(',', $torrent_updateset) . ' WHERE id = ' . ann_sqlesc($torrentid)) or ann_sqlerr(__FILE__, __LINE__);
}
if (count($snatch_updateset)) {
    ann_sql_query('UPDATE LOW_PRIORITY snatched SET ' . join(',', $snatch_updateset) . ' WHERE torrentid = ' . ann_sqlesc($torrentid) . ' AND userid = ' . ann_sqlesc($userid)) or ann_sqlerr(__FILE__, __LINE__);
}
if (count($user_updateset)) {
    ann_sql_query('UPDATE LOW_PRIORITY users SET ' . join(',', $user_updateset) . ' WHERE id = ' . ann_sqlesc($userid)) or ann_sqlerr(__FILE__, __LINE__);
    $mc1->delete_value('userstats_' . $userid);
    $mc1->delete_value('user_stats_' . $userid);
}
if (isset($_SERVER["HTTP_ACCEPT_ENCODING"]) && $_SERVER["HTTP_ACCEPT_ENCODING"] == "gzip") {
    header("Content-Encoding: gzip");
    echo gzencode(benc_resp_raw($resp), 9, FORCE_GZIP);
} else {
    benc_resp_raw($resp);
}
Example #2
0
    if (mysqli_affected_rows($GLOBALS["___mysqli_ston"])) {
        $updateset[] = $seeder == "yes" ? "seeders = seeders + 1" : "leechers = leechers + 1";
        if ($seeder == "yes") {
            adjust_torrent_peers($torrentid, 1, 0, 0);
        } else {
            adjust_torrent_peers($torrentid, 0, 1, 0);
        }
        if ($a) {
            $snatch_updateset[] = "ip = " . ann_sqlesc($realip) . ", port = " . ann_sqlesc($port) . ", connectable = " . ann_sqlesc($connectable) . ", to_go = " . ann_sqlesc($left) . ", last_action = " . TIME_NOW . ", seeder = " . ann_sqlesc($seeder) . ", agent = " . ann_sqlesc($agent) . ", timesann = timesann + 1, hit_and_run = '0', mark_of_cain = 'no'";
        }
    }
}
if ($seeder == 'yes') {
    if ($torrent['banned'] != 'yes') {
        $updateset[] = 'visible = \'yes\'';
    }
    $updateset[] = 'last_action = ' . TIME_NOW;
    $mc1->begin_transaction('torrent_details_' . $torrentid);
    $mc1->update_row(false, array('visible' => 'yes'));
    $mc1->commit_transaction($INSTALLER09['expires']['torrent_details']);
    $mc1->begin_transaction('last_action_' . $torrentid);
    $mc1->update_row(false, array('lastseed' => TIME_NOW));
    $mc1->commit_transaction(1800);
}
if (count($updateset)) {
    mysqli_query($GLOBALS["___mysqli_ston"], "UPDATE LOW_PRIORITY torrents SET " . join(",", $updateset) . " WHERE id = " . ann_sqlesc($torrentid)) or ann_sqlerr(__FILE__, __LINE__);
}
if (count($snatch_updateset)) {
    mysqli_query($GLOBALS["___mysqli_ston"], 'UPDATE LOW_PRIORITY snatched SET ' . join(',', $snatch_updateset) . ' WHERE torrentid = ' . ann_sqlesc($torrentid) . ' AND userid = ' . ann_sqlesc($userid)) or ann_sqlerr(__FILE__, __LINE__);
}
benc_resp_raw($resp);
Example #3
0
function hash_where($name, $hash)
{
    $shhash = preg_replace('/ *$/s', "", $hash);
    return "({$name} = " . ann_sqlesc($hash) . " OR {$name} = " . ann_sqlesc($shhash) . ")";
}