diff --git a/ext/random_list/main.php b/ext/random_list/main.php index 267c971a..46c49801 100644 --- a/ext/random_list/main.php +++ b/ext/random_list/main.php @@ -44,8 +44,11 @@ class RandomList extends Extension { $random_images = array(); // generate random images - for ($i = 0; $i < $images_per_page; $i++) - array_push($random_images, Image::by_random($search_terms)); + for ($i = 0; $i < $images_per_page; $i++) { + $random_image = Image::by_random($search_terms); + if (!$random_image) continue; + array_push($random_images, $random_image); + } $this->theme->set_page($search_terms); $this->theme->display_page($page, $random_images); diff --git a/ext/random_list/theme.php b/ext/random_list/theme.php index c092b086..dd0f1d25 100644 --- a/ext/random_list/theme.php +++ b/ext/random_list/theme.php @@ -17,13 +17,18 @@ class RandomListTheme extends Themelet { public function display_page(Page $page, $images) { $page->title = "Random Images"; - $html = "Refresh the page to view more images -