mirror of
https://github.com/torrentpier/torrentpier
synced 2025-08-21 13:54:02 -07:00
Split functions to the composer autoloading
Signed-off-by: Yuriy Pikhtarev <iglix@me.com>
This commit is contained in:
parent
6aae72b836
commit
83ca67fae6
75 changed files with 3612 additions and 3184 deletions
|
@ -11,12 +11,10 @@ if (!defined('BB_ROOT')) {
|
|||
die(basename(__FILE__));
|
||||
}
|
||||
|
||||
require_once INC_DIR . '/functions_admin.php';
|
||||
|
||||
// Синхронизация
|
||||
sync('topic', 'all');
|
||||
sync('user_posts', 'all');
|
||||
sync_all_forums();
|
||||
\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
|
||||
if ($poll_max_days = (int)$bb_cfg['poll_max_days']) {
|
||||
|
|
|
@ -11,12 +11,10 @@ if (!defined('BB_ROOT')) {
|
|||
die(basename(__FILE__));
|
||||
}
|
||||
|
||||
require_once INC_DIR . '/functions_admin.php';
|
||||
|
||||
if ($bb_cfg['prune_enable']) {
|
||||
$sql = "SELECT forum_id, prune_days FROM " . BB_FORUMS . " WHERE prune_days != 0";
|
||||
|
||||
foreach (DB()->fetch_rowset($sql) as $row) {
|
||||
topic_delete('prune', $row['forum_id'], (TIMENOW - 86400 * $row['prune_days']));
|
||||
\TorrentPier\Legacy\Admin\Common::topic_delete('prune', $row['forum_id'], (TIMENOW - 86400 * $row['prune_days']));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -11,8 +11,6 @@ if (!defined('BB_ROOT')) {
|
|||
die(basename(__FILE__));
|
||||
}
|
||||
|
||||
require_once INC_DIR . '/functions_admin.php';
|
||||
|
||||
$users_per_cycle = 1000;
|
||||
|
||||
while (true) {
|
||||
|
@ -48,7 +46,7 @@ while (true) {
|
|||
}
|
||||
|
||||
if ($prune_users = $not_activated_users + $not_active_users) {
|
||||
user_delete($prune_users);
|
||||
\TorrentPier\Legacy\Admin\Common::user_delete($prune_users);
|
||||
}
|
||||
|
||||
if (count($prune_users) < $users_per_cycle) {
|
||||
|
|
|
@ -13,25 +13,23 @@ if (!defined('BB_ROOT')) {
|
|||
|
||||
global $bb_cfg;
|
||||
|
||||
require_once INC_DIR . '/functions_atom.php';
|
||||
|
||||
$timecheck = TIMENOW - 600;
|
||||
$forums_data = DB()->fetch_rowset("SELECT forum_id, allow_reg_tracker, forum_name FROM " . BB_FORUMS);
|
||||
|
||||
if (file_exists($bb_cfg['atom']['path'] . '/f/0.atom')) {
|
||||
if (filemtime($bb_cfg['atom']['path'] . '/f/0.atom') <= $timecheck) {
|
||||
update_forum_feed(0, $forums_data);
|
||||
\TorrentPier\Legacy\Atom::update_forum_feed(0, $forums_data);
|
||||
}
|
||||
} else {
|
||||
update_forum_feed(0, $forums_data);
|
||||
\TorrentPier\Legacy\Atom::update_forum_feed(0, $forums_data);
|
||||
}
|
||||
|
||||
foreach ($forums_data as $forum_data) {
|
||||
if (file_exists($bb_cfg['atom']['path'] . '/f/' . $forum_data['forum_id'] . '.atom')) {
|
||||
if (filemtime($bb_cfg['atom']['path'] . '/f/' . $forum_data['forum_id'] . '.atom') <= $timecheck) {
|
||||
update_forum_feed($forum_data['forum_id'], $forum_data);
|
||||
\TorrentPier\Legacy\Atom::update_forum_feed($forum_data['forum_id'], $forum_data);
|
||||
}
|
||||
} else {
|
||||
update_forum_feed($forum_data['forum_id'], $forum_data);
|
||||
\TorrentPier\Legacy\Atom::update_forum_feed($forum_data['forum_id'], $forum_data);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue