torrentpier/library/includes/cron/jobs/prune_topic_moved.php
Roman Kelesidis 3e9f4006c4 Revert "Refactoring: Created constants for datetime values (#1648)"
This reverts commit 6eca29714a87e80b3d2674e97300532765593d8d.
2024-09-27 18:32:23 +07:00

23 lines
636 B
PHP
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<?php
/**
* TorrentPier Bull-powered BitTorrent tracker engine
*
* @copyright Copyright (c) 2005-2024 TorrentPier (https://torrentpier.com)
* @link https://github.com/torrentpier/torrentpier for the canonical source repository
* @license https://github.com/torrentpier/torrentpier/blob/master/LICENSE MIT License
*/
if (!defined('BB_ROOT')) {
die(basename(__FILE__));
}
if ($bb_cfg['topic_moved_days_keep']) {
$prune_time = TIMENOW - 86400 * $bb_cfg['topic_moved_days_keep'];
DB()->query("
DELETE FROM " . BB_TOPICS . "
WHERE topic_status = " . TOPIC_MOVED . "
AND topic_time < $prune_time
");
}