diff --git a/ext/random_list/main.php b/ext/random_list/main.php index 7f710356..7abdac11 100644 --- a/ext/random_list/main.php +++ b/ext/random_list/main.php @@ -10,66 +10,41 @@ class RandomList extends Extension { public function onPageRequest(PageRequestEvent $event) { - global $page; + global $config, $page; + + if($event->page_matches("random")) { + // set vars + $images_per_page = $config->get_int("index_images") / 2; + $random_images = array(); + $random_html = "Refresh the page to view more images +
";
- }
-
- return $random_html;
- }
-
- /**
- * Pick certain amount of random images random image out of a set
- *
- * @retval Image
- */
- private function by_random($tags=array(), $amount=1) {
- assert(is_array($tags));
- $max = Image::count_images($tags);
- if ($max < 1) return null; // From Issue #22 - opened by HungryFeline on May 30, 2011.
- $rand = mt_rand(0, $max-1);
- $set = Image::find_images($rand, $amount, $tags);
- if(count($set) > 0)
- {
- if ($amount == 1) return $set[0]; // return as single image
- else if ($amount > 1) return $set; // return as array
- else return null;
- }
- else return null;
}
}
?>