forum.coppermine-gallery.net

Support => cpg1.5.x Support => cpg1.5 miscellaneous => Topic started by: JohannM on March 05, 2015, 06:51:20 pm

Title: Sort order of Categorie ( cid ) on index page
Post by: JohannM on March 05, 2015, 06:51:20 pm
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
Title: Re: Sort order of Categorie ( cid ) on index page
Post by: phill104 on March 05, 2015, 08:21:32 pm
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
Title: Re: Sort order of Categorie ( cid ) on index page
Post by: JohannM on March 05, 2015, 09:16:42 pm
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

Title: Re: Sort order of Categorie ( cid ) on index page
Post by: ron4mac on March 06, 2015, 06:11:40 pm
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:
Code: [Select]
        ORDER BY NULL";to:
Code: [Select]
        ORDER BY c.cid DESC";
Title: Re: Sort order of Categorie ( cid ) on index page
Post by: JohannM on March 11, 2015, 06:32:47 pm
Hi. Did the code change, but with no effect ... :-\
Title: Re: Sort order of Categorie ( cid ) on index page
Post by: ron4mac on March 11, 2015, 08:48:42 pm
Hi. Did the code change, but with no effect
Sorry, I should have tested what I suggested  :-[

Try, at about line 301, change:
Code: [Select]
        ORDER BY lft";to:
Code: [Select]
        ORDER BY cid DESC, lft";I'm pretty sure that should do it.
Title: Re: Sort order of Categorie ( cid ) on index page
Post by: JohannM on March 11, 2015, 09:06:47 pm
Perfect. Works like a bomb.  Thanx a lot !!!!!   :D