Hi I need help with step 5 of the install proicedure.
The instructions say to replace this function
function tep_get_category_tree($parent_id = '0', $spacing = '', $exclude = '', $category_tree_array = '', $include_itself = false) {
global $languages_id;
if (!is_array($category_tree_array)) $category_tree_array = array();
if ( (sizeof($category_tree_array) < 1) && ($exclude != '0') ) $category_tree_array[] = array('id' => '0', 'text' => TEXT_TOP);
if ($include_itself) {
$category_query = tep_db_query("select cd.categories_name from " . TABLE_CATEGORIES_DESCRIPTION . " cd where cd.language_id = '" . (int)$languages_id . "' and cd.categories_id = '" . (int)$parent_id . "'");
$category = tep_db_fetch_array($category_query);
$category_tree_array[] = array('id' => $parent_id, 'text' => $category['categories_name']);
}
$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 cd.language_id = '" . (int)$languages_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 ($exclude != $categories['categories_id']) $category_tree_array[] = array('id' => $categories['categories_id'], 'text' => $spacing . $categories['categories_name']);
$category_tree_array = tep_get_category_tree($categories['categories_id'], $spacing . ' ', $exclude, $category_tree_array);
}
return $category_tree_array;
}
With this one
function tep_get_subcategories(&$subcategories_array, $parent_id = 0) {
$subcategories_query = tep_db_query("select categories_id from " . TABLE_CATEGORIES . " where parent_id = '" . (int)$parent_id . "'");
while ($subcategories = tep_db_fetch_array($subcategories_query)) {
$subcategories_array[sizeof($subcategories_array)] = $subcategories['categories_id'];
if ($subcategories['categories_id'] != $parent_id) {
tep_get_subcategories($subcategories_array, $subcategories['categories_id']);
}
}
}
Is that correct because I don't want to mess anything up.
Thanks