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: Album sort order  (Read 4939 times)

0 Members and 1 Guest are viewing this topic.

scripto

  • Coppermine newbie
  • Offline Offline
  • Posts: 1
Album sort order
« on: June 26, 2007, 10:10:48 pm »

I am looking for a way to set the last upload/created album first, I’m not using categories or user galleries. Just one main gallery that I admin where I upload/create all my albums but as I do this the most recent uploaded/created album shows up on the bottom instead of the top, can this be fixed/reversed order for the album display instead of manually moving the albums up in the album manager? Please advise I’ve tried the lastalb breadcrumb but that’s not what I am looking for and I've viewed: http://forum.coppermine-gallery.net/index.php?topic=29809.msg137973#msg137973, but it showed how to do it alphabetically. Please advise or direct me to the appropriate thread if this has already been answered. Thank You
« Last Edit: September 21, 2007, 06:59:29 am by GauGau »
Logged

Nibbler

  • Guest
Re: Album sort order
« Reply #1 on: June 26, 2007, 10:46:19 pm »

Use a.aid DESC instead of a.title
Logged

youth4j

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 48
Re: Album sort order
« Reply #2 on: July 28, 2007, 04:50:25 pm »

How come it only works for new galleries that are created after the change in code? Is there a way to change so that all the albums inside categories automatically become sorted? I would want to do something so that all the albums inside the categories get sorted the latest gallery to show up on the first page and the oldest galleries show up on the last page.

I made the change above, then went into the admin album sort section of gallery and manually edited the sort order of about 100 old galleries. Then about 6 months later I upgraded the CPG to a newer version and all the sorted albums went back to the original sort order (oldest galleries on first page and newsest galleries on the last page).

So what can I do so I don't have to sort houndreds of albums after each upgrade. Is there someting I can do maybe at MySQL database or something?

Thank you
Logged

youth4j

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 48
Re: Album sort order
« Reply #3 on: September 18, 2007, 12:28:16 am »

Ok, I upgraded the CPG to a new version. All of my album sort order went back to the original. (Oldest first) What can I do to set my sort order back to the way I had it before I upgraded? I have the backup of the database and the backup of the files before the update. I simply can\'t reorganize 300 galleries every time I upgrade.

Please help me asap.
Thanks
Logged

Nibbler

  • Guest
Re: Album sort order
« Reply #4 on: September 18, 2007, 12:33:13 am »

Just reapply the code.
Logged

kmr

  • Coppermine newbie
  • Offline Offline
  • Posts: 1
Re: Album sort order
« Reply #5 on: September 18, 2007, 04:11:17 pm »

Which file should i modificate to see my private photo albums in the following order: from the old ones to the newest ones.
Now only the newest album is being seen on the first page, i would like to change it, that first comes the newest album and then under it, the older ones, but that everything can be seen on the first page.
i hope i would be well understood
Regards
Logged

youth4j

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 48
Re: Album sort order
« Reply #6 on: September 19, 2007, 08:43:35 pm »

The problem is that, if I apply the code it only starts working to the new galleries that I create after I apply the code. I want all the albums to get sorted. Newest first not just the new albums.

This means that I have to go and manually align (sort) 535 albums in 25 categories with the album manager. When I upgrade again I would have to do this again? There must be another way for sorting the albums that I already have not just the new ones that I will create.

Please help me. This means a lot to me.

Thanks
Logged

Nibbler

  • Guest
Re: Album sort order
« Reply #7 on: September 19, 2007, 08:59:54 pm »

The code change takes effect immediately and applies to all albums regardless of whether they existed before or not. If this does not happen you are doing it wrong.
Logged

youth4j

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 48
Re: Album sort order
« Reply #8 on: September 20, 2007, 05:44:23 am »

I did what you recomended and it doesn\'t work. I tried creating a new album and it showd up on the last page.

This is what I did.

In index.php i found:

$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.pos \' . $limit;


and changed the \' ORDER BY a.pos \' to \' ORDER BY a.aid \'

Is this what I was suppose to do?

I refreshed my gallery page. and went to a category, The oldest created albums are on the 1st page and the newest ones are on the 10th page. It should be the other way around. The newest ones on the 1st page and the oldest on the last page.

Please help me, this is very importent to me. Thanks

Logged

Nibbler

  • Guest
Re: Album sort order
« Reply #9 on: September 20, 2007, 09:52:49 am »

Right, because you are using ascending order. Use descending order (ORDER BY a.aid DESC) as I posted.
Logged

youth4j

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 48
Re: Album sort order
« Reply #10 on: September 21, 2007, 02:35:45 am »

Thank you so much. I worked. I no longer have to re-organize all the albums when I add new galleries and old galleries when I upgrade.

Thank you so much.

I can tell you one thing. I see that the tech support for CPG improved a lot lately. Good job. Nibbler RULES!!!!
God Bless you.
Logged
Pages: [1]   Go Up
 

Page created in 0.019 seconds with 19 queries.