From b27fa94ee899114dc2e9eb522a6316c4ac411a00 Mon Sep 17 00:00:00 2001 From: Roman Kelesidis Date: Sat, 14 Dec 2024 15:33:41 +0700 Subject: [PATCH] Minor improvements (#1713) * Minor improvements * Update init_bb.php * Updated * Revert "Updated" This reverts commit af83788c2288cae2edfe904c0ce73a21690b10f7. * Update CHANGELOG.md --- CHANGELOG.md | 2 +- README.md | 2 +- admin/stats/tracker.php | 8 ++++---- common.php | 4 ++-- library/ajax/change_tor_status.php | 4 ++-- library/ajax/ffprobe_info.php | 16 ++++++++-------- library/ajax/mod_action.php | 2 +- library/includes/init_bb.php | 2 +- library/language/source/main.php | 2 +- src/Legacy/Attach.php | 2 +- src/Legacy/Common/Upload.php | 2 +- src/Legacy/Common/User.php | 2 +- styles/templates/admin/admin_sitemap.tpl | 2 +- styles/templates/admin/admin_user_ban.tpl | 2 +- styles/templates/admin/index.tpl | 2 +- styles/templates/default/index.tpl | 2 +- styles/templates/default/viewtopic.tpl | 2 +- styles/templates/default/viewtopic_attach.tpl | 4 ++-- 18 files changed, 31 insertions(+), 31 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e156c19e3..305ff2d98 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,7 +9,7 @@ - Show torrent's announcers list in `filelist.php` page [\#1708](https://github.com/torrentpier/torrentpier/pull/1708) ([belomaxorka](https://github.com/belomaxorka)) - [Configurable] Show magnet-links for guests [\#1712](https://github.com/torrentpier/torrentpier/pull/1712) ([belomaxorka](https://github.com/belomaxorka)) - Set `cursor: pointer;` for buttons, inputs (buttons) [\#1710](https://github.com/torrentpier/torrentpier/pull/1710), [\#1711](https://github.com/torrentpier/torrentpier/pull/1711) ([belomaxorka](https://github.com/belomaxorka)) -- Minor improvements [\#1705](https://github.com/torrentpier/torrentpier/pull/1705) ([belomaxorka](https://github.com/belomaxorka)) +- Minor improvements [\#1705](https://github.com/torrentpier/torrentpier/pull/1705), [\#1713](https://github.com/torrentpier/torrentpier/pull/1713) ([belomaxorka](https://github.com/belomaxorka)) - New Crowdin updates [\#1704](https://github.com/torrentpier/torrentpier/pull/1704), [\#1706](https://github.com/torrentpier/torrentpier/pull/1706) ([Exileum](https://github.com/Exileum)) ## [v2.4.5-rc.1](https://github.com/torrentpier/torrentpier/tree/v2.4.5-rc.1) (2024-12-08) diff --git a/README.md b/README.md index a37630f68..148be995d 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@

Bull-powered BitTorrent tracker engine -
+

diff --git a/admin/stats/tracker.php b/admin/stats/tracker.php index 08130ee70..aef1eb91f 100644 --- a/admin/stats/tracker.php +++ b/admin/stats/tracker.php @@ -116,7 +116,7 @@ if ($client_full || !$stats_cache = CACHE('tr_cache')->get('tracker_clients_stat $n = 1; foreach (array_slice($clients_percentage, 0, $numwant) as $client => $value) { - $client_list .= ($client_full) ? ("$client => $value
") : "$n. " . get_user_torrent_client($client) . " $value
"; + $client_list .= ($client_full) ? ("$client => $value
") : "$n. " . get_user_torrent_client($client) . " $value
"; $n++; } @@ -164,10 +164,10 @@ echo "\n $client_list -
+
\n"; -echo (count($clients_percentage) > $numwant) ? ('' . 'Show more' . '
') : ''; -echo $client_full ? '
Get more length and numbers via modifying the parameters in the url' : (!empty($client_list) ? 'Peer_ids with more length (version debugging)' : ''); +echo (count($clients_percentage) > $numwant) ? ('' . 'Show more' . '
') : ''; +echo $client_full ? '
Get more length and numbers via modifying the parameters in the url' : (!empty($client_list) ? 'Peer_ids with more length (version debugging)' : ''); echo ''; echo ''; echo !$client_full ? '

Simple stats for clients are being cached for one hour.

' : ''; diff --git a/common.php b/common.php index 30e818a17..7763fc7f5 100644 --- a/common.php +++ b/common.php @@ -54,7 +54,7 @@ require_once BB_PATH . '/library/defines.php'; // Composer if (!is_file(BB_PATH . '/vendor/autoload.php')) { - die('🔩 Manual install: Install composer and run composer install.
☕️ Quick install: Run php install.php in CLI mode.'); + die('🔩 Manual install: Install composer and run composer install.
☕️ Quick install: Run php install.php in CLI mode.'); } require_once BB_PATH . '/vendor/autoload.php'; @@ -75,7 +75,7 @@ try { $dotenv = Dotenv\Dotenv::createMutable(BB_PATH); $dotenv->load(); } catch (\Dotenv\Exception\InvalidPathException $pathException) { - die('🔩 Manual install: Rename from .env.example to .env, and configure it.
☕️ Quick install: Run php install.php in CLI mode.'); + die('🔩 Manual install: Rename from .env.example to .env, and configure it.
☕️ Quick install: Run php install.php in CLI mode.'); } // Load config diff --git a/library/ajax/change_tor_status.php b/library/ajax/change_tor_status.php index dc67e9782..b1bbcb95b 100644 --- a/library/ajax/change_tor_status.php +++ b/library/ajax/change_tor_status.php @@ -90,13 +90,13 @@ switch ($mode) { // Log action $log_msg = sprintf($lang['TOR_STATUS_LOG_ACTION'], $bb_cfg['tor_icons'][$new_status] . ' ' . $lang['TOR_STATUS_NAME'][$new_status] . '', $bb_cfg['tor_icons'][$tor['tor_status']] . ' ' . $lang['TOR_STATUS_NAME'][$tor['tor_status']] . ''); if ($comment && $comment != $lang['COMMENT']) { - $log_msg .= "
{$lang['COMMENT']}: $comment."; + $log_msg .= "
{$lang['COMMENT']}: $comment."; } $log_action->mod('mod_topic_change_tor_status', [ 'forum_id' => $tor['forum_id'], 'topic_id' => $tor['topic_id'], 'topic_title' => $tor['topic_title'], - 'log_msg' => $log_msg . '
-------------', + 'log_msg' => $log_msg . '
-------------', ]); $this->response['status'] = $bb_cfg['tor_icons'][$new_status] . ' ' . $lang['TOR_STATUS_NAME'][$new_status] . ' · ' . profile_url($userdata) . ' · ' . delta_time(TIMENOW) . $lang['TOR_BACK'] . ''; diff --git a/library/ajax/ffprobe_info.php b/library/ajax/ffprobe_info.php index 768666f7e..5213f6e3a 100644 --- a/library/ajax/ffprobe_info.php +++ b/library/ajax/ffprobe_info.php @@ -50,27 +50,27 @@ if (isset($ffpInfo->streams)) { $audioDub = array_map(function ($stream) { global $lang; - $result = '' . sprintf($lang['AUDIO_TRACK'], (!isset($stream->index) || $stream->index === 0) ? 1 : $stream->index) . '
'; + $result = '' . sprintf($lang['AUDIO_TRACK'], (!isset($stream->index) || $stream->index === 0) ? 1 : $stream->index) . '
'; if (isset($stream->tags->language)) { if (isset($stream->tags->title)) { $result .= '' . mb_strtoupper($stream->tags->language, 'UTF-8') . ' (' . $stream->tags->title . ')' . ''; } else { $result .= '' . mb_strtoupper($stream->tags->language, 'UTF-8') . ''; } - $result .= '
'; + $result .= '
'; } if (!empty($stream->codec_name)) { - $result .= sprintf($lang['AUDIO_CODEC'], $stream->codec_long_name, mb_strtoupper($stream->codec_name, 'UTF-8')) . '
'; + $result .= sprintf($lang['AUDIO_CODEC'], $stream->codec_long_name, mb_strtoupper($stream->codec_name, 'UTF-8')) . '
'; } if (!empty($stream->bit_rate)) { - $result .= sprintf($lang['BITRATE'], humn_bitrate((int)$stream->bit_rate)) . '
'; + $result .= sprintf($lang['BITRATE'], humn_bitrate((int)$stream->bit_rate)) . '
'; } if (!empty($stream->sample_rate)) { - $result .= sprintf($lang['SAMPLE_RATE'], humn_sample_rate((int)$stream->sample_rate)) . '
'; + $result .= sprintf($lang['SAMPLE_RATE'], humn_sample_rate((int)$stream->sample_rate)) . '
'; } if (!empty($stream->channels)) { - $result .= sprintf($lang['CHANNELS'], $stream->channels) . '
'; + $result .= sprintf($lang['CHANNELS'], $stream->channels) . '
'; } if (!empty($stream->channel_layout)) { $result .= sprintf($lang['CHANNELS_LAYOUT'], $stream->channel_layout); @@ -90,10 +90,10 @@ if (isset($ffpInfo->streams)) { // Validate output data $result = '
'; if (!empty($data['resolution'])) { - $result .= $data['resolution'] . '
'; + $result .= $data['resolution'] . '
'; } if (!empty($data['filesize'])) { - $result .= $data['filesize'] . '
'; + $result .= $data['filesize'] . '
'; } if (!empty($data['video_codec'])) { $result .= $data['video_codec']; diff --git a/library/ajax/mod_action.php b/library/ajax/mod_action.php index eaacae59a..56f5effca 100644 --- a/library/ajax/mod_action.php +++ b/library/ajax/mod_action.php @@ -49,7 +49,7 @@ switch ($mode) { 'forum_id' => $tor['forum_id'], 'topic_id' => $tor['topic_id'], 'topic_title' => $tor['topic_title'], - 'log_msg' => $log_msg . '
-------------', + 'log_msg' => $log_msg . '
-------------', ]); } $this->response['status'] = $bb_cfg['tor_icons'][$status]; diff --git a/library/includes/init_bb.php b/library/includes/init_bb.php index 5046afdc2..5472c388d 100644 --- a/library/includes/init_bb.php +++ b/library/includes/init_bb.php @@ -332,7 +332,7 @@ function send_no_cache_headers() } /** - * Converts "
" tags to "\n" line breaks + * Converts "
" / "
" tags to "\n" line breaks * * @param string $string * @return string diff --git a/library/language/source/main.php b/library/language/source/main.php index 4aab2bcea..a7aa6556c 100644 --- a/library/language/source/main.php +++ b/library/language/source/main.php @@ -1442,7 +1442,7 @@ $lang['CHANGE_TOR_TYPE'] = 'Type the torrent successfully changed'; $lang['DEL_TORRENT'] = 'Are you sure you want to delete the torrent?'; $lang['DEL_MOVE_TORRENT'] = 'Are you sure you want to delete and move the topic?'; $lang['UNEXECUTED_RELEASE'] = 'Do you have a shapeless release before creating a new fix his unformed!'; -$lang['TOR_STATUS_LOG_ACTION'] = 'New status: %s.
Previous status: %s.'; +$lang['TOR_STATUS_LOG_ACTION'] = 'New status: %s.
Previous status: %s.'; // tor_comment $lang['TOR_MOD_TITLE'] = 'Changing the status of distribution - %s'; diff --git a/src/Legacy/Attach.php b/src/Legacy/Attach.php index ffd46e160..60db3ed6b 100644 --- a/src/Legacy/Attach.php +++ b/src/Legacy/Attach.php @@ -757,7 +757,7 @@ class Attach // Handling errors while uploading if (isset($this->error) && ($this->error !== UPLOAD_ERR_OK)) { if (isset($lang['UPLOAD_ERRORS'][$this->error])) { - bb_die($lang['UPLOAD_ERROR_COMMON'] . '

' . $lang['UPLOAD_ERRORS'][$this->error]); + bb_die($lang['UPLOAD_ERROR_COMMON'] . '

' . $lang['UPLOAD_ERRORS'][$this->error]); } else { bb_die($lang['UPLOAD_ERROR_COMMON']); } diff --git a/src/Legacy/Common/Upload.php b/src/Legacy/Common/Upload.php index 4e4f872d3..7ba79cd60 100644 --- a/src/Legacy/Common/Upload.php +++ b/src/Legacy/Common/Upload.php @@ -114,7 +114,7 @@ class Upload // Handling errors while uploading if (isset($this->file['error']) && ($this->file['error'] !== UPLOAD_ERR_OK)) { if (isset($lang['UPLOAD_ERRORS'][$this->file['error']])) { - $this->errors[] = $lang['UPLOAD_ERROR_COMMON'] . '

' . $lang['UPLOAD_ERRORS'][$this->file['error']]; + $this->errors[] = $lang['UPLOAD_ERROR_COMMON'] . '

' . $lang['UPLOAD_ERRORS'][$this->file['error']]; } else { $this->errors[] = $lang['UPLOAD_ERROR_COMMON']; } diff --git a/src/Legacy/Common/User.php b/src/Legacy/Common/User.php index eb136e191..245e65b2a 100644 --- a/src/Legacy/Common/User.php +++ b/src/Legacy/Common/User.php @@ -224,7 +224,7 @@ class User if ($banInfo = getBanInfo((int)$this->id)) { $this->session_end(); if (!empty($banInfo['ban_reason'])) { - bb_die($lang['YOU_BEEN_BANNED'] . '

' . $lang['REASON'] . ': ' . '' . $banInfo['ban_reason'] . ''); + bb_die($lang['YOU_BEEN_BANNED'] . '

' . $lang['REASON'] . ': ' . '' . $banInfo['ban_reason'] . ''); } else { bb_die($lang['YOU_BEEN_BANNED']); } diff --git a/styles/templates/admin/admin_sitemap.tpl b/styles/templates/admin/admin_sitemap.tpl index ed9e83b59..20057462f 100644 --- a/styles/templates/admin/admin_sitemap.tpl +++ b/styles/templates/admin/admin_sitemap.tpl @@ -111,7 +111,7 @@ ajax.callback.sitemap = function(data) {
-

{L_SITEMAP_ADD_EXP_1}

{L_SITEMAP_ADD_EXP_2}

+

{L_SITEMAP_ADD_EXP_1}

{L_SITEMAP_ADD_EXP_2}

diff --git a/styles/templates/admin/admin_user_ban.tpl b/styles/templates/admin/admin_user_ban.tpl index e70f40e7d..65b6e9284 100644 --- a/styles/templates/admin/admin_user_ban.tpl +++ b/styles/templates/admin/admin_user_ban.tpl @@ -27,4 +27,4 @@ -
+
diff --git a/styles/templates/admin/index.tpl b/styles/templates/admin/index.tpl index 357c7f6ff..bb2fdbd93 100644 --- a/styles/templates/admin/index.tpl +++ b/styles/templates/admin/index.tpl @@ -85,7 +85,7 @@ } -
+
diff --git a/styles/templates/default/index.tpl b/styles/templates/default/index.tpl index 05eaca9ab..542ac8873 100644 --- a/styles/templates/default/index.tpl +++ b/styles/templates/default/index.tpl @@ -1,6 +1,6 @@
- {L_TP_VERSION}: {$bb_cfg['tp_version']}
+ {L_TP_VERSION}: {$bb_cfg['tp_version']}
{L_USERNAME}: admin / {L_PASSWORD}: admin
diff --git a/styles/templates/default/viewtopic.tpl b/styles/templates/default/viewtopic.tpl index dbf624a58..a6d92d6e1 100644 --- a/styles/templates/default/viewtopic.tpl +++ b/styles/templates/default/viewtopic.tpl @@ -598,7 +598,7 @@ function build_poll_add_form (src_el) -
+
diff --git a/styles/templates/default/viewtopic_attach.tpl b/styles/templates/default/viewtopic_attach.tpl index 707522011..7aff7261d 100644 --- a/styles/templates/default/viewtopic_attach.tpl +++ b/styles/templates/default/viewtopic_attach.tpl @@ -160,8 +160,8 @@ {postrow.attach.tor_reged.TRACKER_LINK} [ {postrow.attach.tor_reged.REGED_TIME} ] -

info_hash: {postrow.attach.tor_reged.HASH} -
info_hash v2: {postrow.attach.tor_reged.HASH_V2} +

info_hash: {postrow.attach.tor_reged.HASH} +
info_hash v2: {postrow.attach.tor_reged.HASH_V2}