Module: ARTFU: Auto rename filename, title, url - automatically on upload
|Posted: Mon, 2012-05-14 18:31|
RELEASE EDIT: The ARTFU Module is now up at the codex page: http://codex.gallery2.org/Gallery3:Modules:ARTFU
So, I was working on a new module to automatically rename the filename, url, and title (selectively of course) when uploaded, however, I find a problem when sending up multiple images at once...
Here is the thought process on this...
1) Enable user to select what to automatically rename (title, url, filename)
2) Give option of rename to:
3) Also allow a prefix and/or suffix * IE: prefix1, prefix2, prefix3, etc... -OR- 1suffix, 2suffix, 3suffix, etc. -OR- pre1suf pre2suf pre3suf...
I've got everything working (via the item_created event), except when uploading multiple images via the 'add photos' option
I'm not sure if there is a way around this or not... any suggestions? [hopefully this is clear enough]
Also, I've coded in renames in the event of duplicates for the increment option (say a user deletes an image later, then on next addition, the incremented count could duplicate a previous uploaded (last) image...) as well (like item->slug in models/item.php)
This is not a pretty method, as then the items show as: item1 - item2 - item3 - item3.1234115 - item4 - item5 etc.
So, with all this being said, I'm not sure if this will work...