1
0
mirror of https://github.com/vichan-devel/vichan.git synced 2024-11-25 16:00:22 +01:00

Move bans.html theme over to cron

This commit is contained in:
8chan 2014-12-31 22:31:43 -08:00
parent de31d6fca8
commit 04afbe904d
2 changed files with 11 additions and 4 deletions

View File

@ -236,13 +236,15 @@ class Bans {
}
static public function seen($ban_id) {
global $config;
$query = query("UPDATE ``bans`` SET `seen` = 1 WHERE `id` = " . (int)$ban_id) or error(db_error());
rebuildThemes('bans');
if (!$config['cron_bans']) rebuildThemes('bans');
}
static public function purge() {
global $config;
$query = query("DELETE FROM ``bans`` WHERE `expires` IS NOT NULL AND `expires` < " . time() . " AND `seen` = 1") or error(db_error());
rebuildThemes('bans');
if (!$config['cron_bans']) rebuildThemes('bans');
}
static public function delete($ban_id, $modlog = false, $boards = false, $dont_rebuild = false) {
@ -268,7 +270,7 @@ class Bans {
query("DELETE FROM ``bans`` WHERE `id` = " . (int)$ban_id) or error(db_error());
if (!$dont_rebuild) rebuildThemes('bans');
if (!$dont_rebuild || !$config['cron_bans']) rebuildThemes('bans');
return true;
}
@ -350,7 +352,7 @@ class Bans {
' with ' . ($reason ? 'reason: ' . utf8tohtml($reason) . '' : 'no reason'));
}
rebuildThemes('bans');
if (!$config['cron_bans']) rebuildThemes('bans');
return $pdo->lastInsertId();
}

View File

@ -202,6 +202,11 @@ $config['hash_masked_ip'] = true;
$config['force_subject_op'] = false;
$config['min_links'] = 0;
$config['min_body'] = 0;
$config['early_404'] = false;
$config['early_404_page'] = 5;
$config['early_404_replies'] = 10;
$config['cron_bans'] = true;
$config['mask_db_error'] = true;
// 8chan specific mod pages
require '8chan-mod-pages.php';