<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title><?php echo $nav?> - powered by dedecms</title>
<link href="template/default/style/ask_base.css" rel="stylesheet" type="text/css" />
<link href="template/default/style/ask_index.css" rel="stylesheet" type="text/css" />
</head>
<body>
<!--顶部全站导航-->
<div class="sitenav cbody">
	<?php include_once(dirname(__FILE__).'/headmenu.htm'); ?>
</div>

<div class="toplogo cbody margintop">
 	<div class="logobox">
		<img src="template/default/images/toplogo.gif" width="279" height="43" alt="" />	</div>
	<div class="logoright">
		<?php
		if($uid){
			echo '欢迎您：'. $username;
			echo " <a href='../member/control.php'>控制面板</a>";
			echo " <a href=\"../member/index.php?uid=$username\">我的空间</a>";
			echo '  <a href="../member/index_do.php?fmdo=login&dopost=exit">退出</a>';
		}else{
			echo '您好，请您先 <a href="../member/login.php?gourl=../ask/">登陆</a> 或者 <a href="../member/index_do.php?fmdo=user&dopost=regnew">注册</a>';
		}
		?>
	</div>
</div>

<div class="topbox cbody margintop">
	<div class="menu">
		<ul>
			<li><a href="./">问答首页</a></li>
			<li><a href="type.php">全部分类</a></li>
			<li><a href="browser.php?lm=1">精彩问题</a></li>
			<li class="menuright"></li>
		</ul>
	</div>
	<div class="search">
		<form action="search.php?action=search" method="post">
			<input type="text" name="q" value="" class="searchinput"/>
			<input name="" type="submit" value="搜索答案" class="submit"/>
			<input onclick="location.href='post.php'" name="按钮" type="button" class="postqa" value="我要提问"/>
		</form>
	</div>
</div>

<div class="main cbody margintop">
	<!--左侧分类-->
	<div class="leftclass">
		<div class="title">问题分类</div>
		<div class="classbox">
<?php
$temp = 0;
foreach($asktypes as $asktype)
{

	if($asktype['reid'] == 0){
		if($temp > 0)
		{
			echo "</dd></dl>\n";
		}

		echo "<dl><dt>\n<a href=\"browser.php?tid=".$asktype['id'].'">'.$asktype['name']."</a></dt>\n<dd>";
		$temp++;
	}else
	{
		echo ' <a href="browser.php?tid2='.$asktype['id'].'">'.$asktype['name']."</a>\n";
	}

}
echo "</dd></dl>\n";
?>

		</div>
	</div>
	<!--中间列表-->
	<div class="mlist">


		<!--推荐问题-->
		<div class="tjbox">
			<div class="title"><a href="browser.php?lm=1">推荐问题</a></div>
			<div class="tlist">
				<dl>
<?php
foreach($digests as $digest)
{
	$typedata = ' <a href="browser.php?tid='.$digest['tid'].'">'.$digest['tidname'].'</a>';
	if($digest['tid2'] != 0)
	{
		$typedata = '<a href="browser.php?tid2='.$digest['tid2'].'">'.$digest['tid2name']."</a>";
	}

	echo '<dd><span class="tclass">['.$typedata.']</span><span class="tlink"><a href="question.php?id='.$digest['id'].'">'.$digest['title'].'</a></span></dd>';
}
?>
				</dl>
			</div>
		</div>

		<!--待解决问题-->
		<div class="qalist margintop">
			<dl>
				<dt><a href="browser.php?lm=2">待解决的问题</a></dt>
<?php
foreach($solvingasks as $solvingask)
{
	$typedata = ' <a href="browser.php?tid='.$solvingask['tid'].'">'.$solvingask['tidname'].'</a>';
	if($solvingask['tid2'] != 0)
	{
		$typedata = '<a href="browser.php?tid2='.$solvingask['tid2'].'">'.$solvingask['tid2name']."</a>";
	}

	echo '<dd><span class="tclass">['.$typedata.']</span><span class="tlink"><a href="question.php?id='.$solvingask['id'].'">'.$solvingask['title'].'</a></span></dd>';
}
?>
			</dl>
		</div>

		<!--新解决问题-->
		<div class="qalist margintop">
			<dl>
				<dt><a href="browser.php?lm=3">新解决的问题</a></dt>
<?php
foreach($solvedasks as $solvedask)
{
	$typedata = ' <a href="browser.php?tid='.$solvedask['tid'].'">'.$solvedask['tidname'].'</a>';
	if($solvedask['tid2'] != 0)
	{
		$typedata = '<a href="browser.php?tid2='.$solvedask['tid2'].'">'.$solvedask['tid2name']."</a>";
	}

	echo '<dd><span class="tclass">['.$typedata.']</span><span class="tlink"><a href="question.php?id='.$solvedask['id'].'">'.$solvedask['title'].'</a></span></dd>';
}
?>
			</dl>
		</div>

		<!--高分悬赏问题-->
		<div class="qalist margintop">
			<dl>
				<dt><a href="browser.php?lm=4">高分悬赏问题</a></dt>
<?php
foreach($highrewardasks as $highrewardask)
{
	$typedata = ' <a href="browser.php?tid='.$highrewardask['tid'].'">'.$highrewardask['tidname'].'</a>';
	if($highrewardask['tid2'] != 0)
	{
		$typedata = '<a href="browser.php?tid2='.$highrewardask['tid2'].'">'.$highrewardask['tid2name']."</a>";
	}

	echo '<dd><span class="tclass">['.$typedata.']</span><span class="tlink"><a href="question.php?id='.$highrewardask['id'].'">'.$highrewardask['title'].'</a></span></dd>';
}
?>			</dl>
		</div>
	</div>

	<!--右侧列表-->
	<div class="pright">
		<!--会员登录-->
		<!--
		<div class="rlist">
			<div class="rtitle">会员登陆</div>
			<div class="rbox userlogin">
				<dl>
					<dt>用户名：</dt>
					<dd><input name="username" class="username" type="text" maxlength="20" /></dd>
				</dl>
				<dl>
					<dt>密码：</dt>
					<dd><input name="password" class="password" type="password" maxlength="20" /></dd>
				</dl>
				<div class="ulsubmit">
					<input name="button" type="button" class="submit" value="登陆" />
					<a href="#">注册帐号</a>
				</div>
			</div>
		</div>
		-->
		<!--统计信息-->
		<div class="rlist">
			<dl class="askcount">
				<dd><span>全部的问题：</span><?php echo $solvingnum+$solvednum; ?> 条</dd>
				<dd><span>已解决问题：</span><?php echo $solvednum ?> 条</dd>
				<dd><span>未解决问题：</span><?php echo $solvingnum ?> 条</dd>
			</dl>
		</div>

		<!--总积分排行-->
		<div class="rlist margintop">
			<div class="rtitle">总积分排行</div>
			<div class="rbox paihang">
				<dl>
<?php
foreach($topmembers as $topmember)
{
	$typedata = ' <a href="../member/index.php?uid='.$topmember['userid'].'">'.$topmember['userid'].'</a>';

	echo '<dd><span class="name">'.$typedata.'</span><span class="jifen"><img src="template/default/images/ico_23.gif" /> '.$topmember['scores'].'</span></dd>';
}
?>
				</dl>
			</div>
		</div>
	</div>
	<div class="floatclear"><!--清除浮动--></div>
</div>

<!--页面底部-->
<div class="footer cbody margintop">
	<div class="copyright">
    <span><?php echo $cfg_powerby?><a href="http://www.miibeian.gov.cn/"><?php echo $cfg_beian?></a></span><br />
		Powered by <a href="http://www.dedecms.com/">DedeCms <?php echo $cfg_version ?></a> &copy; 2004-2008  <a href="http://www.desdev.cn/">DesDev Inc.</a>		
	</div>
	<div class="floatclear"></div>
</div>

</body>
</html>