I'm trying to put in the array reverse now, but its not working, maybe you could help, here is the code i'm using:
I put the array_reverse down near the bottom, this is the error i'm getting:
Warning: array_reverse(): The argument should be an array in /home/dhill/public_html/ysd/galleries/westcoast/index.php on line 214
//set variables when undefined
if ($columns == "") $columns = 6; //How many images displayed per line
if ($rows == "") $rows = 1; //How many row are display per page
//find this number, and use it below
$imagenumber = $columns * $rows; //how many images per page
//set directory depending on state
if ($res == ""){
if ($resolution == "Low Res" or $resolution == ""){
$imagedir = $lowimages;
$res = 0;
}
else{
$imagedir = $fullimages;
$res = 1;
}
}
else {
if ($res == 0) $imagedir = $lowimages;
if ($res == 1) $imagedir = $fullimages;
}
//determine page state
if ($page == "") $page = "1";
$begin = ($page * $imagenumber) - $imagenumber;
$end = ($page * $imagenumber) - 1;
//get files
$j=0; //just initializing
$handle=opendir($imagedir); //open image folder
while (false!==($file = readdir($handle))) {
if ($file != "." && $file != "..") {
//echo "$file";
$imageArray[$j]=$file;
$j++;
}
}
closedir($handle);
//find out the how many images there are
$numimages = sizeof($imageArray);
//begin writing table
if ($show != "") //display image if chosen
$i=0; //nothing to see, just initializing
for ($x=$begin; $x <= $end; $x++){
//begin writing images
echo "";
if ($imageArray[$x] != ""){ //make sure we don't include images that aren't there
$img_result = array_reverse($imageArray[$x]);
print "<a href=index.php?page=$page&columns=$columns&rows=$rows&res=$res&show=$img_result><img src=$thumbdir/img_result border=0></a> ";
}
echo "";
//write end column when needed
++$i;
if($i == $columns) { print "";
$i = 0;
}
}
$pages = ceil($numimages / $imagenumber);
if ($pages != 1){
echo("<br><br>Page: ");
for ($d=1; $d<=$pages; $d++){
echo "<a href=\"index.php?page=$d&columns=$columns&rows=$rows&res=$res\">$d</a> ";
}
}
if ($show != "") {echo "<br><br><img src=$imagedir/$show><br><br>";}