support plugin nexusphp-hit-and-run

This commit is contained in:
xiaomlove
2022-10-01 00:11:22 +08:00
parent 65ba6442b1
commit 6de5cb2f21
20 changed files with 222 additions and 81 deletions
+8 -7
View File
@@ -53,13 +53,6 @@ if (!empty($_POST['pt_gen'])) {
$updateset[] = "technical_info = " . sqlesc($_POST['technical_info'] ?? '');
$torrentOperationLog = [];
/**
* hr
* @since 1.6.0-beta12
*/
if (isset($_POST['hr']) && isset(\App\Models\Torrent::$hrStatus[$_POST['hr']]) && user_can('torrent_hr')) {
$updateset[] = "hr = " . sqlesc($_POST['hr']);
}
if ($enablenfo_main=='yes'){
@@ -215,6 +208,14 @@ $descriptionArr = format_description($descr);
$cover = get_image_from_description($descriptionArr, true, false);
$updateset[] = "cover = " . sqlesc($cover);
/**
* hr
* @since 1.6.0-beta12
*/
if (isset($_POST['hr'][$newcatmode]) && isset(\App\Models\Torrent::$hrStatus[$_POST['hr'][$newcatmode]]) && user_can('torrent_hr')) {
$updateset[] = "hr = " . sqlesc($_POST['hr'][$newcatmode]);
}
$sql = "UPDATE torrents SET " . join(",", $updateset) . " WHERE id = $id";
do_log("[UPDATE_TORRENT]: $sql");
$affectedRows = sql_query($sql) or sqlerr(__FILE__, __LINE__);