Sorry I havn't got the time or the patience to realy understand the code..
But one thing disturbe my mind..
PHP Code:
...
for($i=0;$i<count($file_array);$i++)
{
....
if ($pos === false) //if it does not match, do nothing
{
}
else //if it does match, add image to currentgallery array
{
$currentgallery[$i] = $mystring;
}
}
Now my logic tells me, the $i is counting in the orriginal file array, but if you were to find one that dosn't match, then $i will point to the following position than intended in your $currentgalery[] on the next run through.
This will create an array with alot of holes in it..