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

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

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.