I've done!
With this hack when a user create a new album and upload a zip all the images of the zip will be renamed in this way:
{folder_name}-{xxx}.{extension}
where xxx is a progressive number (i.e. 001, 002,etc)
Then if i create a new album called "My new album" the images will be renamed as:
my-new-album-001.jpg
my-new-album-002.jpg
my-new-album-003.jpg
my-new-album-004.jpg
and so on.
If anyone is interested:
in zen/functions.php find
---
// Use Zlib
require_once('pclzip.lib.php');
$zip = new PclZip($file);
if ($zip->extract(PCLZIP_OPT_PATH, $dir, PCLZIP_OPT_REMOVE_ALL_PATH) == 0) {
die("Error : ".$zip->errorInfo(true));
}
---
After add:
---
// Begin batch-renaming hack
$batch_name = $_POST['folder'];
$ls = glob($dir."/*");
$n = 1;
foreach ($ls as $image_tmp_name) {
$nn = str_pad($n,3,'0',STR_PAD_LEFT);
$file_temp1 = explode($dir,$image_tmp_name);
$file_temp2 = explode('.',$file_temp1[1]);
$file_ext = $file_temp2[1];
rename($image_tmp_name, $dir.'/'.$batch_name.'-'.$nn.'.'.$file_ext);
$n++;
}
// End batch-renaming hack
---