This commit is contained in:
Roman Kelesidis 2024-02-03 11:51:50 +07:00
commit 360c4cf305
4 changed files with 7 additions and 7 deletions

View file

@ -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`)
)

View file

@ -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)
";
}
}

View file

@ -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
");

View file

@ -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']] .= '<nobr><a class="' . $u_link_class . '" href="' . $u_prof_href . '" title="' . $u['last_modified_dlstatus'] . '">' . profile_url(['username' => $u['username'], 'user_rank' => $u['user_rank']]) . '</a></nobr>, ';
$dl_cat[$u['user_status']] .= '<nobr><a class="' . $u_link_class . '" href="' . $u_prof_href . '" title="' . bb_date($u['last_modified_dlstatus'], $title_date_format) . '">' . profile_url(['username' => $u['username'], 'user_rank' => $u['user_rank']]) . '</a></nobr>, ';
$dl_count[$u['user_status']]++;
}
}