// cssMenu - Begin of configuration //
$cssMenuConfig = array();
$cssMenuConfig['ShowEmptyCategories'] = true;
$cssMenuConfig['includeProducts'] = false; // Should CSSMenu show products
$cssMenuConfig['maxProductsInMenu'] = 8; // Maximum number of products to show in a menu ( stops massive menus being created )
$cssMenuConfig['moreText'] = "More...."; // Maximum number of products to show in a menu ( stops massive menus being created )
$cssMenuConfig['showSubMenu'] = true; // Show category dependent menu
// $cssMenuConfig['idSubMenu'] = array('619', '620'); // Category id for the dependent menu
// cssMenu - End of configuration //
$categories_subs = array();
$categories_start = array();
$categories_subs_query = tep_db_query("select count(*) as count, parent_id from " . TABLE_CATEGORIES . " GROUP BY parent_id");
while($row = tep_db_fetch_array($categories_subs_query)) {
$categories_subs[$row['parent_id']] = $row['count'];
}
$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 = '" . $languages_id . "' order by sort_order, cd.categories_name");
while($row = tep_db_fetch_array($categories_query)) {
$categories_start['S_' . $row['categories_id'] . '_' . $row['parent_id'] . '_E'] = $row;
}
?>
function PrintProducts( $category_id, $categories_string , $includeul, $languageID)
{
global $cssMenuConfig;
$product_path="product_info.php?cPath=".$category_id."&products_id=";
$products_query = tep_db_query("select pc.products_id, pc.categories_id from products_to_categories pc, products p where pc.categories_id = " . $category_id . " and p.products_id = pc.products_id and products_status=1 order by products_price");
$productsDisplay=mysql_num_rows( $products_query );
$addMore= false;
if ( $includeul && $productsDisplay > 0 ) {
$returnval .= "";
}
if ( $productsDisplay > $cssMenuConfig['maxProductsInMenu'] ) {
$productsDisplay=$cssMenuConfig['maxProductsInMenu'];
$addMore= true;
}
$count_string = '';
if (SHOW_COUNTS == 'true') {
if ($totalitemsincategory > 0) {
$count_string = ' (' . $totalitemsincategory . ')';
}
}
$i=0;
while ($i < $productsDisplay) {
$products = tep_db_fetch_array($products_query);
$product_query = tep_db_query("select products_name from products_description where products_id = " . $products['products_id'] . " AND language_id = ".$languageID );
$product = tep_db_fetch_array($product_query);
$returnval .= "- ".$product['products_name']."
\n";
$i++;
}
if ( $addMore ) {
$returnval .= "- ".$cssMenuConfig['moreText']."
\n";
}
if ( $productsDisplay > 0 || !$includeul ) {
$returnval .= " ";
}
return $returnval;
}
function PrintSubMenus( $parentID, $languageID, $start_path ){
global $cssMenuConfig, $categories_subs, $categories_start;
$returnval = '';
if (($start_path == '') && ($parentID > 0)) {
$start_path = $parentID;
} else {
if ($parentID > 0) $start_path .= "_" . $parentID;
}
if ($parentID != 0) {
$returnval .= " |