In Russian version og Serendipity 0.8.2 the displaying sortorder is not alphabetical, but by order category was created.
Could any one help to change it?
Sortorder problem in categories plugin
-
garvinhicking
- Core Developer
- Posts: 30022
- Joined: Tue Sep 16, 2003 9:45 pm
- Location: Cologne, Germany
- Contact:
Re: Sortorder problem in categories plugin
In include/plugin_internal.inc.php there is a class "serendipity_categories_plugin". In its generate_content() method it uses this function to display the list of categories in the sidebar:
This function serendipity_fetchCategories is defined in include/functions_entries.inc.php. It uses this SQL statement:
This means, the serendipity code is perfectly in order. It is simply your database that can not sort by correct charsets. If you are using MySQL, you need to use version 4.1 and use Russian charset collations; then the ordering will be alright.
This is an issue of the database; if we used a PHP sorting algorithm for that data, it would cost a lot of perfomance, which is why we cannot include that.
Regards,
Garvin
Code: Select all
$categories = serendipity_fetchCategories(empty($which_category) ? 'all' : $which_category);
Code: Select all
ORDER BY category_name
This is an issue of the database; if we used a PHP sorting algorithm for that data, it would cost a lot of perfomance, which is why we cannot include that.
Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
-
garvinhicking
- Core Developer
- Posts: 30022
- Joined: Tue Sep 16, 2003 9:45 pm
- Location: Cologne, Germany
- Contact:
The sort_order directive is used for MySQL sorting.
Regards,
Garvin
Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
-
Guest
-
garvinhicking
- Core Developer
- Posts: 30022
- Joined: Tue Sep 16, 2003 9:45 pm
- Location: Cologne, Germany
- Contact:
I've just committed a patch to the include/plugin_internal.inc.php of our SVN.
The patch is easy if you just change this:
Note the new $select['categoryid'] line in that plugin file.
Regards,
Garvin
The patch is easy if you just change this:
Code: Select all
case 'sort_order':
$select = array();
$select['category_name'] = CATEGORY;
$select['category_description'] = DESCRIPTION;
$select['categoryid'] = 'ID';
$select['none'] = NONE;
$propbag->add('type', 'select');
$propbag->add('name', SORT_ORDER);
$propbag->add('description', '');
$propbag->add('select_values', $select);
$propbag->add('default', 'category_name');
break;
Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
-
deepkeeper_
-
garvinhicking
- Core Developer
- Posts: 30022
- Joined: Tue Sep 16, 2003 9:45 pm
- Location: Cologne, Germany
- Contact:
Sure, you can add it just like you added "categoryid". But I think this is not useful for our default plugin installation...
Regards,
Garvin
Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/