PDA

View Full Version : Copyfolder alphabetical sorting


Hyb
07-12-2007, 09:42 AM
I'm not sure if this is the right section to post it, but this has been bugging me for a long time and I can't find any other mentions of it.

When uploading a bulk of pictures from a directory using the CopyFolder addon they never seem to be inserted in the right alpha order. This is because natcasesort() maintains the key/value associations which are honoured by for().

Simple fix :-

--- pixelpost_1.60/addons/copy_folder.php 2007-04-08 08:20:51.000000000 +0100
+++ pixelpost_1.60_post/addons/copy_folder.php 2007-07-12 10:04:47.745762192 +0100
@@ -51,7 +51,11 @@
closedir($addon_handle);
} // if addon_handle done

- if ($_POST['sort']=='alphabet') natcasesort($files);
+ if ($_POST['sort']=='alphabet')
+ {
+ natcasesort($files);
+ $files = array_values($files);
+ }
else if($_POST['sort']=='exifdate')
{
$files_withdate = copy_folder_array_sort($files_withdate, 'date');