Hello Jan & Nicky,
While working on getting the templates right for my site I noticed that there is a problem with the dropdown list of categories (jump buttons)
I cleaned out the My Sql and did a new install, but the problem remains ( I did not re-upload the programfiles as I changed some of them, but none of the dropdown files)
Anyway after adding a 1st category (Kilimanjaro) the dropdown list looks like this:
You can not choose for the category, the name of the category seems switched somehow with the text next to the option?
When I add a 2nd category, the dropdown in the admin panel has the same problem:
So I cannot choose to create a subdirectory under the 1st category
So I add it as a new category, bu then the dropdown list (home) looks like this:
The top drowdown is teh same, a new on is added as shown.
Is this a bug?
Where should I look for the code?
This is the code I could find in functions.php, bu tdo not know if this is the problem:
function get_category_dropdown_bits($cat_id, $cid = 0, $depth = 1) {
global $site_db, $drop_down_cat_cache, $cat_cache;
if (!isset($drop_down_cat_cache[$cid])) {
return "";
}
$category_list = "";
foreach ($drop_down_cat_cache[$cid] as $key => $category_id) {
if (check_permission("auth_viewcat", $category_id)) {
$category_list .= "<select>
<option value=\"".$category_id."\"";
if ($cat_id == $category_id) {
$category_list .= " selected=\"selected\"";
}
if ($cat_cache[$category_id]['cat_parent_id'] == 0) {
$category_list .= " class=\"dropdownmarker\"";
}
if ($depth > 1) {
$category_list .= ">".str_repeat("--", $depth - 1)." ".$cat_cache[$category_id]['cat_name']."</option>\n";
}
else {
$category_list .= ">".$cat_cache[$category_id]['cat_name']."</option>\n";
}
$category_list .= get_category_dropdown_bits($cat_id, $category_id, $depth + 1);
}
}
unset($drop_down_cat_cache[$cid]);
return $category_list;
}
function get_category_dropdown($cat_id, $jump = 0, $admin = 0, $i = 0) {
global $lang, $drop_down_cat_cache, $cat_parent_cache;
// $admin = 1 Main Cat (update/add cats)
// $admin = 2 All Cats (find/validate images...)
// $admin = 3 Select Cat (update/add image)
// $admin = 4 No Cat (check new images)
switch ($admin) {
case 1:
$category = "\n
</select><select name=\"cat_parent_id\" class=\"categoryselect\">\n";
$category .= "<option value=\"0\">".$lang['main_category']."</option>\n";
$category .= "<option value=\"0\">--------------</option>\n";
break;
case 2:
$category = "\n
</select><select name=\"cat_id\" class=\"categoryselect\">\n";
$category .= "<option value=\"0\">".$lang['all_categories']."</option>\n";
$category .= "<option value=\"0\">-------------------------------</option>\n";
break;
case 3:
$i = ($i) ? "_".$i : "";
$category = "\n
</select><select name=\"cat_id".$i."\" class=\"categoryselect\">\n";
$category .= "<option value=\"0\">".$lang['select_category']."</option>\n";
$category .= "<option value=\"0\">-------------------------------</option>\n";
break;
case 4:
$category = "\n
</select><select name=\"cat_id\" class=\"categoryselect\">\n";
$category .= "<option value=\"0\">".$lang['no_category']."</option>\n";
$category .= "<option value=\"0\">-------------------------------</option>\n";
break;
case 0:
default:
if ($jump) {
$category = "\n
</select><select name=\"".URL_CAT_ID."\" onchange=\"if (this.options[this.selectedIndex].value != 0){ forms['jumpbox'].submit() }\" class=\"categoryselect\">\n";
}
else {
$category = "\n
</select><select name=\"".URL_CAT_ID."\" class=\"categoryselect\">\n";
}
$category .= "<option value=\"0\">".$lang['select_category']."</option>\n";
$category .= "<option value=\"0\">-------------------------------</option>\n";
} // end switch
$drop_down_cat_cache = array();
$drop_down_cat_cache = $cat_parent_cache;
$category .= get_category_dropdown_bits($cat_id);
$category .= "</select>\n";
return $category;
}
(I have not changed anything in here)
Thanks in advance for your help,
best regards