Pages: [1]
Author Topic: Categories list not sorting  (Read 990 times)
Newbie
*

Karma: 0
Posts: 3


on: Aug 29, 08, 12:53 PM

Hi,

first of all, thanks for a superb script. I really enjoy working with it, it's nicely coded and structured.

Now to my problem, I added some new categories, which went fine, however now the sorting of the categories list wouldn't work. The categories shows up in the order I added them and not as A-Z, which I want it.

How can I fix that?

Thanks!
Logged
Administrator
Sr. Member
*

Karma: 7
Posts: 486


Email
Reply #1 on: Aug 29, 08, 02:01 PM

unfortunately there is no control for cat. order's manipulation in admin CP yet, but you can order them manually using phpMyAdmin (most likely you have it installed on your server): open the table "<prefix>_categories" and change the "position" value for each category (for example 1-2-3-4-5-...); 1st will be on top of the list
Logged
Newbie
*

Karma: 0
Posts: 3


Reply #2 on: Aug 29, 08, 02:32 PM

Thanks for the quick reply, Sergey, I did as you suggested but it didn't work.

However, I noticed that the cats seems to be ordered after their db id and not by position, I looked in the code for the page block and the only thing that the code queries from the db is id, title, latin_title, not position or am I wrong?

Logged
Administrator
Sr. Member
*

Karma: 7
Posts: 486


Email
Reply #3 on: Aug 29, 08, 10:41 PM

You are right Ken, looks like I've been lost in changes...
To activate position preferences, please change 4th line in the block's code to the following:
Code:
$res = $db->super_query( "SELECT * FROM " . $cMain["dbPrefix"] . "categories ORDER by position ASC", true );
Logged
Newbie
*

Karma: 0
Posts: 3


Reply #4 on: Aug 30, 08, 02:35 AM

Now, it's working as it should  Cheesy
Thanks for some great and fast support, Sergey, really appreciate it.
Logged
Pages: [1]
 
Jump to: