Advanced search  

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

Pages: [1]   Go Down

Author Topic: Sort order of Categorie ( cid ) on index page  (Read 5380 times)

0 Members and 1 Guest are viewing this topic.

JohannM

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 252
Sort order of Categorie ( cid ) on index page
« 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
Logged

phill104

  • Administrator
  • Coppermine addict
  • *****
  • Country: gb
  • Offline Offline
  • Gender: Male
  • Posts: 4885
    • Windsurf.me
Re: Sort order of Categorie ( cid ) on index page
« Reply #1 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
Logged
It is a mistake to think you can solve any major problems just with potatoes.

JohannM

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 252
Re: Sort order of Categorie ( cid ) on index page
« Reply #2 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

Logged

ron4mac

  • Administrator
  • Coppermine addict
  • *****
  • Country: us
  • Offline Offline
  • Posts: 2026
Re: Sort order of Categorie ( cid ) on index page
« Reply #3 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";
Logged

JohannM

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 252
Re: Sort order of Categorie ( cid ) on index page
« Reply #4 on: March 11, 2015, 06:32:47 pm »

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

ron4mac

  • Administrator
  • Coppermine addict
  • *****
  • Country: us
  • Offline Offline
  • Posts: 2026
Re: Sort order of Categorie ( cid ) on index page
« Reply #5 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.
Logged

JohannM

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 252
Re: Sort order of Categorie ( cid ) on index page
« Reply #6 on: March 11, 2015, 09:06:47 pm »

Perfect. Works like a bomb.  Thanx a lot !!!!!   :D
Logged
Pages: [1]   Go Up
 

Page created in 0.019 seconds with 20 queries.