From 46910d3015679ec6db404a58e3bb24b617cafbbd Mon Sep 17 00:00:00 2001 From: Roman Kelesidis Date: Tue, 30 Jan 2024 22:18:05 +0700 Subject: [PATCH] Minor improvements (#1358) * Minor improvements * Update viewtopic_torrent.tpl * Update admin_rebuild_search.php * Updated * Apply fixes from StyleCI (#1361) Co-authored-by: StyleCI Bot * Update CHANGELOG.md --------- Co-authored-by: Yury Pikhtarev Co-authored-by: StyleCI Bot --- CHANGELOG.md | 5 ++++- CONTRIBUTING.md | 11 ++++++----- admin/admin_rebuild_search.php | 2 +- admin/stats/tracker.php | 5 ++--- library/ajax/thanks.php | 10 ++++------ styles/templates/default/viewtopic_torrent.tpl | 4 +++- styles/templates/posting_tpl.tpl | 12 ++++++------ 7 files changed, 26 insertions(+), 23 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c922189fb..0bcfb35f8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,9 @@ - [BEP47] sha1 hash files are binary by default [\#1348](https://github.com/torrentpier/torrentpier/pull/1348) ([kovalensky](https://github.com/kovalensky)) - Extend css contrast attributes [\#1349](https://github.com/torrentpier/torrentpier/pull/1349) ([kovalensky](https://github.com/kovalensky)) - Flatten file list for hybrid files [\#1350](https://github.com/torrentpier/torrentpier/pull/1350) ([kovalensky](https://github.com/kovalensky)) +- Counter is not precise [\#1360](https://github.com/torrentpier/torrentpier/pull/1360) ([kovalensky](https://github.com/kovalensky)) +- CSS hover for news [\#1359](https://github.com/torrentpier/torrentpier/pull/1359) ([kovalensky](https://github.com/kovalensky)) +- Add referrer "origin" policy to repository links [\#1357](https://github.com/torrentpier/torrentpier/pull/1357) ([kovalensky](https://github.com/kovalensky)) - Added new flag πŸ•Š [\#1347](https://github.com/torrentpier/torrentpier/pull/1347) ([belomaxorka](https://github.com/belomaxorka)) - Added ability to view "Watching topics" of other people's (For admins only) [\#1336](https://github.com/torrentpier/torrentpier/pull/1336) ([belomaxorka](https://github.com/belomaxorka)) - Added `bt_announce_url` autofill [\#1331](https://github.com/torrentpier/torrentpier/pull/1331) ([belomaxorka](https://github.com/belomaxorka)) @@ -29,7 +32,7 @@ - Some enhancements for topic_tpl [\#1356](https://github.com/torrentpier/torrentpier/pull/1356) ([belomaxorka](https://github.com/belomaxorka)) - Sending debug errors to us 🌚 via Telegram bot [\#1323](https://github.com/torrentpier/torrentpier/pull/1323) ([belomaxorka](https://github.com/belomaxorka)) - Don't update downloads counter if attachment not exists [\#1345](https://github.com/torrentpier/torrentpier/pull/1345) ([belomaxorka](https://github.com/belomaxorka)) -- Minor improvements [\#1306](https://github.com/torrentpier/torrentpier/pull/1306), [\#1307](https://github.com/torrentpier/torrentpier/pull/1307), [\#1308](https://github.com/torrentpier/torrentpier/pull/1308), [\#1315](https://github.com/torrentpier/torrentpier/pull/1315), [\#1328](https://github.com/torrentpier/torrentpier/pull/1328), [\#1338](https://github.com/torrentpier/torrentpier/pull/1338), [\#1353](https://github.com/torrentpier/torrentpier/pull/1353), [\#1355](https://github.com/torrentpier/torrentpier/pull/1355) ([belomaxorka](https://github.com/belomaxorka)) +- Minor improvements [\#1306](https://github.com/torrentpier/torrentpier/pull/1306), [\#1307](https://github.com/torrentpier/torrentpier/pull/1307), [\#1308](https://github.com/torrentpier/torrentpier/pull/1308), [\#1315](https://github.com/torrentpier/torrentpier/pull/1315), [\#1328](https://github.com/torrentpier/torrentpier/pull/1328), [\#1338](https://github.com/torrentpier/torrentpier/pull/1338), [\#1353](https://github.com/torrentpier/torrentpier/pull/1353), [\#1355](https://github.com/torrentpier/torrentpier/pull/1355), [\#1358](https://github.com/torrentpier/torrentpier/pull/1358) ([belomaxorka](https://github.com/belomaxorka)) - Some bugfixes [\#1326](https://github.com/torrentpier/torrentpier/pull/1326) ([belomaxorka](https://github.com/belomaxorka)) - Updated deps [\#1304](https://github.com/torrentpier/torrentpier/pull/1304), [\#1305](https://github.com/torrentpier/torrentpier/pull/1305) ([belomaxorka](https://github.com/belomaxorka)) - New Crowdin updates [\#1311](https://github.com/torrentpier/torrentpier/pull/1311), [\#1314](https://github.com/torrentpier/torrentpier/pull/1314), [\#1335](https://github.com/torrentpier/torrentpier/pull/1335), [\#1337](https://github.com/torrentpier/torrentpier/pull/1337), [\#1344](https://github.com/torrentpier/torrentpier/pull/1344) ([Exileum](https://github.com/Exileum)) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index e06246e9b..864d4b1d3 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,19 +1,19 @@ # Contributing When contributing to this repository, please first discuss the change you wish to make via issue, -email, or any other method with the owners of this repository before making a change. +email, or any other method with the owners of this repository before making a change. Please note we have a code of conduct, please follow it in all your interactions with the project. ## Pull Request Process -1. Ensure any install or build dependencies are removed before the end of the layer when doing a +1. Ensure any install or build dependencies are removed before the end of the layer when doing a build. -2. Update the README.md with details of changes to the interface, this includes new environment +2. Update the README.md with details of changes to the interface, this includes new environment variables, exposed ports, useful file locations and container parameters. 3. Increase the version numbers in any examples files and the README.md to the new version that this Pull Request would represent. The versioning scheme we use is [SemVer](http://semver.org/). -4. You may merge the Pull Request in once you have the sign-off of two other developers, or if you +4. You may merge the Pull Request in once you have the sign-off of two other developers, or if you do not have permission to do that, you may request the second reviewer to merge it for you. ## Code of Conduct @@ -41,7 +41,7 @@ include: Examples of unacceptable behavior by participants include: * The use of sexualized language or imagery and unwelcome sexual attention or -advances + advances * Trolling, insulting/derogatory comments, and personal or political attacks * Public or private harassment * Publishing others' private information, such as a physical or electronic @@ -89,4 +89,5 @@ This Code of Conduct is adapted from the [Contributor Covenant][homepage], versi available at [http://contributor-covenant.org/version/1/4][version] [homepage]: http://contributor-covenant.org + [version]: http://contributor-covenant.org/version/1/4/ diff --git a/admin/admin_rebuild_search.php b/admin/admin_rebuild_search.php index 181e1ee84..8222a3b90 100644 --- a/admin/admin_rebuild_search.php +++ b/admin/admin_rebuild_search.php @@ -329,7 +329,7 @@ if ($mode == 'submit' || $mode == 'refresh') { 'TOTAL_PERCENT' => sprintf($lang['PERCENT_COMPLETED'], round($total_percent, 2)), 'LAST_CYCLE_TIME' => delta_time(TIMENOW), - 'SESSION_TIME' => delta_time($last_session_data['start_time']), + 'SESSION_TIME' => delta_time(($last_session_data['start_time'] == 0) ? TIMENOW : $last_session_data['start_time']), 'SESSION_AVERAGE_CYCLE_TIME' => delta_time((int)$session_average_cycle_time, 0), 'SESSION_ESTIMATED_TIME' => delta_time((int)$session_estimated_time, 0), diff --git a/admin/stats/tracker.php b/admin/stats/tracker.php index 98fd99f32..0f9bcd098 100644 --- a/admin/stats/tracker.php +++ b/admin/stats/tracker.php @@ -94,8 +94,7 @@ if ($client_full || !$stats_cache = CACHE('tr_cache')->get('tracker_clients_stat $clientString = $client_full ? substr($row['client'], 0, $client_full) : substr($row['client'], 0, 3); if (!isset($clients[$clientString])) { $clients[$clientString] = 1; - } - else { + } else { $clients[$clientString]++; } $client_count++; @@ -168,7 +167,7 @@ echo "\n
\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 $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/library/ajax/thanks.php b/library/ajax/thanks.php index 963ada63c..41b1646a2 100644 --- a/library/ajax/thanks.php +++ b/library/ajax/thanks.php @@ -40,8 +40,7 @@ switch ($mode) { $values = "$topic_id, {$userdata['user_id']}, " . TIMENOW; DB()->query('INSERT IGNORE INTO ' . BB_THX . " ($columns) VALUES ($values)"); break; - } - else { + } else { $this->ajax_die($lang['NEED_TO_LOGIN_FIRST']); } @@ -56,12 +55,11 @@ switch ($mode) { $this->response['html'] = join(', ', $user_list) ?: $lang['NO_LIKES']; break; - } - else { + } else { $this->ajax_die($lang['NEED_TO_LOGIN_FIRST']); } - default: - $this->ajax_die('Invalid mode: ' . $mode); + default: + $this->ajax_die('Invalid mode: ' . $mode); } $this->response['mode'] = $mode; diff --git a/styles/templates/default/viewtopic_torrent.tpl b/styles/templates/default/viewtopic_torrent.tpl index 47a028ddf..9d29a36ba 100644 --- a/styles/templates/default/viewtopic_torrent.tpl +++ b/styles/templates/default/viewtopic_torrent.tpl @@ -62,11 +62,13 @@ ajax.callback.callseed = function (data) { + - {L_SHOW_DL_LIST}: {L_NONE} + {L_SHOW_DL_LIST}: {L_NONE} + diff --git a/styles/templates/posting_tpl.tpl b/styles/templates/posting_tpl.tpl index 826155c50..9220b19c5 100644 --- a/styles/templates/posting_tpl.tpl +++ b/styles/templates/posting_tpl.tpl @@ -4815,13 +4815,13 @@ $(function(){
[ Π˜Π½ΡΡ‚Ρ€ΡƒΠΊΡ†ΠΈΡ ]