<?php
$path = "assets/gallery/$folder/";
if(!isset($folder)) return; // no folder? quit.
$slides = array();
if ($dh = @opendir($path)) {
while(($file = readdir($dh)) !== false) {
if ( !preg_match('/\.thumb*/',$file) && preg_match('@.png$|.gif$|.jpg$@', $file) && $file != '.' && $file != '..' ) {
$slides[] = $path.$file;
}
}
}
$num = count($slides);
$last = $num-1;
for ( $i=0; $i<=($count-1); $i++) {
echo '<img src="'.$slides[$i].' " alt="" width="'.$width.'" height="'.$height.'"/>';}
?>[!Snippet?&folder=`[*alias*]`&count=`4` &width=`100` &height=`100`!]
<?php
$path = "assets/gallery/$folder/";
$slides = array();
if ($dh = @opendir($path)) {
while(($file = readdir($dh)) !== false) {
if ( !preg_match('/\.thumb*/',$file) && preg_match('@.png$|.gif$|.jpg$@', $file) && $file != '.' && $file != '..' ) {
$slides[] = $path.$file;
}
}
}
if($count >= count($slides)) $count = count($slides);
for($i = 0; $i < $count; $i++){
$rand = rand(0, count($slides)-1);
echo '<img src="'.$slides[$rand].'" width="'.$width.'" height="'.$height.'" />';
}
?><?php
$path = "assets/gallery/$folder/";
$slides = array();
if ($dh = @opendir($path)) {
while(($file = readdir($dh)) !== false) {
if ( !preg_match('/\.thumb*/',$file) && preg_match('@.png$|.gif$|.jpg$@', $file) && $file != '.' && $file != '..' ) {
$slides[] = $path.$file;
}
}
}
if($count >= count($slides)) $count = count($slides);
for($i = 1; $i < $count+1; $i++){
$rand = array_rand($slides);
echo '<img src="'.$slides[$rand].'" width="'.$width.'" height="'.$height.'" />';
}
?><?php
$path = "assets/gallery/$folder/";
$slides = array();
if ($dh = @opendir($path)) {
while(($file = readdir($dh)) !== false) {
if ( !preg_match('/\.thumb*/',$file) && preg_match('@.png$|.gif$|.jpg$@', $file) && $file != '.' && $file != '..' ) {
$slides[] = $path.$file;
}
}
}
if($count >= count($slides)) $count = count($slides);
$rand = array_rand($slides);
foreach ($rand as $v) {
echo '<img src="'.$slides[$v].'" width="'.$width.'" height="'.$height.'" />';
}
?>