* Link: http://www.drudexsoftware.com
* License: GPLv2
* Description: Allows displaying a page with random images
* Documentation:
*/
class RandomList extends Extension {
public function onPageRequest(PageRequestEvent $event) {
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
";
// generate random images
for ($i = 0; $i < $images_per_page; $i++)
array_push($random_images, Image::by_random());
// create html to display images
foreach ($random_images as $image)
$random_html .= $this->build_random_html($image);
// display it
$random_html .= "