Search results don't sort according to config pref Search results don't sort according to config pref
 

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

Search results don't sort according to config pref

Started by windfate, July 22, 2004, 11:13:59 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

windfate

Hi -

I'm enjoying 1.3.1.  Great work!  I have a question I've seen raised a few times but didn't notice any responses.

Clicking into an album will sort fine, but I've noticed that Search results still do not sort according to the preferred method selected in the Config (eg, "Title ascending", etc.).  Does anyone know where I would go in the code to hardcode a field to sort to when searching?  I've poked around a bit but don't see it.

Might this be implemented in a future release?

Thanks!

windfate

Nibbler

I've just added it into the next version (1.4), thanks for your suggestion :)

If you want to add it yourself, the file you need to look at is /include/search.inc.php

windfate

Thanks Nibbler.  I took a look at the file and I think I found where I need to insert something (around line 150?).  I thought I would try and see how sorting is being done in thumbnails.php but I didn't find "sort" anywhere in that file (must be in another include).  I found some uses of array_multisort() in some of the other files and gave that a whirl, but I quickly realized I'm missing some key concepts in sorting data from sql queries.

If it's a simple addition to the code, could you post it here?  Would be much appreciated!

Thanks for your help.

windfate

Nibbler

You can see the changes to the file by using the CVS diff, just here.