From da1665e6c6dd34ad0d41ef083fb071c5107ba719 Mon Sep 17 00:00:00 2001 From: Roman Kelesidis Date: Thu, 24 Aug 2023 00:09:29 +0700 Subject: [PATCH] Minor improvements (#228) * Minor improvements * Update CHANGELOG.md --- CHANGELOG.md | 2 +- dl.php | 4 ++-- library/attach_mod/displaying_torrent.php | 4 ++-- library/includes/functions_post.php | 4 ++-- posting.php | 4 ++-- styles/templates/default/posting.tpl | 4 ++-- viewtopic.php | 2 +- 7 files changed, 12 insertions(+), 12 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index aae81cc2..f092fd9f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,7 +9,7 @@ - Show renamed topic actions in log actions [\#227](https://github.com/torrentpier/torrentpier-lts/pull/227) ([belomaxorka](https://github.com/belomaxorka)) - Show set/unset downloaded actions in log actions [\#226](https://github.com/torrentpier/torrentpier-lts/pull/226) ([belomaxorka](https://github.com/belomaxorka)) - Show pin & unpin actions in log actions [\#225](https://github.com/torrentpier/torrentpier-lts/pull/225) ([belomaxorka](https://github.com/belomaxorka)) -- Minor improvements [\#215](https://github.com/torrentpier/torrentpier-lts/pull/215), [\#216](https://github.com/torrentpier/torrentpier-lts/pull/216), [\#217](https://github.com/torrentpier/torrentpier-lts/pull/217), [\#218](https://github.com/torrentpier/torrentpier-lts/pull/218), [\#221](https://github.com/torrentpier/torrentpier-lts/pull/221), [\#222](https://github.com/torrentpier/torrentpier-lts/pull/222), [\#224](https://github.com/torrentpier/torrentpier-lts/pull/224) ([belomaxorka](https://github.com/belomaxorka)) +- Minor improvements [\#215](https://github.com/torrentpier/torrentpier-lts/pull/215), [\#216](https://github.com/torrentpier/torrentpier-lts/pull/216), [\#217](https://github.com/torrentpier/torrentpier-lts/pull/217), [\#218](https://github.com/torrentpier/torrentpier-lts/pull/218), [\#221](https://github.com/torrentpier/torrentpier-lts/pull/221), [\#222](https://github.com/torrentpier/torrentpier-lts/pull/222), [\#224](https://github.com/torrentpier/torrentpier-lts/pull/224), [\#228](https://github.com/torrentpier/torrentpier-lts/pull/228) ([belomaxorka](https://github.com/belomaxorka)) ## [v2.1.5-2023.07](https://github.com/torrentpier/torrentpier-lts/tree/v2.1.5-2023.07) (2023-08-04) [Full Changelog](https://github.com/torrentpier/torrentpier-lts/compare/v2.1.5-2023.06...v2.1.5-2023.07) diff --git a/dl.php b/dl.php index c46645bb..1dc00bb0 100644 --- a/dl.php +++ b/dl.php @@ -203,7 +203,7 @@ if ($download_mode == PHYSICAL_LINK) } else { - if (IS_GUEST && !bb_captcha('check')) + if ((IS_GUEST && !$bb_cfg['captcha']['disabled']) && !bb_captcha('check')) { global $template; @@ -226,4 +226,4 @@ else send_file_to_browser($attachment, $upload_dir); exit; -} \ No newline at end of file +} diff --git a/library/attach_mod/displaying_torrent.php b/library/attach_mod/displaying_torrent.php index d7d4df67..1ad72c4e 100644 --- a/library/attach_mod/displaying_torrent.php +++ b/library/attach_mod/displaying_torrent.php @@ -183,7 +183,7 @@ if ($tor_reged && $tor_info) $user_status = isset($bt_userdata['user_status']) ? $bt_userdata['user_status'] : null; - if (($min_ratio_dl || $min_ratio_warn) && $user_status != DL_STATUS_COMPLETE && $bt_user_id != $poster_id && $tor_type != TOR_TYPE_GOLD) + if (($min_ratio_dl || $min_ratio_warn) && $user_status != DL_STATUS_COMPLETE && ($bt_user_id != ($poster_id || GUEST_UID)) && $tor_type != TOR_TYPE_GOLD) { if (($user_ratio = get_bt_ratio($bt_userdata)) !== null) { @@ -601,4 +601,4 @@ $template->assign_vars(array( 'LEECH_EXIST' => ($leechers || defined('LEECHER_EXIST')), 'TOR_HELP_LINKS' => $bb_cfg['tor_help_links'], 'CALL_SEED' => ($bb_cfg['callseed'] && $tor_reged && !isset($bb_cfg['tor_no_tor_act'][$tor_info['tor_status']]) && $seed_count < 3 && $tor_info['call_seed_time'] < (TIMENOW - 86400)), -)); \ No newline at end of file +)); diff --git a/library/includes/functions_post.php b/library/includes/functions_post.php index 08fd8ab3..82ebc720 100644 --- a/library/includes/functions_post.php +++ b/library/includes/functions_post.php @@ -60,7 +60,7 @@ function prepare_post(&$mode, &$post_data, &$error_msg, &$username, &$subject, & } } - if (IS_GUEST && !bb_captcha('check')) + if ((IS_GUEST && !$bb_cfg['captcha']['disabled']) && !bb_captcha('check')) { $error_msg .= (!empty($error_msg)) ? '
' . $lang['CAPTCHA_WRONG'] : $lang['CAPTCHA_WRONG']; } @@ -539,4 +539,4 @@ function topic_review ($topic_id) $template->assign_vars(array( 'TPL_TOPIC_REVIEW' => (bool) $review_posts, )); -} \ No newline at end of file +} diff --git a/posting.php b/posting.php index 3ef99c02..402e42c1 100644 --- a/posting.php +++ b/posting.php @@ -703,7 +703,7 @@ $template->assign_vars(array( 'U_VIEW_FORUM' => "viewforum.php?" . POST_FORUM_URL . "=$forum_id", 'USERNAME' => @$username, - 'CAPTCHA_HTML' => (IS_GUEST) ? bb_captcha('get') : '', + 'CAPTCHA_HTML' => (IS_GUEST && !$bb_cfg['captcha']['disabled']) ? bb_captcha('get') : '', 'SUBJECT' => $subject, 'MESSAGE' => $message, @@ -743,4 +743,4 @@ require(PAGE_HEADER); $template->pparse('body'); -require(PAGE_FOOTER); \ No newline at end of file +require(PAGE_FOOTER); diff --git a/styles/templates/default/posting.tpl b/styles/templates/default/posting.tpl index 6711d588..92e1a4b3 100644 --- a/styles/templates/default/posting.tpl +++ b/styles/templates/default/posting.tpl @@ -79,7 +79,7 @@ {L_USERNAME}   - + @@ -194,4 +194,4 @@
- \ No newline at end of file + diff --git a/viewtopic.php b/viewtopic.php index 0e561eb2..558aa268 100644 --- a/viewtopic.php +++ b/viewtopic.php @@ -866,7 +866,7 @@ if ($bb_cfg['show_quick_reply']) 'QUICK_REPLY' => true, 'QR_POST_ACTION' => POSTING_URL, 'QR_TOPIC_ID' => $topic_id, - 'CAPTCHA_HTML' => (IS_GUEST) ? bb_captcha('get') : '', + 'CAPTCHA_HTML' => (IS_GUEST && !$bb_cfg['captcha']['disabled']) ? bb_captcha('get') : '', )); if (!IS_GUEST)