From d2a1a7f5f97806189c97376bb260a33b20266593 Mon Sep 17 00:00:00 2001
From: Roman Kelesidis
Date: Wed, 10 Jul 2024 23:48:31 +0700
Subject: [PATCH] Minor improvements (#1532)
* Minor improvements
* Update clean_dlstat.php
* Updated
* Update usercp_viewprofile.tpl
* Update CHANGELOG.md
---
CHANGELOG.md | 2 +-
library/attach_mod/displaying_torrent.php | 3 +--
library/includes/cron/jobs/clean_dlstat.php | 13 -------------
styles/templates/default/usercp_viewprofile.tpl | 2 +-
styles/templates/default/viewtopic_attach.tpl | 2 +-
5 files changed, 4 insertions(+), 18 deletions(-)
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 04401d1db..7392bab31 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -15,7 +15,7 @@
- Some security improvements 🔑 [\#1503](https://github.com/torrentpier/torrentpier/pull/1503), [\#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 for guests [\#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), [\#1517](https://github.com/torrentpier/torrentpier/pull/1517), [\#1519](https://github.com/torrentpier/torrentpier/pull/1519), [\#1523](https://github.com/torrentpier/torrentpier/pull/1523), [\#1525](https://github.com/torrentpier/torrentpier/pull/1525), [\#1530](https://github.com/torrentpier/torrentpier/pull/1530) ([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), [\#1519](https://github.com/torrentpier/torrentpier/pull/1519), [\#1523](https://github.com/torrentpier/torrentpier/pull/1523), [\#1525](https://github.com/torrentpier/torrentpier/pull/1525), [\#1530](https://github.com/torrentpier/torrentpier/pull/1530), [\#1532](https://github.com/torrentpier/torrentpier/pull/1532) ([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/library/attach_mod/displaying_torrent.php b/library/attach_mod/displaying_torrent.php
index e3a81a40c..28e57e11f 100644
--- a/library/attach_mod/displaying_torrent.php
+++ b/library/attach_mod/displaying_torrent.php
@@ -27,7 +27,7 @@ $peers_div_style_overflow = "padding: 6px; height: $peers_overflow_div_height; o
$s_last_seed_date_format = 'Y-m-d';
$upload_image = '
';
-$peers_cnt = $seed_count = 0;
+$peers_cnt = $seed_count = $leech_count = 0;
$seeders = $leechers = '';
$tor_info = [];
@@ -196,7 +196,6 @@ if ($tor_reged && $tor_info) {
'ATTACH_ID' => $attach_id,
'TOR_SILVER_GOLD' => $tor_type,
'TOR_TYPE' => is_gold($tor_type),
- 'TOR_AUTHOR' => $bt_user_id == $poster_id && $bt_user_id != GUEST_UID,
// torrent status mod
'TOR_FROZEN' => !IS_AM ? (isset($bb_cfg['tor_frozen'][$tor_info['tor_status']]) && !(isset($bb_cfg['tor_frozen_author_download'][$tor_info['tor_status']]) && $userdata['user_id'] == $tor_info['poster_id'])) ? true : '' : '',
diff --git a/library/includes/cron/jobs/clean_dlstat.php b/library/includes/cron/jobs/clean_dlstat.php
index be4dceae4..d6f620541 100644
--- a/library/includes/cron/jobs/clean_dlstat.php
+++ b/library/includes/cron/jobs/clean_dlstat.php
@@ -35,19 +35,6 @@ if ($delete_dlstat_sql = implode(') OR (', $delete_dlstat_sql)) {
DB()->query("DELETE QUICK FROM " . BB_BT_DLSTATUS . " WHERE ($delete_dlstat_sql)");
}
-// Save the last 50 votes for topics
-DB()->query('
- DELETE t1
- FROM ' . BB_THX . ' t1
- JOIN (
- SELECT topic_id, MAX(time) as max_time
- FROM ' . BB_THX . '
- GROUP BY topic_id
- HAVING COUNT(*) > 50
- ) t2
- ON t1.topic_id = t2.topic_id AND t1.time = t2.max_time;
-');
-
// Delete orphans
DB()->query("
DELETE QUICK dl
diff --git a/styles/templates/default/usercp_viewprofile.tpl b/styles/templates/default/usercp_viewprofile.tpl
index 0d2634b7b..642847303 100644
--- a/styles/templates/default/usercp_viewprofile.tpl
+++ b/styles/templates/default/usercp_viewprofile.tpl
@@ -176,7 +176,7 @@ ajax.callback.index_data = function(data) {
{L_PROFILE} ·
{L_PERMISSIONS}
-
+
{L_PROFILE}
diff --git a/styles/templates/default/viewtopic_attach.tpl b/styles/templates/default/viewtopic_attach.tpl
index 0b1703ef1..ce1c50349 100644
--- a/styles/templates/default/viewtopic_attach.tpl
+++ b/styles/templates/default/viewtopic_attach.tpl
@@ -459,7 +459,7 @@ $('#tor-filelist-btn').click(function () {
}