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

@@ -68,7 +68,11 @@ if (!$row) {
print("<h1 align=\"center\">".$lang_details['text_successfully_edited']."</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>");
}
} 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>" : "");
$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);

View File

@@ -179,9 +179,10 @@ unset ($dict['announce-list']); // remove multi-tracker capability
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
if (\App\Models\Torrent::query()->where('info_hash', $infohash)->exists()) {
bark($lang_takeupload['std_torrent_existed']);
$exists = \App\Models\Torrent::query()->where('info_hash', $infohash)->first(['id']);
if ($exists) {
// bark($lang_takeupload['std_torrent_existed']);
nexus_redirect(sprintf("details.php?id=%d&existed=1", $exists['id']));
}
// ------------- start: check upload authority ------------------//