1
0
mirror of https://github.com/vichan-devel/vichan.git synced 2024-11-23 23:20:57 +01:00

?/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;
}
static public function count() {
$query = query("SELECT COUNT(*) FROM ``bans``") or error(db_error());
static public function count($board = false) {
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();
}