Example #1
0
 function imageList($directory, $sortcriteria, $sortorder)
 {
     $results = array();
     $handler = opendir($directory);
     $i = 0;
     while ($file = readdir($handler)) {
         if ($file != '.' && $file != '..' && modRokSlideshowHelper::isImage($file)) {
             $results[$i][0] = $file;
             $results[$i][1] = filemtime($directory . "/" . $file);
             $i++;
         }
     }
     closedir($handler);
     //these lines sort the contents of the directory by the date
     // Obtain a list of columns
     foreach ($results as $res) {
         if ($sortcriteria == 0) {
             $sortAux[] = $res[0];
         } else {
             $sortAux[] = $res[1];
         }
     }
     if ($sortorder == 0) {
         array_multisort($sortAux, SORT_ASC, $results);
     } elseif ($sortorder == 2) {
         srand((double) microtime() * 1000000);
         shuffle($results);
     } else {
         array_multisort($sortAux, SORT_DESC, $results);
     }
     foreach ($results as $res) {
         $sorted_results[] = $res[0];
     }
     return $sorted_results;
 }
Example #2
0
    ?>
	<div id="slidewrap">
		<div id="slideshow"></div>
		<div id="loadingDiv"></div>
	</div>
	<script type="text/javascript">
		window.RokSlideshowPath = '<?php 
    echo $doc->baseurl;
    ?>
';
		window.addEvent('load', function(){
				var imgs = [];

				<?php 
    foreach ($images as $img) {
        $info = modRokSlideshowHelper::getInfo($imagePath, $img);
        ?>
					imgs.push({
						file: '<?php 
        echo $img;
        ?>
',
						<?php 
        if ($showCaption == 1) {
            ?>
						title: '<?php 
            echo trim($info[0]);
            ?>
',
						desc: '<?php 
            echo trim($info[2]);
Example #3
0
<?php

/**
* @package RokSlideshow
* @copyright Copyright (C) 2007 RocketWerx. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
*/
// no direct access
defined('_JEXEC') or die('Restricted access');
// Include the syndicate functions only once
require_once dirname(__FILE__) . DS . 'helper.php';
$imagePath = modRokSlideshowHelper::cleanDir($params->get('imagePath', 'images/stories/fruit'));
$sortCriteria = $params->get('sortCriteria', 0);
$sortOrder = $params->get('sortOrder', 'asc');
$sortOrderManual = $params->get('sortOrderManual', '');
if (trim($sortOrderManual) != "") {
    $images = explode(",", $sortOrderManual);
} else {
    $images = modRokSlideshowHelper::imageList($imagePath, $sortCriteria, $sortOrder);
}
require JModuleHelper::getLayoutPath('mod_rokslideshow');