diff --git a/core/event.class.php b/core/event.class.php index e6511cff..e5b38f20 100644 --- a/core/event.class.php +++ b/core/event.class.php @@ -105,8 +105,7 @@ class PageRequestEvent extends Event { } public function get_page_size() { global $config; - $count = $config->get_int('index_width') * $config->get_int('index_height'); - return $count; + return $config->get_int('index_images'); } } diff --git a/core/imageboard.pack.php b/core/imageboard.pack.php index e562de10..cd356513 100644 --- a/core/imageboard.pack.php +++ b/core/imageboard.pack.php @@ -176,8 +176,7 @@ class Image { public static function count_pages($tags=array()) { assert(is_array($tags)); global $config, $database; - $images_per_page = $config->get_int('index_width') * $config->get_int('index_height'); - return ceil(Image::count_images($tags) / $images_per_page); + return ceil(Image::count_images($tags) / $config->get_int('index_images')); } diff --git a/ext/index/main.php b/ext/index/main.php index a35d0a9d..ce3dbbce 100644 --- a/ext/index/main.php +++ b/ext/index/main.php @@ -131,8 +131,7 @@ class PostListBuildingEvent extends Event { class Index extends Extension { public function onInitExt(InitExtEvent $event) { global $config; - $config->set_default_int("index_width", 3); - $config->set_default_int("index_height", 4); + $config->set_default_int("index_images", 24); $config->set_default_bool("index_tips", true); } @@ -186,11 +185,9 @@ class Index extends Extension { $sb = new SetupBlock("Index Options"); $sb->position = 20; - $sb->add_label("Index table size "); - $sb->add_int_option("index_width"); - $sb->add_label(" x "); - $sb->add_int_option("index_height"); - $sb->add_label(" images"); + $sb->add_label("Show "); + $sb->add_int_option("index_images"); + $sb->add_label(" images on the post list"); $event->panel->add_block($sb); } diff --git a/ext/numeric_score/main.php b/ext/numeric_score/main.php index 9cd0efb6..d8226f8b 100644 --- a/ext/numeric_score/main.php +++ b/ext/numeric_score/main.php @@ -99,7 +99,7 @@ class NumericScore extends Extension { } } if($event->page_matches("popular_by_day") || $event->page_matches("popular_by_month") || $event->page_matches("popular_by_year")) { - $t_images = $config->get_int("index_height") * $config->get_int("index_width"); + $t_images = $config->get_int("index_images"); //TODO: Add Popular_by_week.