I have some code below, but I cant get the array_splice to limit the number of images shown.
<?php
$id = $_GET['id'];
if (empty($id)) {
$clientname = 'tazz';
} else {
$clientname = $_GET['id'];
}
$total = $_GET['limit'];
if (empty($total)) {
$limit = '100';
} else {
$limit = $_GET['limit'];
}
$basefolder = "client/client-galleries/";
$dirname = $basefolder.$clientname."/";
$images = scandir($dirname);
sort($images);
//shuffle($images);
$ignore = array(".", "..");
$output = array_splice($ignore, 0, $limit);
foreach($images as $curimg) {
if(!in_array($curimg, $output)) {
echo "
<div class='gallery'>
<img src='[[pThumb? &input=`$dirname$curimg` &options=`&w=300&h=300&zc=1&q=95&fltr[]=wmi|./client/images/gallery-watermark-white.png|BL|50|25|200`]]' alt='$curimg'>
<div class='desc'></div>
</div>
";
}
}
This correctly shows the images in the gallery but doesnt limit the amount of images as set by http://website.address?id=client&limit=5