Album sort order Album sort order
 

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

Album sort order

Started by scripto, June 26, 2007, 10:10:48 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

scripto

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

Nibbler

Use a.aid DESC instead of a.title

youth4j

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

youth4j

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

Nibbler


kmr

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

youth4j

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

Nibbler

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.

youth4j

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


Nibbler

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

youth4j

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.