width / height were never used individually, now just have images
This commit is contained in:
parent
84cdd21e09
commit
678215e4bd
@ -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');
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -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'));
|
||||
}
|
||||
|
||||
|
||||
|
@ -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);
|
||||
}
|
||||
|
@ -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.
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user