1 Star 3 Fork 2

mojie126/HDCN-PT

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
takereseed.php 3.10 KB
一键复制 编辑 原始数据 按行查看 历史
mojie126 提交于 2015-02-17 01:04 . 请求加速功能完成
<?php
require_once("include/bittorrent.php");
dbconn();
require_once(get_langfile_path());
require(get_langfile_path("", true));
loggedinorreturn();
if (get_user_class() < $askreseed_class)
permissiondenied();
$reseedid = 0 + $_GET["reseedid"];
$speed = $_GET["speed"]; //0为请求续种,1为请求加速
$res = sql_query("SELECT seeders, last_reseed FROM torrents WHERE id=" . sqlesc($reseedid) . " LIMIT 1") or sqlerr(__FILE__, __LINE__);
$row = mysql_fetch_array($res);
if ($row['seeders'] > 0 && $speed == 0) {
stderr($lang_takereseed['std_error'], $lang_takereseed['std_torrent_not_dead']);
} elseif (strtotime($row['last_reseed']) > (TIMENOW - 900)) {
if ($speed == 0) {
stderr($lang_takereseed['std_error'], $lang_takereseed['std_reseed_sent_recently']);
} elseif ($speed == 1) {
stderr($lang_takereseed['std_error'], $lang_takereseed['std_speed_sent_recently']);
}
} else {
$res = sql_query("SELECT snatched.userid, snatched.torrentid, torrents.name as torrent_name, users.id FROM snatched inner join users on snatched.userid = users.id inner join torrents on snatched.torrentid = torrents.id where snatched.finished = 'Yes' AND snatched.torrentid = $reseedid") or sqlerr();
while ($row = mysql_fetch_assoc($res)) {
if ($speed == 0) {
$rs_subject = $lang_takereseed_target[get_user_lang($row["userid"])]['msg_reseed_request'];
$pn_msg = $lang_takereseed_target[get_user_lang($row["userid"])]['msg_user'] . $CURUSER["username"] . $lang_takereseed_target[get_user_lang($row["userid"])]['msg_ask_reseed'] . "[url=" . get_protocol_prefix() . "$BASEURL/details.php?id=" . $reseedid . "]" . $row["torrent_name"] . "[/url]" . $lang_takereseed_target[get_user_lang($row["userid"])]['msg_thank_you'];
sql_query("INSERT INTO messages (sender, receiver, added, subject, msg) VALUES(0, $row[userid], '" . date("Y-m-d H:i:s") . "'," . sqlesc($rs_subject) . ", " . sqlesc($pn_msg) . ")") or sqlerr(__FILE__, __LINE__);
} elseif ($speed == 1) {
$rs_subject = $lang_takereseed_target[get_user_lang($row["userid"])]['msg_speed_request'];
$pn_msg = $lang_takereseed_target[get_user_lang($row["userid"])]['msg_user'] . $CURUSER["username"] . $lang_takereseed_target[get_user_lang($row["userid"])]['msg_ask_speed'] . "[url=" . get_protocol_prefix() . "$BASEURL/details.php?id=" . $reseedid . "]" . $row["torrent_name"] . "[/url]" . $lang_takereseed_target[get_user_lang($row["userid"])]['msg_thank_you'];
sql_query("INSERT INTO messages (sender, receiver, added, subject, msg) VALUES(0, $row[userid], '" . date("Y-m-d H:i:s") . "'," . sqlesc($rs_subject) . ", " . sqlesc($pn_msg) . ")") or sqlerr(__FILE__, __LINE__);
}
}
sql_query("UPDATE torrents SET last_reseed = " . sqlesc(date("Y-m-d H:i:s")) . " WHERE id=" . sqlesc($reseedid));
if ($speed == 0) {
stdhead($lang_takereseed['head_reseed_request']);
begin_main_frame();
print("<center>" . $lang_takereseed['std_it_worked'] . "</center>");
end_main_frame();
stdfoot();
} elseif ($speed == 1) {
stdhead($lang_takereseed['head_speed_request']);
begin_main_frame();
print("<center>" . $lang_takereseed['std_it_worked_speed'] . "</center>");
end_main_frame();
stdfoot();
}
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
PHP
1
https://gitee.com/mojie126/HDCN-PT.git
git@gitee.com:mojie126/HDCN-PT.git
mojie126
HDCN-PT
HDCN-PT
master

搜索帮助