From 360c4cf3056a25f36c3f4e37b1cb9e3b851c2d04 Mon Sep 17 00:00:00 2001 From: Roman Kelesidis Date: Sat, 3 Feb 2024 11:51:50 +0700 Subject: [PATCH] Updated --- install/sql/mysql.sql | 2 +- library/includes/cron/jobs/clean_dlstat.php | 2 +- library/includes/cron/jobs/tr_make_snapshot.php | 2 +- library/includes/torrent_show_dl_list.php | 8 ++++---- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/install/sql/mysql.sql b/install/sql/mysql.sql index b79dd72e0..d5bb218ad 100644 --- a/install/sql/mysql.sql +++ b/install/sql/mysql.sql @@ -168,7 +168,7 @@ CREATE TABLE IF NOT EXISTS `bb_bt_dlstatus` `user_id` MEDIUMINT(9) NOT NULL DEFAULT '0', `topic_id` MEDIUMINT(8) UNSIGNED NOT NULL DEFAULT '0', `user_status` TINYINT(1) NOT NULL DEFAULT '0', - `last_modified_dlstatus` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `last_modified_dlstatus` INT(11) NOT NULL DEFAULT '0', PRIMARY KEY (`user_id`, `topic_id`), KEY `topic_id` (`topic_id`) ) diff --git a/library/includes/cron/jobs/clean_dlstat.php b/library/includes/cron/jobs/clean_dlstat.php index be4dceae4..71a16d738 100644 --- a/library/includes/cron/jobs/clean_dlstat.php +++ b/library/includes/cron/jobs/clean_dlstat.php @@ -26,7 +26,7 @@ foreach ($keeping_dlstat as $dl_status => $days_to_keep) { $delete_dlstat_sql[] = " user_status = $dl_status AND - last_modified_dlstatus < DATE_SUB(NOW(), INTERVAL $days_to_keep DAY) + last_modified_dlstatus < (UNIX_TIMESTAMP() - $days_to_keep*86400) "; } } diff --git a/library/includes/cron/jobs/tr_make_snapshot.php b/library/includes/cron/jobs/tr_make_snapshot.php index edf08cbca..bccaeb073 100644 --- a/library/includes/cron/jobs/tr_make_snapshot.php +++ b/library/includes/cron/jobs/tr_make_snapshot.php @@ -175,7 +175,7 @@ if ($bb_cfg['torhelp_enabled']) { AND tor.seeder_last_seen <= (UNIX_TIMESTAMP() - $tor_seed_last_seen_days*86400) AND dl.user_id IN($online_users_csv) AND dl.user_status IN(" . get_id_csv($dl_status_ary) . ") - AND dl.last_modified_dlstatus > DATE_SUB(NOW(), INTERVAL $tor_downloaded_days_ago DAY) + AND dl.last_modified_dlstatus >= (UNIX_TIMESTAMP() - $tor_downloaded_days_ago*86400) GROUP BY dl.user_id LIMIT 10000 "); diff --git a/library/includes/torrent_show_dl_list.php b/library/includes/torrent_show_dl_list.php index 6a95a72b9..644d95196 100644 --- a/library/includes/torrent_show_dl_list.php +++ b/library/includes/torrent_show_dl_list.php @@ -12,7 +12,7 @@ if (!defined('BB_ROOT')) { } $show_canceled_in_count_mode = false; -$title_date_format = 'Y-m-d'; +$title_date_format = 'd-M-y H:i'; $dl_list_sql_limit = 300; // DL-List overall limit $max_dl_users_before_overflow = 100; // for each dl-status $dl_users_overflow_div_height = '120px'; @@ -48,12 +48,12 @@ if ($show_dl_list) { FROM " . BB_BT_DLSTATUS_SNAP . " WHERE topic_id = $topic_id"; } else { - $sql = "SELECT d.user_status, d.user_id, DATE_FORMAT(d.last_modified_dlstatus, '%Y-%m-%d') AS last_modified_dlstatus, u.username, u.user_rank + $sql = "SELECT d.user_status, d.user_id, d.last_modified_dlstatus, u.username, u.user_rank FROM " . BB_BT_DLSTATUS . " d, " . BB_USERS . " u WHERE d.topic_id = $topic_id AND d.user_id = u.user_id AND d.user_status != " . DL_STATUS_RELEASER . " - ORDER BY d.user_status /* ASC, d.last_modified_dlstatus DESC */ + ORDER BY d.user_status ASC, d.last_modified_dlstatus DESC LIMIT $dl_list_sql_limit"; } @@ -72,7 +72,7 @@ if ($show_dl_list) { $dl_count[$u['user_status']] = $u['username']; } else { $u_prof_href = ($u['user_id'] == GUEST_UID) ? '#' : PROFILE_URL . $u['user_id'] . "#torrent"; - $dl_cat[$u['user_status']] .= '' . profile_url(['username' => $u['username'], 'user_rank' => $u['user_rank']]) . ', '; + $dl_cat[$u['user_status']] .= '' . profile_url(['username' => $u['username'], 'user_rank' => $u['user_rank']]) . ', '; $dl_count[$u['user_status']]++; } }