View Single Post
Old 10-30-2009, 08:34 AM   #5 (permalink)
mombunheng
The Wanderer
 
mombunheng's Avatar
 
Join Date: Oct 2009
Posts: 5
Thanks: 0
mombunheng is on a distinguished road
Default

thanks for your participation for the menus design, I am currently using the following code let me know if you have any idea better than this.

CODE:
----------------------------------------------
<ul>
<li class="maintitle"><a href="/wcscambodia/section.php?sectid=<?php echo $sectid;?>"><?php echo $sect_name;?></a></li>
<?php
$currentcat = (int)($_GET['catid']);
$listid = '';
$sql = "SELECT cat_label, cat_id FROM tblcategories WHERE parent_sect = $sectid";
$result = dbQuery($sql);
while ($row = dbFetchAssoc($result)) {
?>

<li<?php if ($row['cat_id'] == $currentcat){$listid = ' id="current"'; echo $listid; }?>>
<a href="subsection.php?catid=<?php echo $row['cat_id'];?>"><?php echo $row['cat_label'];?></a>
</li>
<?php
if ($row['cat_id'] == $currentcat){
echo '<ul class="subul">';
$sqlm = "SELECT * FROM tblarticle WHERE article_cat = $currentcat";
$mresult = dbQuery($sqlm);
while ($rowm = dbFetchAssoc($mresult)){
?>
<li class="article"><a href="article.php?catid=<?php echo $currentcat;?>&page=<?php echo $rowm['article_id'];?>"><?php echo $rowm['article_title']?></a></li>
<?php
}
echo '</ul>';
}
?>
<?php }?>
</ul>
mombunheng is offline  
Reply With Quote