Hi,
I use this droplet for gallery, it randomly shoows list of images:
$folder=opendir(WB_PATH.MEDIA_DIRECTORY.'/'.$dir.'/.');
$names = array();
while ($file = readdir($folder)) {
$ext=strtolower(substr($file,-4));
if ($ext==".jpg"||$ext==".gif"||$ext==".png"){
$names[count($names)] = $file;
}
}
closedir($folder);
reset(shuffle($names));
array_unshift($names," ");
if(isset($width)){$width=' width="'.$width.'"';}else{$width="";}
if(isset($height)){$height=' height="'.$height.'"';}else{$height="";}
$count=1;
while(($image=next($names))and(($count<=$num)or(!isset($num)))){
if( $count ==1){$class=' class="active"';}else{$class='';}
$name=substr($image,0,-4);
if($link=="y"){$images=$images.'<a href="'.WB_URL.MEDIA_DIRECTORY.'/'.$dir.'/'.$image.'" target=_blank>';}
if(file_exists(WB_PATH.MEDIA_DIRECTORY.'/'.$dir.'/thumbs/'.$image.'.thumb.jpg')){
$images=$images.'<img src="'.WB_URL.MEDIA_DIRECTORY.'/'.$dir.'/thumbs/'.$image.'.thumb.jpg" alt="'.$name.'" '.$width.$height.'/>';
}else{
$images=$images.' <li><img src="'.WB_URL.MEDIA_DIRECTORY.'/'.$dir.'/'.$image.'" alt="'.$name.'" '.$width.$height.$class.' /></li>';
}
if($link=="y"){$images=$images.'</a>';}
$count++;
}
return '<div class="YOURCLASS"><ul id="ADDIFANY">'.$images.'</ul></div>';
You can name it RandomGallery or anyway you want, and call it with [[RandomGallery?folder_in_media_fol
der]]
It will generate the list like:
<div class="YOURCLASS">
<ul id="ADDIFANY">
<li><img src="http://www.yoursite.xy/media/subfolder/image2.jpg" alt="image2" class="active" /></li>
<li><img src="http://www.yoursite.xy/media/subfolder/image1.jpg" alt="image1" /></li>
<li><img src="http://www.yoursite.xy/media/subfolder/image3.jpg" alt="image3" /></li>
</ul>
</div>
Every refresh order 1,2,3 will be random (in my case I had 3 images)
Also you can restyle your list with css..