diff options
| author | czaks <marcin@6irc.net> | 2013-06-21 16:41:39 -0400 |
|---|---|---|
| committer | czaks <marcin@6irc.net> | 2013-06-21 16:41:39 -0400 |
| commit | 24a520485df30a85a68d02938256c4a8ac7af8e8 (patch) | |
| tree | 8a93e590b715624cfa7e3812a413061fc252c1ab /inc/mod/pages.php | |
| parent | c073967600124568609d10a400039f017ad9dcf8 (diff) | |
| parent | 9b0c31daa68c7ab96bc25e09b70ffea77ba23590 (diff) | |
Merge branch 'master' of https://github.com/savetheinternet/Tinyboard
Conflicts:
templates/page.html
Diffstat (limited to 'inc/mod/pages.php')
| -rw-r--r-- | inc/mod/pages.php | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/inc/mod/pages.php b/inc/mod/pages.php index 116008d5..f8a730d0 100644 --- a/inc/mod/pages.php +++ b/inc/mod/pages.php @@ -92,7 +92,7 @@ function mod_dashboard() { } } - if (!$config['cache']['enabled'] || ($args['unread_pms'] = cache::get('pm_unreadcount_' . $mod['id'])) === false) { + if (!$config['cache']['enabled'] || ($args['unread_pms'] = cache::get('pm_unreadcount_' . $mod['id'])) == false) { $query = prepare('SELECT COUNT(*) FROM `pms` WHERE `to` = :id AND `unread` = 1'); $query->bindValue(':id', $mod['id']); $query->execute() or error(db_error($query)); @@ -651,7 +651,8 @@ function mod_bans($page_no = 1) { if (preg_match('/^ban_(\d+)$/', $name, $match)) $unban[] = $match[1]; } - + if (isset($config['mod']['unban_limit'])){ + if (count($unban) <= $config['mod']['unban_limit'] || $config['mod']['unban_limit'] == -1){ if (!empty($unban)) { query('DELETE FROM `bans` WHERE `id` = ' . implode(' OR `id` = ', $unban)) or error(db_error()); @@ -659,7 +660,21 @@ function mod_bans($page_no = 1) { modLog("Removed ban #{$id}"); } } + } else { + error(sprintf($config['error']['toomanyunban'], $config['mod']['unban_limit'], count($unban) )); + } + + } else { + + if (!empty($unban)) { + query('DELETE FROM `bans` WHERE `id` = ' . implode(' OR `id` = ', $unban)) or error(db_error()); + foreach ($unban as $id) { + modLog("Removed ban #{$id}"); + } + } + + } header('Location: ?/bans', true, $config['redirect_http']); } @@ -1855,6 +1870,7 @@ function mod_theme_configure($theme_name) { 'result' => $result, 'message' => $message, )); + return; } $settings = themeSettings($theme_name); |
