Sort order of Categorie ( cid ) on index page Sort order of Categorie ( cid ) on index page
 

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

Sort order of Categorie ( cid ) on index page

Started by JohannM, March 05, 2015, 06:51:20 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

JohannM

Hi there

I am not sure where to post this ...

I want to sort my "Categories" according to the sql "cid" on my index page ... showing the latest category on top side and the oldest at bottom.

I tried everything in the code of the index.php page, but could not manage to get it working.

Help anyone ?
Please ... and thank you

phill104

Not 100% sure what you are asking for. A link and a little more details may help.

There are a few hidden sort features in Coppermine. The following plugin will allow you to configure them - http://forum.coppermine-gallery.net/index.php/topic,77314.0.html
It is a mistake to think you can solve any major problems just with potatoes.

JohannM

Hi Phill

http://www.boy-idols.com/

Jaco Hoffmann ( http://www.boy-idols.com/index.php?cat=2 ) should be last on the page, and Milano Jarmann ( http://www.boy-idols.com/index.php?cat=50 ) should be first on the page.

I tried the Hidden features plugin for cpg1.5.x but it did not help me at all.

Rgerads

Jo


ron4mac

The easiest (and, currently, perhaps only) way for you to accomplish what you want is to make a small modification to the index.php file at the root of your gallery. The downside is that the change wouldn't survive an upgrade.

change the code at around line 362 from:        ORDER BY NULL";
to:        ORDER BY c.cid DESC";

JohannM

Hi. Did the code change, but with no effect ... :-\

ron4mac

Quote from: JohannM on March 11, 2015, 06:32:47 PM
Hi. Did the code change, but with no effect
Sorry, I should have tested what I suggested  :-[

Try, at about line 301, change:
        ORDER BY lft";
to:
        ORDER BY cid DESC, lft";
I'm pretty sure that should do it.

JohannM

Perfect. Works like a bomb.  Thanx a lot !!!!!   :D