PageRenderTime 42ms CodeModel.GetById 18ms RepoModel.GetById 0ms 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
Possible License(s): LGPL-2.1, Apache-2.0
  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. // no direct access
  10. defined('_JEXEC') or die;
  11. // Include the syndicate functions only once
  12. require_once dirname(__FILE__).DS.'helper.php';
  13. $link = $params->get('link');
  14. $folder = modRandomImageHelper::getFolder($params);
  15. $images = modRandomImageHelper::getImages($params, $folder);
  16. if (!count($images)) {
  17. echo JText::_('No images ');
  18. return;
  19. }
  20. $image = modRandomImageHelper::getRandomImage($params, $images);
  21. require JModuleHelper::getLayoutPath('mod_random_image', $params->get('layout', 'default'));