xp publish folder naming convention xp publish folder naming convention
 

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Main Menu

xp publish folder naming convention

Started by mike909, June 30, 2006, 07:33:58 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

mike909

Hi, this shouldn't be too hard... this post (last post of the thread) speaks about naming the folder after the album name during an xp upload.
QuoteIn my own installation I have used $album instead of date("Ymd"); this way each album gets its own dir... But I guess naming by date is more logical   

- David
Well, I made that change, but can't get it to work...the folders just increment by a number. Here is the original code from lines 747if (USER_IS_ADMIN && ($category != (USER_ID + FIRST_USER_CAT))) {
            $filepath = 'wpw-' . date("Ymd");

I tried changing it to this: if (USER_IS_ADMIN && ($category != (USER_ID + FIRST_USER_CAT))) {
            $filepath = 'wpw-' . $album;
as well as a couple other ways of replacing the date with $album but it never worked. Can someone tell me the exact syntax of that sentence?
Thanks.

mike909

This guy has same question...can anyone give me some insight as to how the sentence should be structured? I don't mind testing.

SNo0py

Using $album is not that simple because the album name might contain invalid characters so this opens up a big security hole. Furthermore I'm not sure what happens if there are two albums with the same name - but the same applies for the date... ordering it by just the date is not that good - ideally an unique id should be used for each album.

mike909

I see. Well, it never is that simple. I guess some sort of check would have to be added to make sure there is no duplicate album name. In the meantime though, people like me could just make sure not to create a duplicate album. I don't think I would have a problem with that...and like you said
Quote from: SNo0py on August 16, 2006, 02:04:14 PM
but the same applies for the date...
Wouldn't it just append a number to the folder? I think that's what it does when you upload two different albums on the same day.

Joachim Müller

You (as Coppermine admin) should use FTP-upload plus batch-add anyway. XP Publisher is suppossed to be used by non-admin users in the first place. As you can't be sure that your users will understand any naming scheme that allows them to interfere, the folders created by XP_Publisher are based on date and time to make them unique, without an option for end users to interfere. After all, those are just folder names - the coppermine database keeps track of folder and file names, the human doesn't have to. That's why Coppermine devs are reluctant to change anything about the way XP Publisher currently works. However, you're of course free to come up with your custom solution, and we'd appreciate code contributions as well.

mike909

Batch add does not allways work. While that problem is probably not all that common for other folks, it is for me.
Quote from: GauGau on August 17, 2006, 08:02:11 AM
...you're of course free to come up with your custom solution, and we'd appreciate code contributions as well.
I'm sorry but I don't know anything about programming. All I can offer is to test if someone has any ideas, just let me know. Thank you for your input GauGau.