Announcement

#1 2011-04-10 19:18:31

mbaumser
Member
2009-03-26
40

How do I set the default sort order?

I'd like to set my default sort order to Creation Date (ascending).   How do I do that (in 2.2)?

Marc

Offline

 

#2 2011-04-10 19:42:18

bakir
Translation Team
2011-01-15
89

Re: How do I set the default sort order?

i think piwigo will sort them on that order on creation process for (albums) or (pics)
but if u mean after creation process for a time , if they get mixed up and want to order them
i by that order u may that need a plugin (idk)

Offline

 

#3 2011-04-10 21:32:33

lisaviolet
Member
san diego, california
2011-01-03
334

Re: How do I set the default sort order?

Use the LocalFiles Editor plugin to change the order. 

This is the code:

Code:

$conf['order_by'] = ' ORDER BY date_creation ASC, file ASC, id ASC';
$conf['order_by_inside_category'] = $conf['order_by'];

It worked great in the previous version, but I'm having a problem in categories that have more than one day in them.  I liked the idea having the most recent day be first and the pictures taken on that day in order (date_creation DESC, file ASC) of first to last but Piwigo V2.2 isn't following my direction and the file name is being ignored.  It's either all ASC or all DESC. >:(

If there's only one day in the category, it works great.

Last edited by lisaviolet (2011-04-10 21:42:10)

Offline

 

#4 2011-04-10 22:01:37

bakir
Translation Team
2011-01-15
89

Re: How do I set the default sort order?

acctually u can depend on the pic's for that order
but how if u wanna depend on the categories itself not pic's?
checked mysql table for that categories itself and no date for categories creation (categories not pic)
so order via categories it self not possible , else u gotta patch it ur self as i think

Offline

 

#5 2011-04-10 22:06:48

bakir
Translation Team
2011-01-15
89

Re: How do I set the default sort order?

lisaviolet wrote:

Use the LocalFiles Editor plugin to change the order. 

This is the code:

Code:

$conf['order_by'] = ' ORDER BY date_creation ASC, file ASC, id ASC';
$conf['order_by_inside_category'] = $conf['order_by'];

It worked great in the previous version, but I'm having a problem in categories that have more than one day in them.  I liked the idea having the most recent day be first and the pictures taken on that day in order (date_creation DESC, file ASC) of first to last but Piwigo V2.2 isn't following my direction and the file name is being ignored.  It's either all ASC or all DESC. >:(

If there's only one day in the category, it works great.

try instead of date_creation => date_available

Offline

 

#6 2011-04-11 00:08:50

lisaviolet
Member
san diego, california
2011-01-03
334

Re: How do I set the default sort order?

bakir wrote:

try instead of date_creation => date_available

It doesn't change a thing. The pictures are still sorted in descending order, no matter if I use date_available or date_creation.  It only sees the first option, disregards the others. Both ways appear as shown in the following screenshot.

http://piwigo.org/forum/postgallery.php … ryshot.jpg

Okay, now that's weird.  It's working right on the images (using date_available, but not date_creation) uploaded since the upgrade, just not on the pre-upgraded images. 

They got messed up after the metadata batch synch.

Added.....

It works when I re-upload the exact same images to the exact same folders, but I have to redo all descriptions.  That's going to take some time. *sigh*

Last edited by lisaviolet (2011-04-11 02:41:37)

Offline

 

#7 2011-04-11 13:33:47

bakir
Translation Team
2011-01-15
89

Re: How do I set the default sort order?

i give ya advice , never upgrade any software without backing up ur db
so i did , i backed up ma database , create fresh install of piwigo , restored the database
some extra work, restoring the database , everything works fine

Offline

 

#8 2011-04-11 16:33:41

lisaviolet
Member
san diego, california
2011-01-03
334

Re: How do I set the default sort order?

I hear that. Hard lesson learned.  Well, not hard, but I'll do better next time.

Offline

 

#9 2011-04-11 21:04:56

flop25
Piwigo Team
2006-07-06
7037

Re: How do I set the default sort order?

I think this is not normal.
We should investigate on what happend here

Last edited by flop25 (2011-04-11 21:05:11)


To get a better help : Politeness like Hello-A link-Your past actions precisely described
Check my extensions : more than 30 available
who I am and what I do : http://fr.gravatar.com/flop25
My gallery : an illustration of how to integrate Piwigo in your website

Offline

 

#10 2011-04-12 00:59:30

lisaviolet
Member
san diego, california
2011-01-03
334

Re: How do I set the default sort order?

flop25 wrote:

I think this is not normal.
We should investigate on what happend here

If you're talking about my situation, I haven't done anything about re-uploading the pictures, I won't do anything right now.  (Well, I'll upload new pictures, it's working with the new uploads, just not the ones that were there before the upgrade.)

Got stupid tax forms to fill out.  That time of the year over here, so I'll be busy doing that for the next week.

Offline

 

#11 2011-04-12 13:34:20

bakir
Translation Team
2011-01-15
89

Re: How do I set the default sort order?

lisaviolet wrote:

flop25 wrote:

I think this is not normal.
We should investigate on what happend here

If you're talking about my situation, I haven't done anything about re-uploading the pictures, I won't do anything right now.  (Well, I'll upload new pictures, it's working with the new uploads, just not the ones that were there before the upgrade.)

Got stupid tax forms to fill out.  That time of the year over here, so I'll be busy doing that for the next week.

as i said u dont need to upload ur pic's just as u have access to the database , just try to manually tochange the data_available for those pic's annoying ya :D
gl

Offline

 

#12 2011-04-27 03:34:29

bjordan
Member
2011-04-25
30

Re: How do I set the default sort order?

Never mind I figured it out!

Last edited by bjordan (2011-04-27 03:39:37)

Offline

 

#13 2011-06-23 02:01:59

AnniEm
Member
2010-08-19
28

Re: How do I set the default sort order?

bjordan wrote:

Never mind I figured it out!

bjordan - I'd like to set my albums to the same display function as well and the code hasn't worked for me either - what did you do that sorted it?

Thanks,
Anna

Offline

 

#14 2011-07-01 23:56:34

bjordan
Member
2011-04-25
30

Re: How do I set the default sort order?

AnniEm wrote:

bjordan wrote:

Never mind I figured it out!

bjordan - I'd like to set my albums to the same display function as well and the code hasn't worked for me either - what did you do that sorted it?

Thanks,
Anna

Sorry for the late reply. I just saw your response. I basically used the same code mentioned above in the thread.

Install and enable plugin, "LocalFiles Editor" in the administration tool.

Then add the following code to the "Local Config" (local/config/config.inc.php) using the "LocalFiles Editor".

Code:

<?php

# ================================
# Change default sort to ascending
# ================================

$conf['order_by'] = ' ORDER BY date_creation ASC, file ASC, id ASC';
$conf['order_by_inside_category'] = $conf['order_by'];

?>

Offline

 

#15 2011-07-02 15:29:37

AnniEm
Member
2010-08-19
28

Re: How do I set the default sort order?

Thanks! I see what I did wrong - I left a comment tag in place, small wonder it wasn't working :)

Offline

 

Board footer

Powered by FluxBB

github twitter newsletter Donate Piwigo.org © 2002-2024 · Contact