<?php
include("header.tpl.php");
include("bodytop.tpl.php"); 
?>
<div class="g_navigation">
		<a href="index.php">网站首页</a> >> <a href="forums.php"><?php echo $forumname?></a> >> <a href="forumdisplay.php?forid=<?php echo $forid?>"><?php echo $forumcategory[$forid]['forumtitle']?></a> >> <?php echo $allthread['title']?>
</div>
<div class="clear"></div>    
<div class="pages_btns font_14">
<?php	echo $multipage?>
<div class="postbtn">
<a href="post.php?action=pubreply&typeid=3&bid=<?php echo $tid?>"><img src="<?php echo $templatedir?>images/reply.gif" /></a>
</div>
</div>
<div class="clear"></div>    
<div id="viewthreadlist">
<div class="viewthreadhead"><label><?php echo $allthread['title']?></label></div>
			<table class="threadtab">
				<tr>
				  <td valign="top" class="postauthor">
				  <?php if($allthread['uid']&&empty($allthread['userid'])){?>
				  <cite><s><?php echo $allthread['useraccount']?></s> (<?php echo $allthread['ip1'].'.'.$allthread['ip2'].'.*'?>)</cite>
				   <ul>
				       <li> 该用户已经被删除</li>
					<?php }else{ ?>
					<cite><?php echo $allthread['useraccount']?> (<?php echo $allthread['ip1'].'.'.$allthread['ip2'].'.*'?>)</cite>
					  <div class="authorface"><img src="images/userface/<?php echo $allthread['userface']?>"></div>
					  <ul>
				       <li> 用户组：<?php echo $groupnames[$allthread['gid']][0]?></li>
					   <?php if($allthread['uid']){?>
					   <li>帖子数：<?php echo $allthread['postcount']?></li>
					   <li>注册时间：<?php echo gmdate('Y-n-j',$allthread['registertime']+28800)?></li>	
					   <?php }?>	
					   <?php }?>
					</ul>
				</td>

		  <td valign="top" class="thread_r">
		   <div class="postinfo">
		   <cite>楼主</cite>
			  <em onclick="$('threadmessage_<?php echo $allthread['tid']?>').className='t_bigfont'">大</em>
			  <em onclick="$('threadmessage_<?php echo $allthread['tid']?>').className='t_msgfont'">中</em>
			  <em onclick="$('threadmessage_<?php echo $allthread['tid']?>').className='t_smallfont'">小</em>
			  
			  发表时间：<?php echo gmdate('Y-n-j H:i',$allthread['subtime']+28800)?>
		</div>

		<div id="threadmessage_<?php echo $allthread['tid']?>" class="t_msgfont">
		<?php echo $message?>
		<?php  if(!empty($downattachs)){?>
		  <div class="t_downtitle">附件下载</div>
		<?php foreach($downattachs as $v){?>
			 <div class="t_down font_12">
				<?php  echo $v['icon'].' <a href="download.php?fid='.$v['fid'].'">'.$v['name'].'</a> '.' ('.sizecount($v['size']).') (下载次数:'.$v['downtimes'].')'; ?>
					 </div>
				 <?php  } }?>				 
			   </td>
		</tr>
   <tr>
			  <td class="postauthor"></td>
			  <td class="thread_r">
			  <div class="postaction">  
			  <span onclick="window.scrollTo(0,0);">TOP</span>
			  <?php if($pervalue{3}){?>
			  <a href="post.php?ipost=modifythread&mid=<?php echo $allthread['tid']?>">修改</a>
			  <?php }?>
			  <?php if($pervalue{2}){?>
			  <a href="###" onclick="onetsetting('delete',<?php echo $allthread['forid']?>)">删除</a>
			  
			  <?php }?>
			  <?php if($pervalue{6}){?>

				  <?php if($allthread['top']){?>
				  <a href="###" onclick="onetsetting('unsettop',<?php echo $allthread['forid']?>)">取消置顶</a>
				  <?php }else{?>
				  <a href="###" onclick="onetsetting('settop',<?php echo $allthread['forid']?>)">置顶</a>
				  <?php }?>

			  <?php }?>
			<?php if($pervalue{4}){?>
					 <?php if($allthread['hlight']){?>
				  <a href="###" onclick="onetsetting('unsethlight',<?php echo $allthread['forid']?>)">取消高亮</a> 
				   <?php }else{?>
				  <a href="###" onclick="onetsetting('sethlight',<?php echo $allthread['forid']?>)">高亮显示</a>
				  <?php }?>
			  <?php }?>
			   <?php if($pervalue{5}){?>
			   <a href="###" onclick="onetsetting('unpriority',<?php echo $allthread['forid']?>)">取消优先</a>
			  <a href="###" onclick="onetsetting('priority',<?php echo $allthread['forid']?>)">优先</a>
			  <?php }?>
			  </div>
			  </td>
			  </tr>
				</table>
		</div>

<?php foreach($replys as $val){?>
<table class="posttab">
  <tr>
       <td valign="top" class="postauthor">
	   			  <?php if($val['reply_uid']&&!$val['uid']){?>
					<cite><s><?php echo $val['postname']?>(<?php echo $val['ip']?>)</s></cite>
				  <div class="authorface"><img src="images/userface/<?php echo $val['userface']?>"></div>
				   <center><div> 该用户已经被删除 </div></center>
				  <?}else{?>
	   			<cite><?php echo $val['userid']?>(<?php echo $val['ip']?>)</cite>
				  <div class="authorface"><img src="images/userface/<?php echo $val['userface']?>"></div>
				  <?php }?>
	   			    <ul>
				       <li> 用户组：<?php echo $groupnames[$val['gid']][0]?></li>
					   <?php if($val['uid']){?>
					   <li>帖子数：<?php echo $val['postcount']?></li>
					   <li>注册时间：<?php echo gmdate('Y-n-j',$val['registertime']+28800)?></li>	
					   <?php }?>			   
					</ul>
      </td>
    <td valign="top" class="thread_r">
	    <div class="postinfo">
	 <cite><?php echo $val['floor']?>楼</cite>
	  <em onclick="$('postmessage_<?php echo $val['rid']?>').className='t_bigfont'">大</em>
	  <em onclick="$('postmessage_<?php echo $val['rid']?>').className='t_msgfont'">中</em>
	  <em onclick="$('postmessage_<?php echo $val['rid']?>').className='t_smallfont'">小</em>
	  回复时间：<?php echo gmdate('Y-n-j H:i',$val['subtime']+28800)?>
	    </div>

	  <div id="postmessage_<?php echo $val['rid']?>" class="t_msgfont">
	  
	  <?php  echo $val['content'];?></div>

	   <?php  if(!empty($replydownattachs[$val['rid']])){?>
	  <div class="t_downtitle">附件下载</div>
	  <?php foreach($replydownattachs[$val['rid']] as $v){?>
		 <div class="t_down font_12"><?php  echo $v['icon'].' <a href="download.php?fid='.$v['fid'].'">'.$v['name'].'</a> '.' ('.sizecount($v['size']).') (下载次数:'.$v['downtimes'].')'; ?></div>
	  <?php  } }?>
   </td>
  </tr>
   <tr>
			  <td class="postauthor"></td>
			  <td class="thread_r"><div class="postaction">

			  <a href="###" onclick="window.scrollTo(0,0);">TOP</a>
			 <?php if(($pervalue{1} && $val['reply_uid']==$uid) || $pervalue{15}){?>
			    <a href="post.php?ipost=modifyreply&mid=<?php echo $val['rid']?>">修改</a>
			  <?php }?>
			  <?php if(($pervalue{0} && $val['reply_uid']==$uid) || $pervalue{15}){?>
			  <a href="###" onclick="delreply(<?php echo $val['rid']?>)">删除</a>
			  <?php }?>
			</div>
		</td>
	</tr>
</table>
  <?php
	$floor++;   
	   }?>   
<div class="pages_btns font_14">
<?php	echo $multipage?>
<div class="postbtn">
<a href="post.php?action=pubreply&typeid=3&bid=<?php echo $tid?>"><img src="<?php echo $templatedir?>images/reply.gif" /></a>
</div>
</div>

<?php if($pervalue{8}){?>
	<form enctype="multipart/form-data" method="post" action="post.php?position=sitefont&action=savereply&typeid=3&bid=<?php echo $tid?>" onsubmit="parseurl()">
	<div id="postmsg" class="bord">
	<div class="threadlist_head"><label>快速发帖</label></div>
	  <table class="replytab">
		<tr>
				<td class="left" valign="top">回复内容</td>
			    <td valign="top"><?php include("editor.tpl.php");?></td>
	    </tr>
	<?php if($allowedauthcode{2}){ ?>
		<tr>
				<td>验证码</td>
				<td>
			
				<input type="text" name="replyproductauthcode" class="authcode" style="margin-left:5px;"> 
				<div id="iauthcodediv" ></div>
		        <SCRIPT LANGUAGE="JavaScript">
					changeauthcode();
				</SCRIPT>
				</td>
		</tr>
		  	<?php }?>
	         <tr>
				<td>&nbsp;</td>
				<td><input type="submit" value="发表回复" class="postmsgbtn"></td>
	        </tr>
	</table>
	</div>
	</form>
<?php }?>

<form id="one_threadlist" method="post">
<?php if($allthread['top']){?>
<input type="hidden" name="top_thread_check[]" value="<?php echo $allthread['tid']?>">
<?php }else{?>
<input type="hidden" name="thread_check[]" value="<?php echo $allthread['tid']?>">
<?php }?>
</form>

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

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

