代码拉取完成,页面将自动刷新
<?php
require "include/bittorrent.php";
dbconn();
secrity();
//Send some headers to keep the user's browser from caching the response.
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . "GMT");
header("Cache-Control: no-cache, must-revalidate");
header("Pragma: no-cache");
header("Content-Type: text/xml; charset=utf-8");
$id = 0 + $_GET['torrentid'];
if (isset($CURUSER)) {
$res = sql_query("SELECT id FROM blue WHERE torrentid = $id AND userid = $CURUSER[id]") or sqlerr(__FILE__, __LINE__);
if (mysql_num_rows($res) == 0) {
sql_query("INSERT INTO blue (torrentid, userid) VALUE ('$id', '$CURUSER[id]')") or sqlerr(__FILE__, __LINE__);
$checkfree = get_row_count("blue", "WHERE torrentid = $id");
$check = mysql_fetch_assoc(sql_query("SELECT sp_state FROM torrents WHERE id = $id")) or sqlerr(__FILE__, __LINE__);
if (!empty($checkfreenum) && $checkfreenum <= $checkfree) {
if ($check['sp_state'] == 2) {
$updateset[] = "sp_state = 2";
$updateset[] = "endfree = '0000-00-00 00:00:00'";
sql_query("UPDATE torrents SET " . join(",", $updateset) . " WHERE id = $id") or sqlerr(__FILE__, __LINE__);
} elseif ($check['sp_state'] == 4) {
$updateset[] = "sp_state = 4";
$updateset[] = "endfree = '0000-00-00 00:00:00'";
sql_query("UPDATE torrents SET " . join(",", $updateset) . " WHERE id = $id") or sqlerr(__FILE__, __LINE__);
} else {
$updateset[] = "sp_state = 2";
$updateset[] = "endfree = '0000-00-00 00:00:00'";
sql_query("UPDATE torrents SET " . join(",", $updateset) . " WHERE id = $id") or sqlerr(__FILE__, __LINE__);
}
}
}
echo "pushfree";
} else {
echo "failed";
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。