From 5d565175040d22a89616ce1c017ad79e13600567 Mon Sep 17 00:00:00 2001 From: Roman Kelesidis Date: Mon, 17 Jun 2024 18:52:47 +0700 Subject: [PATCH] Minor improvements (#1517) * Minor improvements * Updated * Update CHANGELOG.md --- CHANGELOG.md | 2 +- common.php | 20 -------------------- library/defines.php | 22 ++++++++++++++++++++++ library/includes/init_bb.php | 3 +-- 4 files changed, 24 insertions(+), 23 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4d7581c24..b6cf340ad 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,7 +13,7 @@ - Some security enhancements (Part 2) [\#1505](https://github.com/torrentpier/torrentpier/pull/1505) ([belomaxorka](https://github.com/belomaxorka)) - Some improvements for integrity checker [\#1501](https://github.com/torrentpier/torrentpier/pull/1501) ([belomaxorka](https://github.com/belomaxorka)) - Hide vote button in topic if guest [\#1507](https://github.com/torrentpier/torrentpier/pull/1507) ([belomaxorka](https://github.com/belomaxorka)) -- Minor improvements [\#1502](https://github.com/torrentpier/torrentpier/pull/1502), [\#1506](https://github.com/torrentpier/torrentpier/pull/1506), [\#1509](https://github.com/torrentpier/torrentpier/pull/1509), [\#1511](https://github.com/torrentpier/torrentpier/pull/1511), [\#1515](https://github.com/torrentpier/torrentpier/pull/1515), [\#1516](https://github.com/torrentpier/torrentpier/pull/1516) ([belomaxorka](https://github.com/belomaxorka)) +- Minor improvements [\#1502](https://github.com/torrentpier/torrentpier/pull/1502), [\#1506](https://github.com/torrentpier/torrentpier/pull/1506), [\#1509](https://github.com/torrentpier/torrentpier/pull/1509), [\#1511](https://github.com/torrentpier/torrentpier/pull/1511), [\#1515](https://github.com/torrentpier/torrentpier/pull/1515), [\#1516](https://github.com/torrentpier/torrentpier/pull/1516), [\#1517](https://github.com/torrentpier/torrentpier/pull/1517) ([belomaxorka](https://github.com/belomaxorka)) - New Crowdin updates [\#1504](https://github.com/torrentpier/torrentpier/pull/1504), [\#1513](https://github.com/torrentpier/torrentpier/pull/1513) ([Exileum](https://github.com/Exileum)) ## [v2.4.3](https://github.com/torrentpier/torrentpier/tree/v2.4.3) (2024-06-09) diff --git a/common.php b/common.php index bce07f925..0e7bd04af 100644 --- a/common.php +++ b/common.php @@ -100,26 +100,6 @@ define('FORUM_PATH', $bb_cfg['script_path']); define('FULL_URL', $server_protocol . $bb_cfg['server_name'] . $server_port . $bb_cfg['script_path']); unset($server_protocol, $server_port); -// Board / tracker shared constants and functions -define('BB_BT_TORRENTS', 'bb_bt_torrents'); -define('BB_BT_TRACKER', 'bb_bt_tracker'); -define('BB_BT_TRACKER_SNAP', 'bb_bt_tracker_snap'); -define('BB_BT_USERS', 'bb_bt_users'); - -define('BT_AUTH_KEY_LENGTH', 20); - -define('DL_STATUS_RELEASER', -1); -define('DL_STATUS_DOWN', 0); -define('DL_STATUS_COMPLETE', 1); -define('DL_STATUS_CANCEL', 3); -define('DL_STATUS_WILL', 4); - -define('TOR_TYPE_GOLD', 1); -define('TOR_TYPE_SILVER', 2); - -define('GUEST_UID', -1); -define('BOT_UID', -746); - /** * Database */ diff --git a/library/defines.php b/library/defines.php index f119eb034..4cd5e9fbc 100644 --- a/library/defines.php +++ b/library/defines.php @@ -97,6 +97,13 @@ define('CRON_RUNNING', TRIGGERS_DIR . '/cron_running'); define('GZIP_OUTPUT_ALLOWED', extension_loaded('zlib') && !ini_get('zlib.output_compression')); define('UA_GZIP_SUPPORTED', isset($_SERVER['HTTP_ACCEPT_ENCODING']) && str_contains($_SERVER['HTTP_ACCEPT_ENCODING'], 'gzip')); +// Tracker shared constants +define('BB_BT_TORRENTS', 'bb_bt_torrents'); +define('BB_BT_TRACKER', 'bb_bt_tracker'); +define('BB_BT_TRACKER_SNAP', 'bb_bt_tracker_snap'); +define('BB_BT_USERS', 'bb_bt_users'); +define('BT_AUTH_KEY_LENGTH', 20); // Passkey length + // Torrents (reserved: -1) define('TOR_NOT_APPROVED', 0); // не проверено define('TOR_CLOSED', 1); // закрыто @@ -112,6 +119,17 @@ define('TOR_TMP', 10); // временная define('TOR_PREMOD', 11); // премодерация define('TOR_REPLENISH', 12); // пополняемая +// Torrent types (Gold / Silver) +define('TOR_TYPE_GOLD', 1); +define('TOR_TYPE_SILVER', 2); + +// DL-statuses +define('DL_STATUS_RELEASER', -1); +define('DL_STATUS_DOWN', 0); +define('DL_STATUS_COMPLETE', 1); +define('DL_STATUS_CANCEL', 3); +define('DL_STATUS_WILL', 4); + // Cron define('CRON_LOG_ENABLED', true); // global ON/OFF define('CRON_FORCE_LOG', false); // always log regardless of job settings @@ -124,6 +142,10 @@ define('CRON_LOG_FILE', 'cron'); // without ext define('ONLY_NEW_POSTS', 1); define('ONLY_NEW_TOPICS', 2); +// User UIDs +define('GUEST_UID', -1); +define('BOT_UID', -746); + // Ratio limits define('TR_RATING_LIMITS', true); // ON/OFF define('MIN_DL_FOR_RATIO', 10737418240); // 10 GB in bytes, 0 - disable diff --git a/library/includes/init_bb.php b/library/includes/init_bb.php index c3c624107..47e4a01ff 100644 --- a/library/includes/init_bb.php +++ b/library/includes/init_bb.php @@ -306,14 +306,13 @@ define('FILELIST_URL', 'filelist.php?' . POST_TOPIC_URL . '='); define('USER_AGENT', strtolower($_SERVER['HTTP_USER_AGENT'])); define('HTML_SELECT_MAX_LENGTH', 60); +define('HTML_SF_SPACER', ' |- '); define('HTML_CHECKED', ' checked '); define('HTML_DISABLED', ' disabled '); define('HTML_READONLY', ' readonly '); define('HTML_SELECTED', ' selected '); -define('HTML_SF_SPACER', ' |- '); - // $GPC define('KEY_NAME', 0); // position in $GPC['xxx'] define('DEF_VAL', 1);