4images Forum & Community
4images Issues / Ausgaben => Discussion & Troubleshooting => Topic started by: kindian on April 12, 2006, 12:51:13 AM
-
Can someone tell me how to order the category dropdown from A to Z instead of category ID ordering?
And how do show only MAIN CATS there?
thanks in advance.
-
To show only main cats, replace in includes/functions.php
$drop_down_cat_cache = $cat_parent_cache;
with: $drop_down_cat_cache[0] = $cat_parent_cache[0];
And to sort them by name, below that line, insert: uasort($drop_down_cat_cache[0], "catsortname");
then, at the very end of the file, ABOVE closing ?> insert:function catsortname($a, $b)
{
global $cat_cache;
return strcasecmp($cat_cache[$a]['cat_name'], $cat_cache[$b]['cat_name']);
}
-
thanks alot v@no, i'll try that out :)
-
V@no, only main cats appear like I wanted, but the sort is not good. Categories are all mixed, no alphabetical order after instering your code. what's wrong?
-
try now
-
V@NO PERFECT!!!! 8)
Thanks again!
-
V@no do you think you can help me now again:
The categories show exactly as a I wanted in normal pages, but when I try to edit a photo and move it to a subdir, the subdirs dont show up, just the main catgs.
what do I have to change in order to the admin edit image area show the drop down with all the subcats?
-
You can try replce the two new lines from above with this:
if (defined("IN_CP"))
{
$drop_down_cat_cache = $cat_parent_cache;
}
else
{
$drop_down_cat_cache[0] = $cat_parent_cache[0];
uasort($drop_down_cat_cache[0], "catsortname");
}
This will show normal dropdown in ACP.
-
thanks for the help, but it isnt working, the only change I see is the ordering, it only changes the ordering. it doesnt show the sub categories in the CP.
-
Hmmm...what's wrong with me? :S try now, I've update the post above...
Now it should only "sort" dropdown on the "main" site, and should not affect ACP.
-
damn you V@no!!!! that worked like a charm!!! :D
you're the master, thanks again for yout help!!!!!!!