upload when exists redirect to details page

This commit is contained in:
xiaomlove
2024-07-03 04:26:56 +08:00
parent 285e1061ce
commit 36fef3e834
6 changed files with 13 additions and 5 deletions

View File

@@ -1,6 +1,6 @@
<?php <?php
defined('VERSION_NUMBER') || define('VERSION_NUMBER', '1.8.12'); defined('VERSION_NUMBER') || define('VERSION_NUMBER', '1.8.12');
defined('RELEASE_DATE') || define('RELEASE_DATE', '2024-06-27'); defined('RELEASE_DATE') || define('RELEASE_DATE', '2024-07-03');
defined('IN_TRACKER') || define('IN_TRACKER', false); defined('IN_TRACKER') || define('IN_TRACKER', false);
defined('PROJECTNAME') || define("PROJECTNAME","NexusPHP"); defined('PROJECTNAME') || define("PROJECTNAME","NexusPHP");
defined('NEXUSPHPURL') || define("NEXUSPHPURL","https://nexusphp.org"); defined('NEXUSPHPURL') || define("NEXUSPHPURL","https://nexusphp.org");

View File

@@ -242,6 +242,7 @@ $lang_details = array
'claim_confirm' => '确定要认领此种子吗?', 'claim_confirm' => '确定要认领此种子吗?',
'action_approval' => '审核', 'action_approval' => '审核',
'row_tags' => '标签', 'row_tags' => '标签',
'torrent_existed' => '该种子已存在!'
); );
?> ?>

View File

@@ -241,6 +241,7 @@ $lang_details = array
'claim_confirm' => '確定要認領此種子嗎?', 'claim_confirm' => '確定要認領此種子嗎?',
'action_approval' => '審核', 'action_approval' => '審核',
'row_tags' => '標簽', 'row_tags' => '標簽',
'torrent_existed' => '該種子已存在!',
); );
?> ?>

View File

@@ -241,6 +241,7 @@ $lang_details = array
'claim_confirm' => 'Are you sure to claim this torrent?', 'claim_confirm' => 'Are you sure to claim this torrent?',
'action_approval' => 'Approval', 'action_approval' => 'Approval',
'row_tags' => 'Tags', 'row_tags' => 'Tags',
'torrent_existed' => 'Torrent already uploaded!',
); );
?> ?>

View File

@@ -68,7 +68,11 @@ if (!$row) {
print("<h1 align=\"center\">".$lang_details['text_successfully_edited']."</h1>"); print("<h1 align=\"center\">".$lang_details['text_successfully_edited']."</h1>");
if (isset($_GET["returnto"])) if (isset($_GET["returnto"]))
print("<p><b>".$lang_details['text_go_back'] . "<a href=\"".htmlspecialchars($_GET["returnto"])."\">" . $lang_details['text_whence_you_came']."</a></b></p>"); print("<p><b>".$lang_details['text_go_back'] . "<a href=\"".htmlspecialchars($_GET["returnto"])."\">" . $lang_details['text_whence_you_came']."</a></b></p>");
} } elseif (!empty($_GET['existed'])) {
print("<h1 align=\"center\" style='color: red'>".$lang_details['torrent_existed']."</h1>");
if (isset($_GET["returnto"]))
print("<p><b>".$lang_details['text_go_back'] . "<a href=\"".htmlspecialchars($_GET["returnto"])."\">" . $lang_details['text_whence_you_came']."</a></b></p>");
}
$banned_torrent = ($row["banned"] == 'yes' ? " <b>(<font class=\"striking\">".$lang_functions['text_banned']."</font>)</b>" : ""); $banned_torrent = ($row["banned"] == 'yes' ? " <b>(<font class=\"striking\">".$lang_functions['text_banned']."</font>)</b>" : "");
$sp_torrent = get_torrent_promotion_append($row['sp_state'],'word', false, '', 0, '', $row['__ignore_global_sp_state'] ?? false); $sp_torrent = get_torrent_promotion_append($row['sp_state'],'word', false, '', 0, '', $row['__ignore_global_sp_state'] ?? false);
$sp_torrent_sub = get_torrent_promotion_append_sub($row['sp_state'],"",true,$row['added'], $row['promotion_time_type'], $row['promotion_until'], $row['__ignore_global_sp_state'] ?? false); $sp_torrent_sub = get_torrent_promotion_append_sub($row['sp_state'],"",true,$row['added'], $row['promotion_time_type'], $row['promotion_until'], $row['__ignore_global_sp_state'] ?? false);

View File

@@ -179,9 +179,10 @@ unset ($dict['announce-list']); // remove multi-tracker capability
unset ($dict['nodes']); // remove cached peers (Bitcomet & Azareus) unset ($dict['nodes']); // remove cached peers (Bitcomet & Azareus)
$infohash = pack("H*", sha1(\Rhilip\Bencode\Bencode::encode($dict['info']))); // double up on the becoding solves the occassional misgenerated infohash $infohash = pack("H*", sha1(\Rhilip\Bencode\Bencode::encode($dict['info']))); // double up on the becoding solves the occassional misgenerated infohash
$exists = \App\Models\Torrent::query()->where('info_hash', $infohash)->first(['id']);
if (\App\Models\Torrent::query()->where('info_hash', $infohash)->exists()) { if ($exists) {
bark($lang_takeupload['std_torrent_existed']); // bark($lang_takeupload['std_torrent_existed']);
nexus_redirect(sprintf("details.php?id=%d&existed=1", $exists['id']));
} }
// ------------- start: check upload authority ------------------// // ------------- start: check upload authority ------------------//