From 62da62d5d646b24cf11dc4d8c64a1f1ff7fd0442 Mon Sep 17 00:00:00 2001 From: xiaomlove Date: Sat, 3 Sep 2022 18:54:54 +0800 Subject: [PATCH] upload add hr --- include/constants.php | 2 +- include/functions.php | 5 +++-- public/takeupload.php | 3 +++ public/upload.php | 5 +++++ 4 files changed, 12 insertions(+), 3 deletions(-) diff --git a/include/constants.php b/include/constants.php index 0f231cca..30e8fd44 100644 --- a/include/constants.php +++ b/include/constants.php @@ -1,6 +1,6 @@ ', '', '', '', '', '', '', '
', '
', '', '', '', '  '); + $replaceXhtmlTagArray = array(get_protocol_prefix().get_setting('basic.BASEURL'), get_setting('basic.SITENAME'), 'list', '', '', '', '', '', '', '
', '
', '', '', '', '  '); $s = str_replace($originalBbTagArray, $replaceXhtmlTagArray, $s); $originalBbTagArray = array("/\[font=([^\[\(&\\;]+?)\]/is", "/\[color=([#0-9a-z]{1,15})\]/is", "/\[color=([a-z]+)\]/is", "/\[size=([1-7])\]/is"); diff --git a/public/takeupload.php b/public/takeupload.php index 5ec99b13..56d7db26 100644 --- a/public/takeupload.php +++ b/public/takeupload.php @@ -339,6 +339,9 @@ $insert = [ 'technical_info' => $_POST['technical_info'] ?? '', 'cover' => $cover, ]; +if (isset($_POST['hr']) && isset(\App\Models\Torrent::$hrStatus[$_POST['hr']]) && user_can('torrent_hr')) { + $insert['hr'] = $_POST['hr']; +} $id = \Nexus\Database\NexusDB::insert('torrents', $insert); //$ret = sql_query("INSERT INTO torrents (filename, owner, visible, anonymous, name, size, numfiles, type, url, small_descr, descr, ori_descr, category, source, medium, codec, audiocodec, standard, processing, team, save_as, sp_state, added, last_action, nfo, info_hash, pt_gen, technical_info) VALUES (".sqlesc($fname).", ".sqlesc($CURUSER["id"]).", 'yes', ".sqlesc($anonymous).", ".sqlesc($torrent).", ".sqlesc($totallen).", ".count($filelist).", ".sqlesc($type).", ".sqlesc($url).", ".sqlesc($small_descr).", ".sqlesc($descr).", ".sqlesc($descr).", ".sqlesc($catid).", ".sqlesc($sourceid).", ".sqlesc($mediumid).", ".sqlesc($codecid).", ".sqlesc($audiocodecid).", ".sqlesc($standardid).", ".sqlesc($processingid).", ".sqlesc($teamid).", ".sqlesc($dname).", ".sqlesc($sp_state) . diff --git a/public/upload.php b/public/upload.php index 3a5acd1d..ca711138 100644 --- a/public/upload.php +++ b/public/upload.php @@ -180,6 +180,11 @@ JS; tr($lang_upload['row_show_uploader'], "".$lang_upload['checkbox_hide_uploader_note'], 1); } tr($lang_functions['text_tags'], (new \App\Repositories\TagRepository())->renderCheckbox(), 1); + if (get_setting('hr.mode') == \App\Models\HitAndRun::MODE_MANUAL && user_can('torrent_hr')) { + $hrRadio = sprintf('', ''); + $hrRadio .= sprintf('', ''); + tr('H&R', $hrRadio, 1); + } ?>