Moved announcer url autofill into cron (#1364)

* Moved announcer autofill into cron

* Update CHANGELOG.md
This commit is contained in:
Roman Kelesidis 2024-02-01 00:13:48 +07:00 committed by GitHub
commit 0317664383
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 10 additions and 9 deletions

View file

@ -18,6 +18,7 @@
- Added `bt_announce_url` autofill [\#1331](https://github.com/torrentpier/torrentpier/pull/1331) ([belomaxorka](https://github.com/belomaxorka))
- Added "Random release" button in tracker.php [\#1334](https://github.com/torrentpier/torrentpier/pull/1334) ([belomaxorka](https://github.com/belomaxorka))
- Added support for fastly cdn [\#1327](https://github.com/torrentpier/torrentpier/pull/1327) ([belomaxorka](https://github.com/belomaxorka), [kovalensky](https://github.com/kovalensky))
- Moved announcer url autofill into cron [\#1364](https://github.com/torrentpier/torrentpier/pull/1364) ([belomaxorka](https://github.com/belomaxorka))
- Use `target="_blank"` in admin for profile_url() redirects [\#1330](https://github.com/torrentpier/torrentpier/pull/1330) ([belomaxorka](https://github.com/belomaxorka))
- Used declensions for days in some cases [\#1310](https://github.com/torrentpier/torrentpier/pull/1310) ([belomaxorka](https://github.com/belomaxorka))
- Used `modern-normalize` instead of outdated `nornalize-css` [\#1363](https://github.com/torrentpier/torrentpier/pull/1363) ([belomaxorka](https://github.com/belomaxorka))

View file

@ -11,12 +11,12 @@ if (!defined('BB_ROOT')) {
die(basename(__FILE__));
}
// Синхронизация
// Synchronization
\TorrentPier\Legacy\Admin\Common::sync('topic', 'all');
\TorrentPier\Legacy\Admin\Common::sync('user_posts', 'all');
\TorrentPier\Legacy\Admin\Common::sync_all_forums();
// Чистка bb_poll_users
// Cleaning bb_poll_users
if ($poll_max_days = (int)$bb_cfg['poll_max_days']) {
$per_cycle = 20000;
$row = DB()->fetch_row("SELECT MIN(topic_id) AS start_id, MAX(topic_id) AS finish_id FROM " . BB_POLL_USERS);
@ -41,10 +41,15 @@ if ($poll_max_days = (int)$bb_cfg['poll_max_days']) {
}
}
// Чистка user_newpasswd
// Cleaning user_newpasswd
DB()->query("UPDATE " . BB_USERS . " SET user_newpasswd = '' WHERE user_lastvisit < " . (TIMENOW - 7 * 86400));
// Чистка кеша постов
// Cleaning post cache
if ($posts_days = (int)$bb_cfg['posts_cache_days_keep']) {
DB()->query("DELETE FROM " . BB_POSTS_HTML . " WHERE post_html_time < DATE_SUB(NOW(), INTERVAL $posts_days DAY)");
}
// Autofill announcer url
if (empty($bb_cfg['bt_announce_url'])) {
bb_update_config(['bt_announce_url' => FULL_URL . 'bt/announce.php']);
}

View file

@ -394,11 +394,6 @@ $user = new TorrentPier\Legacy\Common\User();
$userdata =& $user->data;
// Set announcer default URL
if (empty($bb_cfg['bt_announce_url'])) {
bb_update_config(['bt_announce_url' => FULL_URL . 'bt/announce.php']);
}
/**
* Cron
*/