PageRenderTime 485ms CodeModel.GetById 216ms app.highlight 2ms RepoModel.GetById 136ms app.codeStats 0ms

/modules/mod_random_image/mod_random_image.php

https://github.com/joebushi/joomla
PHP | 27 lines | 12 code | 6 blank | 9 comment | 1 complexity | 72fc38bf433a7f2f1e067bde652d0543 MD5 | raw file
 1<?php
 2/**
 3 * @version		$Id$
 4 * @package		Joomla.Site
 5 * @subpackage	mod_random_image
 6 * @copyright	Copyright (C) 2005 - 2010 Open Source Matters, Inc. All rights reserved.
 7 * @license		GNU General Public License version 2 or later; see LICENSE.txt
 8 */
 9
10// no direct access
11defined('_JEXEC') or die;
12
13// Include the syndicate functions only once
14require_once dirname(__FILE__).DS.'helper.php';
15
16$link 	 = $params->get('link');
17
18$folder	= modRandomImageHelper::getFolder($params);
19$images	= modRandomImageHelper::getImages($params, $folder);
20
21if (!count($images)) {
22	echo JText::_('No images ');
23	return;
24}
25
26$image = modRandomImageHelper::getRandomImage($params, $images);
27require JModuleHelper::getLayoutPath('mod_random_image', $params->get('layout', 'default'));