<? require "header.php"?>
<?
/**
 * @version		1.0
 * @package		HonoWeb->HonoBBS
 * @copyright	Copyright (C) HonoWeb. All rights reserved.
 * @Website		www.honoweb.com.您好
 */
 ?>
<?
	$advtype="4";
?>
<html>
<head>
<title><?=$bbs_config_row['bbs_name']?></title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link href="<?=$T_BBS_Style_CSS?>" rel="stylesheet" type="text/css">
<style type="text/css">
<!--

.style1 {font-size: 12px}
.style7 {
	color: #003399;
	font-weight: bold;
}
.style10 {
	color: #FFFFFF;
	font-weight: bold;
}
.style12 {
	color: #FFFFFF;
	font-size: 12px;
}
.style14 {color: #336666; font-weight: bold;}
-->
</style>
</head>
<body>
<form name="form1" id="form1"  method="post" >
  <table border="0" cellpadding="0"  cellspacing="0" class="firsttable">
    <tr>
      <td align="center" valign="top">
	  	<table  cellpadding="0" cellspacing="0"  class="centertable" >
      		<tr> 
            	<td align="center"><? include "top.php"?> </td>
       		</tr>
        	<tr>
        	  <td align="center">&nbsp;</td>
      	  </tr>
        	<tr>
        	  <td align="center"><? include "info.php"?></td>
      	  </tr>
        	<tr>
        	  <td align="center">&nbsp;</td>
      	  </tr>
        	<tr>
        	  <td align="center">			  
			  <?
			  $sql="select * from ".$TableBbs_category." where pid=0 and is_show=1 order by sortid" ;
			  $query=$db->query($sql);
			  $sql1="select a.*,b.id as bid,b.bcategoryid,b.categoryid,b.title,b.username as b_username,b.publictime from ".$TableBbs_category." as a left join ".$TableBbs_content." as b on a.id=b.categoryid and a.pid<>0 and a.topic_id=b.id   order by a.pid,sortid " ;
			  $result=$db->getAll($sql1);
			  while($object=$db->fetch_object($query))
			  {
			  		if($object->is_show!=1) continue;
		     ?>			  <table width="100%"  border="0" cellspacing="0" cellpadding="0">
                <tr>
                  <td colspan="2" class="bar" style="padding-left:10px; "><img src="<?=$BBSFolder?>/images/doticon.gif" width="10" height="9"> <font class="bar1"><?=$object->name?></font> </td>
                </tr>
				<?
				for($i=0;$i<count($result);$i++)
				{
					if($object->id==$result[$i][pid])
					{
						if($result[$i]['is_show']!=1) continue;
				?>
                <tr>
                  
                  <td class="righttd">
				  <table width="100%"  border="0" cellpadding="0" cellspacing="0" class="righttop">
                    <tr>
                      <td class="righttop_left">
					  <div class="div"> <a href="<?=$BBSFolder?>/forum.php?bcatid=<?=$result[$i][pid]?>&scatid=<?=$result[$i][id]?>" ><font class="link1">『 <?=$result[$i][name]?> 』 </font></a> </div>
					  <div class="div1"> <img src="<?=$BBSFolder?>/images/arrow.gif" width="10" height="10"><?=$result[$i][description]?></div>					  </td>
                      <td class="righttop_center">
					  <img width="80" height="50"  src="<?=$BBSFolder?>/upload/bbs/category/<? $pic="default.gif";
												if(!empty($result[$i][picture]))
													$pic=$result[$i][id].$result[$i][picture]; echo $pic;?>" border="0" >					  </td>
                      <td class="righttop_right">
					  主题：<a href='<?=$BBSFolder?>/answer.php?cid=<?=$result[$i][bid]?>&bcatid=<?=$result[$i][bcategoryid]?>&scatid=<?=$result[$i][categoryid]?>'><font class="link1"><?=substring($result[$i][title],28)?></font></a><br>
					  作者：<?=$result[$i][b_username]?><br>
					  最后更新：<?=$result[$i][publictime]?><img src="<?=$BBSFolder?>/images/leftarrow.gif" border="0"><br>					  </td>
                    </tr>
                  </table>				  <table width="100%"  border="0" cellpadding="0" cellspacing="0" class="rightbottom">
                    <tr>
                      <td>&nbsp;</td>
                      <td class="rightbottom_right">&nbsp;</td>
                    </tr>
                  </table></td>
                </tr>
				<?
					}
				}
				?>
              </table><br>
			  <?
			  }
			  ?>			  </td>
      	  </tr>
        	<tr>
        	  <td align="center" ><? include "link.php"?></td>
       	  </tr>
        	<tr>
        	  <td align="center" >&nbsp;</td>
      	  </tr>
        	<tr> 
       		  <td align="center" >&nbsp;			  </td>
          </tr>
		  <tr>
			<td><? include "bottom.php"?></td>
		  </tr>
        </table>
	  </td>
    </tr>
</table>
</form>
</body>
</html>

<? $db->close_db();?>