forum.coppermine-gallery.net

Support => cpg1.4.x Support => Older/other versions => cpg1.4 miscellaneous => Topic started by: dwo on June 30, 2008, 01:32:11 pm

Title: [Solved]: sort order again ...
Post by: dwo on June 30, 2008, 01:32:11 pm
Hello.

When I choose as admin "sort position ascending" or "sort position descending" the pics get sorted like the user sorts them himself ONLY if he does sort himself.


However, if the user does sort nothing, the default setting seems, that in thumbnail view, always the oldest pic stays at top left and the next ones are added afterwards.

Could anyone please tell me where one can change this default settings to the reverse order? In thumbnails.php?



Thank you, reagrds Dietmar
Title: Re: sort order again ...
Post by: Nibbler on June 30, 2008, 04:20:40 pm
Default sort order is a config setting. Clear cookies to revert any sorting done by the links in thumbnails page.
Title: Re: sort order again ...
Post by: dwo on June 30, 2008, 04:39:10 pm
Hello.

The example above is with cleared cookies and with, for the user not visible, manual user sort settings - ... +
So the user cannot change that.


ok. I try to explain another way.

Basically I choose in the adminconfig "position ascending". So that when a user sorts manually, it will be displayed as he sorted. That function is ok, works.

But when a user does not sort manually, I would like as default setting sort by "upload date ascending"
So as if a user clicked on the "DATE +" which I hided. This should be the default.


Right now, "date -" is the default if you do nothing as user. I want that reversed.


Thank you.

(so I want to change the default sort order, before sort order is stored in the cookies though the user)

regards, Dietmar
Title: Re: sort order again ...
Post by: Nibbler on June 30, 2008, 04:45:55 pm
include/functions.inc.php

change

Code: [Select]
'pa' => 'position ASC',
to

Code: [Select]
'pa' => 'position ASC, pid ASC',
Title: Re: sort order again ...
Post by: dwo on June 30, 2008, 05:04:06 pm
I changed that line in function get_pic_data but that does not change anything.

Code: [Select]
$sort_array = array(
          'na' => 'filename ASC',
          'nd' => 'filename DESC',
          'ta'=>'title ASC',
          'td'=>'title DESC',
          'da' => 'pid ASC',
          'dd' => 'pid DESC',
          'pa' => 'position ASC, pid ASC',
          'pd' => 'position DESC',

I have set "position ascending" as admin, cleared cookies, clicked nowhere else, and any file i upload still gets at last position of the thumbnail view. I would like to see it at first position.

Thank you.

regards, Dietmar
Title: Re: sort order again ...
Post by: Nibbler on June 30, 2008, 05:06:21 pm
If you want new pics to be first then that would be date descending, so:

Code: [Select]
'pa' => 'position ASC, pid DESC',
Title: Re: sort order again ...
Post by: dwo on June 30, 2008, 10:18:29 pm
Works perfect. Thank you very much.