Browse Source

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

Conflicts:
	inc/bans.php
pull/40/head
8chan 10 years ago
committed by Fredrick Brennan
parent
commit
66e026b361
  1. 10
      inc/bans.php

10
inc/bans.php

@ -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();
}

Loading…
Cancel
Save