<?php
	include("header.tpl.php");
	include("bodytop.tpl.php"); 
	include("navigation.tpl.php"); 
?>
	<link rel="stylesheet" type="text/css" href="templates/<?php echo $sytle='default'?>/editor.css" />
	<script language=javascript src="./engine/js/attach.js"></script>
	<script language=javascript src="./engine/js/editor.js"></script>
	<script language=javascript src="./engine/js/menu.js"></script>
	<script language=javascript src="./engine/js/calendar.js"></script>

	<div class="g_navigation">
		<a href="index.php">网站首页</a> >> <a href="forums.php"><?php echo $forumname?></a> >><?php echo $forumtitle?>
	</div>
 <div class="clear"></div>
	<div class="pages_btns font_14">
	<?php echo $multipage?>
		<?php if($pervalue{10}){ ?>
		<div class="postbtn"><a href="post.php?action=pubthread&forid=<?php echo $forid?>">发 帖</a></div>
		<?php }?>
	</div>

 <div class="clear"></div>
	<div id="threadlist">
       <div class="rl_u">&nbsp;</div>
		<div class="content"><h2><?php echo $forumtitle?></h2><br />
		<form id="form_threadlist" method="post" >
			<table class="threadtable">
				<tr>
				  <th  height="25">&nbsp;</th>
					<th align="left">标题</th>
					<th align="left">发帖人</th>
					<th align="center"> 查看/回复</th>
					<th align="center">发表时间</th>
				</tr>
				<?php foreach($topthreads as $key => $topthread){?>
			<tbody id="thead">
				<tr>
				  <td class="thread_icon_label" height="40">&nbsp;</td>
					<td class="thread_title_label">
					<?php if($pervalue{15}){?>
					<input type="checkbox" id="top_thread_check_<?php echo $key?>" name="top_thread_check[]" value="<?php echo $topthread['tid']?>">
					<?php }?>
					<img src="templates/default/images/topicon.gif" alt="置顶主题" class="absmiddle"  > 
					<a href="viewthread.php?tid=<?php echo $topthread['tid']?>"> 
					<?php echo height_light($topthread['title'],$topthread['hlight'],$hlightway)?></a></td>
					<td class="thread_author_label"><?php echo $topthread['useraccount']?></td>
					<td class="thread_reply_label"><?php echo $topthread['view']?>/<?php echo $topthread['review']?></td>
					<td class="thread_subtime_label"><?php echo gmdate($forumcategory[$forid]['dateformat'],$topthread['subtime']+8*3600)?></td>
				</tr>
			</tbody>
			<?php }?>



			<?php foreach($threads as $key => $thread){?>
			<tbody id="thead">
				<tr>
				  <td class="thread_icon_label" height="40">&nbsp;</td>
					<td class="thread_title_label">
					<?php if($pervalue{15}){?>
					<input type="checkbox" id="thread_check_<?php echo $key?>" name="thread_check[]" value="<?php echo $thread['tid']?>">
					<?php }?>
					<a href="viewthread.php?tid=<?php echo $thread['tid']?>">	<?php echo height_light($thread['title'],$thread['hlight'],$hlightway)?></a>
					</td>
					<td class="thread_author_label"><?php echo $thread['useraccount']?></td>
					<td class="thread_reply_label"><?php echo $thread['view']?>/<?php echo $thread['review']?></td>
					<td class="thread_subtime_label"><?php echo gmdate($forumcategory[$forid]['dateformat'],$thread['subtime'])?></td>
				</tr>
			</tbody>
			<?php }?>
		</table>
					<div id="moveform" style="display:none;">
					<select id="move_select_cid" name="move_select_cid">
						<option value="0,0" selected >论坛根分类</option >
							<?php echo $echoselectform?>
                    </select>
					<button onclick="tsetting('post.php?','move',<?php echo $forid?>)"> 开始转移 </button> 
					</div>
		</form>
			<?php if($pervalue{15}){?>
				<div id="toolbox">
				<input type="checkbox" name="thread_check_all" id="thread_check_all" onclick="checkall_onclick('thread')"> 全选
					<button onclick="tsetting('post.php?','settop',<?php echo $forid?>)">主题置顶</button>
					<button onclick="tsetting('post.php?','unsettop',<?php echo $forid?>)"> 取消置顶</button>
					<button onclick="tsetting('post.php?','priority',<?php echo $forid?>)"> 主题优先</button>
					<button onclick="tsetting('post.php?','unpriority',<?php echo $forid?>)"> 取消优先</button>
					<button onclick="tsetting('post.php?','sethlight',<?php echo $forid?>)"> 高亮显示</button>
					<button onclick="tsetting('post.php?','unsethlight',<?php echo $forid?>)"> 取消高亮</button>
					<button onclick="tsetting('post.php?','delete',<?php echo $forid?>)"> 删除主题</button>
					<button onclick='showmoveform()'> 转移主题</button>
				</div>
			   <?php }?>
	  </div>
	   <div class="rl_d">&nbsp;</div>
	</div>
<div class="clear"></div>
	<div class="pages_btns font_14">
	<?php echo $multipage?>
		<?php if($pervalue{10}){ ?>
		<div class="postbtn"><a href="post.php?action=pubthread&forid=<?php echo $forid?>">发 帖</a></div>
		<?php }?>
	
	<div class="clear"></div>
			<?php if($allowedqpost=1){?>
	<form enctype="multipart/form-data" method="post" action="post.php?action=savethread&forid=<?php echo $forid?>" onsubmit="parseurl()">
	<div id="postmsg">
       <div class="rl_u">&nbsp;</div>
		<div class="content">
			<h2>发布主题</h2>
			<div class="div_p font_14">
			   <table>
		<tr>
				<th width="20%">标题</th>
			<td><input type="text" name="posttitle" class="postmsgbox"></td>
			</tr>
				<tr>
		<th  valign="top">内容</th>
		 <td valign="top">
				<textarea id="g_editor_doc" name="g_editor_doc" class="g_q_editor_textarea"></textarea>
		</td>
		</tr>

		<?php if($allowedauthcode{3}){ ?>
		<tr>
				<th>验证码</th>
				<td>
				<input type="text" name="pubthreadauthcode" class="authcode" style="margin-left:5px;"> 
				<div id="iauthcodediv"></div>
		        <SCRIPT LANGUAGE="JavaScript">
					changeauthcode();
				</SCRIPT>
				</td>
		</tr>
		  	<?php }?>
				<tr>
			<th>&nbsp;</th>
			<td><input type="submit" value="发  布" class="postmsgbtn"></td>
			    </tr>
				</table>
			<div class="clear"></div>
			</div>
		</form>
	</div>	
	</div>
		<?php }?>
		<div class="rl_d">&nbsp;</div>
	</div>

<div class="clear"></div>

		<div id="friendlylink">
		<div class="rl_u">&nbsp;</div>
		<div class="content"><h2>友情链接</h2></div>
		<div class="rl_d">&nbsp;</div>
	</div>

<?php
include("tail.tpl.php"); 
?>

