[Solved]: sort order again ... [Solved]: sort order again ...
 

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Main Menu

[Solved]: sort order again ...

Started by dwo, June 30, 2008, 01:32:11 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

dwo

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

Nibbler

Default sort order is a config setting. Clear cookies to revert any sorting done by the links in thumbnails page.

dwo

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

Nibbler

include/functions.inc.php

change

'pa' => 'position ASC',

to

'pa' => 'position ASC, pid ASC',

dwo

I changed that line in function get_pic_data but that does not change anything.

$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

Nibbler

If you want new pics to be first then that would be date descending, so:

'pa' => 'position ASC, pid DESC',

dwo

Works perfect. Thank you very much.