I'm migrating from another gallery script where I created my own public image upload form. To prevent images with duplicate names from being uploaded, the upload script automatically added "date_" to the filename when saving it.
So I have 600 images named like this: 1160345185-IMG_1439.jpg
I want to keep the image names the way they are, and to keep using my upload form so the pubic (private website) can continue uploading images.
However, I want zenphoto to exclude the "date_" from the filename when displaying it.
I'm trying to implement this script in there to remove only read what's after the underscore:
`$imgname = substr(strrchr('$actualfilename', "_"), 1); echo $imgname;`
( http://www.php.net/strrchr )
When implementing this, it would be great to not have to replace every "`<?php echo getImageTitle();?>`" in all the zenphoto files...
In order to accomplish that, it appears I need to use this with the getImageTitle() function on line 430 of template-functions.php, but I'm not sure exactly how it should be used.
Actual code before changes:
`
function getImageTitle() {
if(!in_context(ZP_IMAGE)) return false;
global $_zp_current_image;
return $_zp_current_image->getTitle();
}
`
Here's my guess. Code with my changes:
`
function getImageTitle() {
if(!in_context(ZP_IMAGE)) return false;
global $_zp_current_image;
$new-filename = substr(strrchr('$_zp_current_image, "_"), 1);
return $new-filename->getTitle();
}
`
(< average PHP knowledge, so...)
Thanks in advance for your help!
... and super thanks to zenphoto for the only decent, not-bloated gallery software!