Now my User Galleries in the dropdown list doesnt works properly.
My second main category is called Assignments and my third main category is called News and Updates
So when I choose User Galleries it takes me to the alphabetical listing, but when I choose Assignments it takes me to the first sub category of User galleries, Namely category A.
When I choose the 3rd main category, that of news, it takes me to the assignments category.
So I checked the html coding on the page and this is what I've found:
<select name="cat_id" onchange="if (this.options[this.selectedIndex].value != 0){ forms['jumpbox'].submit() }" class="categoryselect">
<option value="0">Select category</option>
<option value="0">-------------------------------</option>
<option value="30" class="dropdownmarker">Users Galleries</option>
<option value="31" selected="selected"
<option value="32"
<option value="33"
<option value="34"
<option value="35"
<option value="36"
<option value="37"
<option value="38"
<option value="39"
<option value="40"
<option value="41"
<option value="42"
<option value="43"
<option value="44"
<option value="45"
<option value="46"
<option value="47"
<option value="48"
<option value="49"
<option value="50"
<option value="51"
<option value="52"
<option value="53"
<option value="54"
<option value="55"
<option value="56"
<option value="26" class="dropdownmarker">Assignments</option>
<option value="27"<option value="15" class="dropdownmarker">News Updates</option>
</select>
The changes I made to the functions.php is shown below:
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 .= "<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;
}
Did I move the } somewhere wrong?