[Solved]: Post migration having issues with album sort order [Solved]: Post migration having issues with album sort order
 

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

[Solved]: Post migration having issues with album sort order

Started by darrenkemp, October 12, 2009, 10:54:32 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

darrenkemp

I have recently done a large migration from an emAlbum installation to a new coppermine installation.
I scripted the migration and input all the album and image information via mysql scripts. The one issue I am still having is how coppermine sorts the albums under each category. This does not seem configurable in the settings. I want the albums sorted in the order they went in (by album id), or, if that's not possible, if someone could tell me how i could finagle the mysql script to sort these albums how I want too (in the order i put them in). Is this possible using the "pos" element in the mysql table cpg14x_albums? I did search but did not find a good breakdown of each of the elements in thids table. How does coppermine by default sort these albums in each category? Any help getting me pointed in the right direction would be greatly appreciated.

Thanks

Darren Kemp

phill104

It is a mistake to think you can solve any major problems just with potatoes.

darrenkemp

I know how to sort albums via the interface, but I need a way to do this in a program as there are thousands of albums in some of these categories. How is the "pos" element used in album sorting? Also the thumbnail chosen for each album seems to be random. Is there a way to set the initial thumbnail position for each element as well? Again I need to do this with a script not via the GUI interface.

Thanks again

Darren


darrenkemp

Unfortunately this is not a publicly accessible site or I would have posted a link.

Really I only need to know one thing:

How can I force coppermine to sort the albums by album id descending so it shows newest albums first (on page 1 rather then the last page of the album), and in each album just sorts the pictures by filename. Is this a picmgr.php mod?

Thanks for your time

Darren

darrenkemp

#5
Figured the sort order out, this is the mod to index.php to force it to reverse sort albums by aid.

   $sql = 'SELECT a.aid, a.title, a.description, category, visibility, filepath, ' . 'filename, url_prefix, pwidth, pheight ' . 'FROM ' . $CONFIG['TABLE_ALBUMS'] . ' as a ' . 'LEFT JOIN ' . $CONFIG['TABLE_PICTURES'] . ' as p ' . 'ON a.thumb=p.pid ' . 'WHERE category=' . $cat . $album_filter . ' ORDER BY a.aid DESC ' . $limit;