Announcement

#1 2015-03-23 18:43:08

shastss
Member
2015-03-23
4

Sort by Numeric Album Name

Hello/Hi/Greetings,

Is there a way to Sort Sub Albums by Numeric order. Album name, not contents.

Right now it does this:
1-Sub Album Name
10-Sub Album Name
11-Sub Album Nam
2-Sub Album Name
3-Sub Album Name
...

I would like it to do this:
1-Sub Album Name
2-Sub Album Name
3-Sub Album Name
...
10-Sub Album Name
11-Sub Album Name

I want to use something that is consistent for my club even thought Sub Album Name varies, but lets me order by event that occurs throughout a year, where 1-Sub Album Name would be the first event of the year, but I do not want a sort by date or post because my user base is very unsophisticated. Short Album names for iphone viewing. Many reasons.

Thank you

Steve

Piwigo version: 2.7.4
PHP version: 5.4.38 (Show info) [2015-03-23 11:04:12]
MySQL version: 5.5.42-37.1-log [2015-03-23 11:04:12]
Piwigo URL: http://mshbm.com/gallery


Uploaded Images

Offline

 

#2 2015-03-23 18:47:39

mistic100
Former Piwigo Team
Lyon (FR)
2008-09-27
3271

Re: Sort by Numeric Album Name

Hi

the same limitation applies to photos sorted by numeric order: the order by done by MySQL is "technical" and not "natural"

you must add leading zero to albums 1 to 9 (and 1 to 99 if you have more than 100 albums, and so on)

Offline

 

#3 2015-03-23 19:08:53

shastss
Member
2015-03-23
4

Re: Sort by Numeric Album Name

Sure enough just adding the leading 0 did the trick. Thank you for the quick response.

I had tried the code that handled the photos but have since removed it from the local config and it appears unnecessary.

$conf['order_by'] = ' ORDER BY LENGTH(file), file ASC';
$conf['order_by_inside_category'] = $conf['order_by'];

Thank you again for the quick response.

Steve


Uploaded Images

Offline

 

Board footer

Powered by FluxBB

github twitter facebook google+ newsletter Donate Piwigo.org © 2002-2019 · Contact