I have added categories_link_url to my categories_description table and would like to get data the same way as categories_name, but I can't see how this is done.
Hope someone in here can help :-)
$result = tep_db_query('select c.categories_id, cd.categories_name, cd.categories_link_url, 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 .'" '.$parent_query.'order by sort_order, cd.categories_name');
while ($row = tep_db_fetch_array($result)) {
$table[$row['parent_id']][$row['categories_id']] = $row['categories_name'];
$link[$row['parent_id']][$row['categories_id']] = $row['categories_link_url'];
}
$output .= tep_make_cat_dmbranch($rootcatid, $table, 0, $maxlevel);
return $output;
}
// Create the branches off the category list
function tep_make_cat_dmbranch($parcat, $table, $level, $maxlevel) {
global $cPath_array, $menu_use_titles, $menu_icon_file, $divide_subcats, $divide_subcats_text, $pic;
$lvl_adjust = 1;
$list = $table[$parcat];
// Build data for menu
while(list($key,$val) = each($list)){
if (isset($cPath_array) && in_array($key, $cPath_array)) {
$this_expanded = '1';
$this_selected = 'dmselected';
} else {
$this_expanded = '';
$this_selected = '';
}
if (!$level) {
unset($GLOBALS['cPath_set']);
$GLOBALS['cPath_set'][0] = $key;
$cPath_new = 'cPath=' . $key;
} else {
$GLOBALS['cPath_set'][$level] = $key;
$cPath_new = 'cPath=' . implode("_", array_slice($GLOBALS['cPath_set'], 0, ($level+1)));
$this_subcat_count++;
}
if ($menu_use_titles) {
$this_title = $val;
} else {
$this_title = '';
}
if ($menu_use_links) {
$this_link = $link;
} else {
$this_link = '';
}