Advanced search  

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]

Pages: [1]   Go Down

Author Topic: [Solved]: Post migration having issues with album sort order  (Read 2710 times)

0 Members and 1 Guest are viewing this topic.

darrenkemp

  • Coppermine newbie
  • Offline Offline
  • Posts: 8
[Solved]: Post migration having issues with album sort order
« on: October 12, 2009, 10:54:32 pm »

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
« Last Edit: October 13, 2009, 05:50:51 pm by Joachim Müller »
Logged

phill104

  • Administrator
  • Coppermine addict
  • *****
  • Country: gb
  • Offline Offline
  • Gender: Male
  • Posts: 4843
    • Windsurf.me
Re: Post migration having issues with album sort order
« Reply #1 on: October 12, 2009, 11:05:27 pm »

You can set the order of albums in a category simply by moving them up and down in the list.

http://coppermine-gallery.net/demo/cpg14x/docs/index.htm#albmgr_order

The default file order is set here.

http://coppermine-gallery.net/demo/cpg14x/docs/index.htm#admin_thumbnail_view
Logged
It is a mistake to think you can solve any major problems just with potatoes.

darrenkemp

  • Coppermine newbie
  • Offline Offline
  • Posts: 8
Re: Post migration having issues with album sort order
« Reply #2 on: October 12, 2009, 11:24:10 pm »

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
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Logged

darrenkemp

  • Coppermine newbie
  • Offline Offline
  • Posts: 8
Re: Post migration having issues with album sort order
« Reply #4 on: October 13, 2009, 04:22:00 pm »

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
Logged

darrenkemp

  • Coppermine newbie
  • Offline Offline
  • Posts: 8
Re: Post migration having issues with album sort order
« Reply #5 on: October 13, 2009, 04:38:36 pm »

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

Code: [Select]
   $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;
« Last Edit: October 13, 2009, 05:50:40 pm by Joachim Müller »
Logged
Pages: [1]   Go Up
 

Page created in 0.024 seconds with 19 queries.