Hi there. Although I'm new here, I've been a loyal fan of Piwigo for a long time.
I'm now working on a botanical gallery with Piwigo. I arrange my plant photo collections by the biological "families" they belong to, which means there're many categories (now I've built more than 100 cat.s). The problem you can imagine is that, a long page with many sub-cats, some cats of big plant "families" have many photos inside, while some small families get only 1 or 2 photos inside.
Under that condition, sorting by cat names is not a nice way to present the gallery, I think to show the categories with more photos inside on top of the page would be a better choice. Of course one can do that manually, but considering the big amount of categories and the changing amount of photos inside, always manually change the order will be a miserable work.
So I guess the way of solving this problem is, to make galleries possible to be sorted by amount of photos in side, or more simple: in a same level, show bigger galleries on the top, and of course, with the condition that when galleries have same amount of photos inside, show them alphanumerically.
Maybe not everyone need it, but I think it's an important user-friendly function for many people.
Thank you Piwigo team!
(BTW, it'll be very grateful if there's some easy way to realize that function by editing source codes, thanks!)
Last edited by dennisyan (2012-07-14 21:23:55)
Offline
up! (6 months no reply, but I still think it's important not only for me, and after all, it's not so difficult to realize. Piwigo people, pls. take this into account, thanks! )
Offline
I don't know how to do it, that's why I didn't answer
Maybe someone could
Offline
I would say based on the latest version, it should be easy to modify include/category_cats.inc.php by replacing
if ('recent_cats' != $page['section']) { $query.= ' ORDER BY rank'; }
with
if ('recent_cats' != $page['section']) { $query.= ' ORDER BY nb_images DESC'; }
Offline
flop25 wrote:
I don't know how to do it, that's why I didn't answer
Maybe someone could
Hi flop25, thank you for your answer.
I'm not a programmer (only know some html and css), but I can't understand why this function is difficult.
The main program already counts the numbers of photos in every category (and they're shown in the frontstage). What needs to do is just make the father-category list page to list sub-categories by those numbers.
I know not so many users have an album contains 100+ categories, but some users like me use piwigo as natural history album, and need to build a big classification for different filming objects. You can imagine this: one day I go out and record 70 images of plants and animals, now I put 70 photos of different objects into 20 categories (no new photo for the other 80 categories), and then number of photos in every category (of this 20) changes, or we can say "size" of these 20 categories changes. How long and how many clicks-drags will it takes if I re-order the category list (of course not only 20 but 100) by its "size" manually? But with a program, re-order by "size" can be done in less then 0.1sec. That's why we need computer!
Offline
rvelices wrote:
I would say based on the latest version, it should be easy to modify include/category_cats.inc.php by replacing
Code:
if ('recent_cats' != $page['section']) { $query.= ' ORDER BY rank'; }with
Code:
if ('recent_cats' != $page['section']) { $query.= ' ORDER BY nb_images DESC'; }
Hi rvelices, thank you so much for your answer.
Does "ORDER BY nb_images DESC" works? maybe I'll give it a try, thank you!
However if this works, this only works on recent_cats page, but not on main page menu or category pages. I hope this function can be considered and written into admin.lang.php, as a new auto-sorting option, and user can customize the ways of auto-sorting in every different category / sub-category.
Offline