mirror of
https://github.com/vichan-devel/vichan.git
synced 2024-11-25 07:50:23 +01:00
Move bans.html theme over to cron
This commit is contained in:
parent
de31d6fca8
commit
04afbe904d
10
inc/bans.php
10
inc/bans.php
@ -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();
|
||||
}
|
||||
|
@ -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';
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user