function vam_show_category($counter) { global $foo, $categories_string, $id; $categories_string .= '<li class="CatLevel' . $foo[$counter]['level'] . ''; if ($id && in_array($counter, $id)) { $categories_string .= ' Current">'; } else { $categories_string .= '">'; } $categories_string .= '<a href="'; $cPath_new = vam_category_link($counter, $foo[$counter]['name']); $categories_string .= vam_href_link(FILENAME_DEFAULT, $cPath_new); $categories_string .= '">'; // display category name $categories_string .= $foo[$counter]['name']; if (SHOW_COUNTS == 'true') { $products_in_category = vam_count_products_in_category($counter); if ($products_in_category > 0) { $categories_string .= ' (' . $products_in_category . ')'; } } $categories_string .= '</a></li>'; if ($foo[$counter]['next_id']) { vam_show_category($foo[$counter]['next_id']); } else { $categories_string .= ''; } }
if ($category_check > 0) { $new_path .= $value; while ($row = vam_db_fetch_array($categories_query, true)) { $foo[$row['categories_id']] = array('id' => $row['categories_id'], 'name' => $row['categories_name'], 'image' => $row['categories_image'], 'parent' => $row['parent_id'], 'level' => $key + 1, 'path' => $new_path . '_' . $row['categories_id'], 'next_id' => false); if (isset($prev_id)) { $foo[$prev_id]['next_id'] = $row['categories_id']; } $prev_id = $row['categories_id']; if (!isset($first_id)) { $first_id = $row['categories_id']; } $last_id = $row['categories_id']; } $foo[$last_id]['next_id'] = $foo[$value]['next_id']; $foo[$value]['next_id'] = $first_id; $new_path .= '_'; } else { break; } } } vam_show_category($first_element); $box->assign('BOX_CONTENT', '<ul id="CatNavi">' . $categories_string . '</ul>'); } // set cache ID if (!$cache) { $box_categories = $box->fetch(CURRENT_TEMPLATE . '/boxes/box_categories.html'); } else { $box_categories = $box->fetch(CURRENT_TEMPLATE . '/boxes/box_categories.html', $cache_id); } $vamTemplate->assign('box_CATEGORIES', $box_categories);