Ja, fängt bei mir auch so an
Ich hänge mal beide Funktionen aus der Version 1.7 an
get_categories
function get_categories($cat_id = 0) {
global $site_template, $site_db, $site_sess, $config, $lang;
global $cat_cache, $cat_parent_cache, $new_image_cache, $subcat_ids;
$cattable_width = ceil((intval($config['cat_table_width'])) / $config['cat_cells']);
if ((substr($config['cat_table_width'],-1)) == "%") {
$cattable_width .= "%";
}
if (!isset($cat_parent_cache[$cat_id])) {
return "";
}
$visible_cat_cache = array();
foreach ($cat_parent_cache[$cat_id] as $key => $val) {
if (check_permission("auth_viewcat", $val)) {
$visible_cat_cache[$key] = $val;
}
}
if (empty($visible_cat_cache)) {
return "";
}
$total = sizeof($visible_cat_cache);
$table_columns = (intval($config['cat_cells'])) ? intval($config['cat_cells']) : 2;
if ($total <= $table_columns) {
$table_rows = 1;
}
else {
$table_rows = $total / $table_columns;
if ($total >= $table_columns && !is_integer($table_rows)) {
$table_rows = intval($table_rows) + 1;
}
}
$categories = "\n<table width=\"".$config['cat_table_width']."\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\">\n<tr>\n<td valign=\"top\" width=\"".$cattable_width."\" class=\"catbgcolor\">\n";
$categories .= "<table border=\"0\" cellpadding=\"".$config['cat_table_cellpadding']."\" cellspacing=\"".$config['cat_table_cellspacing']."\">\n";
$count = 0;
$count2 = 0;
foreach ($visible_cat_cache as $key => $category_id) {
$categories .= "<tr>\n<td valign=\"top\">\n";
$is_new = (isset($new_image_cache[$category_id]) && $new_image_cache[$category_id] > 0) ? 1 : 0;
$num_images = (isset($cat_cache[$category_id]['num_images'])) ? $cat_cache[$category_id]['num_images'] : 0;
$subcat_ids = array();
get_subcat_ids($category_id, $category_id, $cat_parent_cache);
if (isset($subcat_ids[$category_id])) {
foreach ($subcat_ids[$category_id] as $val) {
if (isset($new_image_cache[$val]) && $new_image_cache[$val] > 0) {
$is_new = 1;
}
if (isset($cat_cache[$val]['num_images'])) {
$num_images += $cat_cache[$val]['num_images'];
}
}
}
get_categorie_path
function get_category_path($cat_id = 0, $detail_path = 0) {
global $site_sess, $config, $cat_cache, $url;
$parent_id = 1;
while ($parent_id) {
if (!isset($cat_cache[$cat_id]['cat_parent_id'])) {
return false;
}
$parent_id = $cat_cache[$cat_id]['cat_parent_id'];
if (empty($path)) {
if ($detail_path) {
$cat_url = ROOT_PATH."categories.php?".URL_CAT_ID."=".$cat_id;
if (preg_match("/".URL_PAGE."=([0-9]+)/", $url, $regs)) {
if (!empty($regs[1]) && $regs[1] != 1) {
$cat_url .= "&".URL_PAGE."=".$regs[1];
}
}
$path = "<a href=\"".$site_sess->url($cat_url)."\" class=\"clickstream\">".$cat_cache[$cat_id]['cat_name']."</a>";
}
else {
$path = $cat_cache[$cat_id]['cat_name'];
}
}
else {
$path = "<a href=\"".$site_sess->url(ROOT_PATH."categories.php?".URL_CAT_ID."=".$cat_id)."\" class=\"clickstream\">".$cat_cache[$cat_id]['cat_name']."</a>".$config['category_separator'].$path;
}
$cat_id = $parent_id;
} // end while
return $path;
}
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;
}
Aber das wird wohl bei dir auch stimmen?!
Die Kategorien sind aber noch in der Datenbank drin?