0) { $sql = "SELECT nav_name, nav_link_desc FROM navigation WHERE nav_id = '$nv_nav_parent_id' ORDER BY nav_sequence"; $result = mysql_query ($sql, $conn); $row = mysql_fetch_array($result, MYSQL_ASSOC); $navparent_name = $row["nav_name"]; $navparent_link_desc = $row["nav_link_desc"]; $sql2 = "SELECT nav_id, nav_name, nav_link, nav_link_desc, nav_pl_id FROM navigation WHERE nav_parent_id = '$nv_nav_parent_id' AND nav_hide != 'Y' ORDER BY nav_sequence"; $result2 = mysql_query ($sql2, $conn); if (mysql_num_rows($result2)>0) { print "
".$navparent_name."
"; print "
\n"; while ($row2 = mysql_fetch_array($result2, MYSQL_ASSOC)) { $navchild_id = $row2["nav_id"]; $navchild_name = $row2["nav_name"]; $navchild_link = $row2["nav_link"]; $navchild_link_desc = $row2["nav_link_desc"]; $nav_pl_id = $row2["nav_pl_id"]; if (substr($navchild_link,0,11) == "product.php") { /* this section just in case the sublink is the main link to the shopping cart */ $sql23 = "SELECT prodcat_id, prodcat_name FROM product_categories WHERE prodcat_prodline_id = '$nav_pl_id' AND prodcat_hide = 'N' ORDER BY prodcat_sequence"; $result23 = mysql_query ($sql23, $conn); if (mysql_num_rows($result23)>0) { while ($row23 = mysql_fetch_array($result23, MYSQL_ASSOC)) { $prodcat_id23 = $row23["prodcat_id"]; $prodcat_name23 = $row23["prodcat_name"]; $sql24 = "SELECT prod_id, prod_url_desc FROM products WHERE prod_prodcat_id = '$prodcat_id23' AND prod_hide != 'Y' ORDER BY prod_sequence"; $result24 = mysql_query ($sql24, $conn); if (mysql_num_rows($result24)>0) { while ($row24 = mysql_fetch_array($result24, MYSQL_ASSOC)) { $prod_id24 = $row24["prod_id"]; $prod_url_desc24 = $row24["prod_url_desc"]; $link_query = BuildLinkQuery($navchild_id, "", $prodcat_id23, $prod_id24, ""); break; } } break; } } if ($cfg_clean_urls) { $href_link = $prod_url_desc24."/".$link_query; } else { $href_link = $navchild_link."?product_description=".$prod_url_desc24."&product_query=".$link_query; } } else { if ($cfg_clean_urls) { if ($navparent_link_desc != $navchild_link_desc) { $href_link = $navparent_link_desc."/".$navchild_link_desc; } else { $href_link = $navchild_link_desc; } } else { $href_link = $navchild_link; } } if ($navchild_id != $nv) { print "".$navchild_name."

\n"; } else { print "\n"; } } print "
\n"; } } ?>