?/bans: fix pagination - can now see all bans on all boards if > $config[mod][banlist_page]

Conflicts:
	inc/bans.php
This commit is contained in:
8chan 2014-09-13 16:37:33 +00:00 committed by Fredrick Brennan
parent 39cecea579
commit 66e026b361

View File

@ -165,8 +165,14 @@ class Bans {
return $bans; return $bans;
} }
static public function count() { static public function count($board = false) {
$query = query("SELECT COUNT(*) FROM ``bans``") or error(db_error()); if (!$board) {
$query = prepare("SELECT COUNT(*) FROM ``bans``");
} else {
$query = prepare("SELECT COUNT(*) FROM ``bans`` WHERE `board` = :board");
}
$query->bindValue(':board', $board);
$query->execute() or error(db_error());
return (int)$query->fetchColumn(); return (int)$query->fetchColumn();
} }