<?php echo $page['pages_description']; echo ' <table border="0" cellspacing="0" cellpadding="0">' . "\n" . ' <tr>' . "\n" . ' <td class="sitemap_left_column">' . "\n" . tep_show_categories_map() . '</td>' . "\n" . ' <td class="sitemap_right_column">' . "\n"; reset($active_products_types_array); while (list(, $product_type_id) = each($active_products_types_array)) { if ($product_type_id > 1) { echo tep_show_categories_map(0, 0, $product_type_id); } } echo '' . tep_show_sections_map() . tep_show_manufacturers_map() . tep_show_authors_map() . tep_show_series_map() . tep_show_specials_map() . tep_show_account_map() . '</td>' . "\n" . ' </tr>' . "\n" . ' </table>' . "\n";
function tep_show_categories_map($parent_id = '0', $level = 0, $products_types_id = '1') { global $languages_id; $categories_string = ''; $product_type_info_query = tep_db_query("select products_types_name from " . TABLE_PRODUCTS_TYPES . " where products_types_id = '" . (int) $products_types_id . "' and language_id = '" . (int) DEFAULT_LANGUAGE_ID . "'"); $product_type_info = tep_db_fetch_array($product_type_info_query); if ($level == 0) { $categories_string .= '<div id="sitemap_categories">' . "\n" . ' <a href="' . tep_href_link(FILENAME_CATEGORIES, 'tPath=' . $products_types_id) . '" class="level_0">' . $product_type_info['products_types_name'] . '</a><br />' . "\n" . ' <div class="level_0">' . "\n"; } $subcategories_check_query = tep_db_query("select count(*) as total from " . TABLE_CATEGORIES . " where products_types_id = '" . (int) $products_types_id . "' and categories_status = '1' and categories_listing_status = '1' and parent_id > '0'"); $subcategories_check = tep_db_fetch_array($subcategories_check_query); $categories_query = tep_db_query("select c.categories_id, cd.categories_name, c.parent_id from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.categories_id = cd.categories_id and c.products_types_id = '" . (int) $products_types_id . "' and c.categories_status = '1' and c.categories_listing_status = '1' and cd.language_id = '" . (int) DEFAULT_LANGUAGE_ID . "' and c.parent_id = '" . (int) $parent_id . "' order by c.sort_order, cd.categories_name"); while ($categories = tep_db_fetch_array($categories_query)) { if ($products_types_id == '1') { $category_link = tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $categories['categories_id']); } else { $category_link = tep_href_link(FILENAME_CATEGORIES, 'tPath=' . $products_types_id . '&categories_id=' . $categories['categories_id']); } $next_level = tep_show_categories_map($categories['categories_id'], $level + 1, $products_types_id); $categories_string .= ' <a href="' . $category_link . '" class="level_' . ($level + 1) . '"' . (empty($next_level) && $subcategories_check['total'] == 0 ? ' style="font-weight: normal;"' : '') . '>' . $categories['categories_name'] . '</a>' . "\n"; if ($level < SITEMAP_LEVEL) { if (tep_not_null($next_level)) { $categories_string .= ' <div class="level_' . ($level + 1) . '">' . "\n" . $next_level . '</div>' . "\n"; } } } if ($level == 0) { $categories_string .= ' </div><br />' . "\n"; } return $categories_string; }