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() {
|
public function get_page_size() {
|
||||||
global $config;
|
global $config;
|
||||||
$count = $config->get_int('index_width') * $config->get_int('index_height');
|
return $config->get_int('index_images');
|
||||||
return $count;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -176,8 +176,7 @@ class Image {
|
|||||||
public static function count_pages($tags=array()) {
|
public static function count_pages($tags=array()) {
|
||||||
assert(is_array($tags));
|
assert(is_array($tags));
|
||||||
global $config, $database;
|
global $config, $database;
|
||||||
$images_per_page = $config->get_int('index_width') * $config->get_int('index_height');
|
return ceil(Image::count_images($tags) / $config->get_int('index_images'));
|
||||||
return ceil(Image::count_images($tags) / $images_per_page);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -131,8 +131,7 @@ class PostListBuildingEvent extends Event {
|
|||||||
class Index extends Extension {
|
class Index extends Extension {
|
||||||
public function onInitExt(InitExtEvent $event) {
|
public function onInitExt(InitExtEvent $event) {
|
||||||
global $config;
|
global $config;
|
||||||
$config->set_default_int("index_width", 3);
|
$config->set_default_int("index_images", 24);
|
||||||
$config->set_default_int("index_height", 4);
|
|
||||||
$config->set_default_bool("index_tips", true);
|
$config->set_default_bool("index_tips", true);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -186,11 +185,9 @@ class Index extends Extension {
|
|||||||
$sb = new SetupBlock("Index Options");
|
$sb = new SetupBlock("Index Options");
|
||||||
$sb->position = 20;
|
$sb->position = 20;
|
||||||
|
|
||||||
$sb->add_label("Index table size ");
|
$sb->add_label("Show ");
|
||||||
$sb->add_int_option("index_width");
|
$sb->add_int_option("index_images");
|
||||||
$sb->add_label(" x ");
|
$sb->add_label(" images on the post list");
|
||||||
$sb->add_int_option("index_height");
|
|
||||||
$sb->add_label(" images");
|
|
||||||
|
|
||||||
$event->panel->add_block($sb);
|
$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")) {
|
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.
|
//TODO: Add Popular_by_week.
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user