<{php}> global $xoopsDB,$xoopsModule; $sql="select menuid,itemname,itemurl from ".$xoopsDB->prefix("tad_themes_menu")." where of_level=0 and status='1' order by position"; $result = $xoopsDB->query($sql) or redirect_header($_SERVER['PHP_SELF'],3, mysql_error()); while(list($menuid,$itemname,$itemurl)=$xoopsDB->fetchRow($result)){ $option=""; $sql="select itemname,itemurl from ".$xoopsDB->prefix("tad_themes_menu")." where of_level='$menuid' and status='1' order by position"; $result2 = $xoopsDB->query($sql) or redirect_header($_SERVER['PHP_SELF'],3, mysql_error()); while(list($name,$url)=$xoopsDB->fetchRow($result2)){ $option.= "\t\t\t
- {$name}
\n"; } if(empty($option)){ echo "
- {$itemname}
"; }else{ echo "
- $itemname
  $option
"; } } <{/php}>