Explain subdirectory names within userpics Explain subdirectory names within userpics
 

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Main Menu

Explain subdirectory names within userpics

Started by dustyb, June 26, 2004, 11:23:47 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

dustyb

Hello,

Sorry for the dumb question here... I have a dozen or so album categories. Each category contains at least one album. My Coppermine installation is integrated with vBulletin, and all vBulletin Registered users and Admins can post pictures to all albums.

My question: Uploads in this configuration appear to be going to the userpics directory. Does that sound right? Can somebody explain how the subdirectories of userpics get named? I can't find any relation between these subdirectories and the album id to which they were uploaded.

Also, related question: I know it has been asked and answered many times.... do not batch upload from userpics, I know. But I'm looking at the best way to absorb a 300 picture PhotoPost gallery into my existing Coppermine. I certainly could batch upload from an area in /albums, but I was hoping to not have to develop some major script to map out the rest of the PhotoPost fields to Coppermine. Any suggestions?

Dustyb

Joachim Müller

Quote from: dustyb on June 26, 2004, 11:23:47 PMMy question: Uploads in this configuration appear to be going to the userpics directory. Does that sound right? Can somebody explain how the subdirectories of userpics get named? I can't find any relation between these subdirectories and the album id to which they were uploaded.
I don't get your point, please rephrase.

Quote from: dustyb on June 26, 2004, 11:23:47 PMAlso, related question: I know it has been asked and answered many times.... do not batch upload from userpics, I know. But I'm looking at the best way to absorb a 300 picture PhotoPost gallery into my existing Coppermine. I certainly could batch upload from an area in /albums, but I was hoping to not have to develop some major script to map out the rest of the PhotoPost fields to Coppermine.
Totally unrelated question imo. Import from PhotPost has nothing to do with batch-uploading to userpics or not. Please do only post one question per thread in the future. There's no converter available for PhotoPost yet afaik.

GauGau

dustyb

Quote from: GauGau on June 27, 2004, 12:41:01 AMI don't get your point, please rephrase..

1. There are no personal User Galleries on my site, that feature has been disabled, yet all uploads to the regular gallieries go to userpics. I was just verifying this behavior was correct and that I hadn't misconfigured my regular galleries somehow as User Galleries. The 'userpics' directory name could be suggestive of that.

2. There are subdirectories under userpics containing upoaded photos. How are those subdirectories named by the application? Their names don't seem to correspond in any way to the album id into which the photo was uploaded which would be my first instinct.

Quote from: GauGau on June 27, 2004, 12:41:01 AMTotally unrelated question imo. Import from PhotPost has nothing to do with batch-uploading to userpics or not. Please do only post one question per thread in the future. There's no converter available for PhotoPost yet afaik.

Sorry. I was alluding to the possibility that I might attempt a PhotoPost conversion script which would append records directly into the Coppermine mysql tables as well as moving the image and thumb. In other words I'd skip the batch-upload because I'd be writing the image data, file, filepath, dimesnions, title, captions, views, etc all automatically with a conversion/mapping script. The field filepath in the pictures table obviously describes the path to the image... and in my installation (as per above) that path is /userpics/some_subdirectory_name.

So again, just wondering how the userpics subdirectories got their names and whether there was logic I'd need to write into my script which related the /userpics/subdirectory name to the album id (aid).

Joachim Müller

The folder "userpics" is the place where all http uploads go to - it is named userpics for historical reasons, nothing to worry. In fact coppermine creates a sub folder within userpics for each user who uploads pics - the only relation to the albums they actually appear in is the mySQL database that keeps track of the relation "path info" - "category/album". Once the pics are uploaded, coppermine doesn't move them around if you move pics from one album to another. There's no relation between the sub-folder name within userpics and the album id ("aid"). Of course you're encouraged to write a converter (and even post it as a mod), but I have to warn you: others have tried to do so and have failed, it's not an easy task. To avoid double-naming, I'd add the export the PhotoPost files to a folder within the albums directory named "export" or whatever (instead of "userpics/foobar") to avoid double-naming.

GauGau

dustyb

Thanks GauGau. I see now the userpics subdirectory names follow the convention 1xxxxxx, where x is the user id (which in my case comes over from the vBulletin side). I'm not a strong PHP programmer, so I'd probably attempt the conversion/import script in straight Perl and I'm sure it would be a real hack and not post worthy. I'll have to review all the details a little more closely...

Maybe I could trash the PhotoPost thumbs and do a batch load of the PhotoPost pics from /album/exports under my id. Then I suppose I could take note of the pid range of the resulting new Coppermine picture records and establish a mapping between the old PhotoPost pid and the new Coppermine pid. With that, I could loop through with a bunch of update queries on the fields I want to bring over... pretty much title, caption, and keywords. Rebuild the album counts, etc. I dunno, as you say there are obviously other details. But if I'm willing to basically lose any of the old user information, comments, ratings, views, maybe this is do-able. Thanks again.

dustyb

Quote from: GauGau on June 27, 2004, 10:00:47 AMOf course you're encouraged to write a converter (and even post it as a mod), but I have to warn you: others have tried to do so and have failed, it's not an easy task. To avoid double-naming, I'd add the export the PhotoPost files to a folder within the albums directory named "export" or whatever (instead of "userpics/foobar") to avoid double-naming.

Well, I took a quick and dirty approach... did a batch upload of the PhotoPost pics one album at a time. When Coppermine finished inserting them, I joined the PhotoPost pictures table on the Coppermine pictures table on filename, and given that basic structure, I was able to put together a series of mysql update and append queries to bring over the picture fields and comments. I needed a couple extra fields too.

Anyway, worked pretty well, but I'm left with a problem: I assumed the Sort Date +/- function keyed off the ctime field. It appears that is not the case and that the program uses the pid field instead, making the valid assumption that the larger the pid the more recent the addition. Is that correct? It appears that ctime is only used in the picture info hash (the mouseover information). Is that correct?

My problem then stems back to the batch upload where the images were added (pid created) in some order that I can't remember, probably file name. I updated the ctime value from PhotoPost table, but I'm stuck of course with the Coppermine pids which do not correspond to the PhotoPost pids in sequence... thus my Date sort doesn't yield anything resembling a date added sequence.

Is there a mod to Date Sort by ctime rather than pid? How about a mod to specifiy the add order within a batch upload? I read a little about a new date field that could be read out of the .jpg. Do you think I need to wait for that in order to bring some true date sort back to my after-PhotoPost import environment?

Joachim Müller

I must admit I haven't looked into those mechanisms in detail, but maybe you'll want to take a look at the mods board - afaik there are some postings that deal with non-standard sorting.

GauGau