Execute($categories_query_all); while (!$categories->EOF) { $root_first=$root_first+1; $content_root_b='
  • '; $content_root_e='
  • '; $category_link=$categories->fields['categories_id']; $category_name=$categories->fields['categories_name']; //$content_see_all.=''.$category_name.''; //根目录 父节点 菜单标题 $content_root= ''.$category_name.''; $categories_child_query = "select c.categories_id, c.categories_image,cd.categories_name, c.parent_id from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.categories_id = cd.categories_id and c.categories_status=1 and c.parent_id='" . $category_link . "' and cd.language_id = '" . (int)$_SESSION['languages_id'] ."' order by c.parent_id,c.sort_order, cd.categories_name"; $categories_child = $db->Execute($categories_child_query); if (zen_has_category_subcategories($category_link)){ $special_product_query="select p.products_id, pd.products_name from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_SPECIALS . " s where p.products_status = 1 and p.products_id = s.products_id and pd.products_id = s.products_id and pd.language_id = '" . (int)$_SESSION['languages_id'] . "' and s.status = 1 and p.master_categories_id in(select categories_id from " . TABLE_CATEGORIES ." where parent_id=$category_link)"; $sp_list=$db->Execute($special_product_query); $dd=''; while(!$sp_list->EOF){ $dd.='

    '.$sp_list->fields['products_name'].'

    '; $sp_list->MoveNext(); } $content_dd_b=''; $content_center_c=''; $content_left_c=''; $j=1; while (!$categories_child->EOF) { $category_link1 = $categories_child->fields['categories_id']; $category_name1 = $categories_child->fields['categories_name']; $category_image1 = $categories_child->fields['categories_image']; $categories_child2_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.categories_status=1 and c.parent_id='" . $category_link1 ."' and cd.language_id = '" . (int)$_SESSION['languages_id'] ."' order by c.parent_id,c.sort_order, cd.categories_name limit 5"; $categories_child2 = $db->Execute($categories_child2_query); if (zen_has_category_subcategories($category_link1)){//二级菜单查询 $content_left_count=$content_left_count+1; $content_child2=''; $content_child2_e=''; $content_child2_b='
    '. zen_image(DIR_WS_IMAGES . $category_image1, $category_name1, 40, 40) .$category_name1.'
    '; //
  • $i=1; while (!$categories_child2->EOF) { $category_link2=$categories_child2->fields['categories_id']; $category_name2=$categories_child2->fields['categories_name']; $content_child2.=''. $category_name2.''; //
    if ($i==5){ break; } $i=$i+1; $categories_child2->MoveNext(); } $content_child2='
    '.$content_child2.'view more
    '; $content_left_c.=$content_child2_b.$content_child2.$content_child2_e; //$content_left_c.=$content_child2; } else{ if ($j==1) { $content_left_c.='
    '. zen_image(DIR_WS_IMAGES . $categories_child->fields['categories_image'], $categories_child->fields['categories_name'], 40, 40) .$categories_child->fields['categories_name'].'
    ';} else { $content_left_c.='
    '. zen_image(DIR_WS_IMAGES . $categories_child->fields['categories_image'], $categories_child->fields['categories_name'], 40, 40) .$categories_child->fields['categories_name'].'
    ';} //
  • $j.=1; } $categories_child->MoveNext(); } if ($content_center_c=='') { $content_child=$content_left_b.$content_left_c.$content_left_e; } else { $content_child=$content_left_b.$content_left_c.$content_left_e.$content_center_b.$content_center_c.$content_center_e; } $content.=$content_root_b.$content_root.$content_dd_b.$content_child.$content_dd_e.$content_root_e; }else{ $content.=$content_root_b.$content_root.$content_root_e; } $categories->MoveNext(); } ?>