###############################################################
##
## Dieser Hack erlaubt euch, die Kategorien beliebig zu ordnen.
##
##############################################################
===============================================================
== ./global.php
===============================================================
///////////////////////////////////////////
// search
///////////////////////////////////////////
$sql = "SELECT c.cat_id, c.cat_name, c.cat_description, c.cat_parent_id, c.cat_hits, c.cat_order, c.auth_viewcat, c.auth_viewimage, c.auth_download, c.auth_upload, c.auth_directupload, c.auth_vote, c.auth_sendpostcard, c.auth_readcomment, c.auth_postcomment, COUNT(i.image_id) AS new_images
FROM ".CATEGORIES_TABLE." c
LEFT JOIN ".IMAGES_TABLE." i ON (i.cat_id = c.cat_id AND i.image_date >= $new_cutoff AND i.image_active = 1)
GROUP BY c.cat_id
ORDER BY c.cat_order, c.cat_name ASC";
//////////////////////////////
// replace with
//////////////////////////////
$sql = "SELECT c.cat_id, c.cat_name, c.cat_description, c.cat_parent_id, c.cat_hits, c.cat_order, c.auth_viewcat, c.auth_viewimage, c.auth_download, c.auth_upload, c.auth_directupload, c.auth_vote, c.auth_sendpostcard, c.auth_readcomment, c.auth_postcomment, COUNT(i.image_id) AS new_images
FROM ".CATEGORIES_TABLE." c
LEFT JOIN ".IMAGES_TABLE." i ON (i.cat_id = c.cat_id AND i.image_date >= $new_cutoff AND i.image_active = 1)
GROUP BY c.cat_id
ORDER BY ".$config['cat_order']."";
===============================================================
== ./lang/{lang}/admin.php
===============================================================
///////////////////////////////////////////
// search
///////////////////////////////////////////
/*-- Setting-Group 3 --*/
///////////////////////////////////////////
// add before
///////////////////////////////////////////
$setting['cat_order'] = "Nach welchem Prinzip, sollen die Kategorien bzw. Subkategorien geordnet werden";
$cat_order_array = array(
'c.cat_order' => 'Manuell',
'c.cat_name ASC' => 'Name Aufsteigend',
'c.cat_name DESC' => 'Name Absteigend'
);
===============================================================
== ./admin/settings.php
===============================================================
///////////////////////////////////////////
// search
///////////////////////////////////////////
show_setting_row("num_subcats");
///////////////////////////////////////////
// add after
///////////////////////////////////////////
show_setting_row("cat_order", "show_cat_order");
///////////////////////////////////////////
// search
///////////////////////////////////////////
function show_image_order_select($setting_name, $setting_value) {
global $image_order_optionlist;
echo "<select name=\"setting_item[".$setting_name."]\">";
foreach ($image_order_optionlist as $key => $val) {
echo "<option value=\"$key\"";
if ($setting_value == $key) {
echo " selected=\"selected\"";
}
echo ">".$val."</option>";
}
echo "</select>";
}
///////////////////////////////////////////
// add after
///////////////////////////////////////////
function show_cat_order($setting_name, $setting_value) {
global $cat_order_array;
echo "<select name=\"setting_item[".$setting_name."]\">";
foreach ($cat_order_array as $key => $val) {
echo "<option value=\"$key\"";
if ($setting_value == $key) {
echo " selected=\"selected\"";
}
echo ">".$val."</option>";
}
echo "</select>";
}
===============================================================
== SQL (add this with phpmyadmin or run this installer -->
installer (thx V@no for this installer)
===============================================================
INSERT INTO `4images_settings` ( `setting_name` , `setting_value` )
VALUES (
'cat_order', 'c.cat_name ASC'
);
PS: Viel Spass, hoffe hab nix vergessen