1 Star 3 Fork 2

mojie126/HDCN-PT

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
pushfree.php 1.65 KB
一键复制 编辑 原始数据 按行查看 历史
mojie126 提交于 2014-12-17 15:24 . 添加“开启禁区”开关
<?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";
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
PHP
1
https://gitee.com/mojie126/HDCN-PT.git
git@gitee.com:mojie126/HDCN-PT.git
mojie126
HDCN-PT
HDCN-PT
master

搜索帮助