paginated image bans

This commit is contained in:
Shish
2010-01-05 17:31:25 +00:00
parent 18c0fa7df8
commit cbfab3ba5d
2 changed files with 7 additions and 4 deletions

View File

@ -81,7 +81,9 @@ class ImageBan implements Extension {
if($event->count_args() == 2) {
$page_num = int_escape($event->get_arg(1));
}
$this->theme->display_Image_hash_Bans($page, $page_num, $this->get_image_hash_bans($page_num));
$page_size = 100;
$page_count = ceil($database->db->getone("SELECT COUNT(id) FROM image_bans")/$page_size);
$this->theme->display_Image_hash_Bans($page, $page_num, $page_count, $this->get_image_hash_bans($page_num, $page_size));
}
}
}
@ -121,7 +123,7 @@ class ImageBan implements Extension {
// DB funness
public function get_image_hash_bans($page, $size=1000) {
public function get_image_hash_bans($page, $size=100) {
// FIXME: many
$size_i = int_escape($size);
$offset_i = int_escape($page-1)*$size_i;