WebsiteBaker 2.13.9 is now available!
R.I.P Dietmar (luisehahne) and thank you for all your valuable work for WBhttps://forum.websitebaker.org/index.php/topic,32355.0.html
$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)))){$name=substr($image,0,-4);if($link=="y"){$images=$images.'<a rel="gallery" class="fancybox" 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.' border=0"/>';}else{$images=$images.' <img src="'.WB_URL.MEDIA_DIRECTORY.'/'.$dir.'/'.$image.'" alt="'.$name.'" '.$width.$height.' ">';}if($link=="y"){$images=$images.'</a>';}$count++;}return $images;