<?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>
    <div class="clear"></div>
<?php if($action=='pubthread'){?>
	<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">
				<?php include("editor.tpl.php");?>
		</td>
		</tr>
		<?php if($allowedauthcode{3}){ ?>
		<tr>
				<td>验证码</td>
				<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>
<?php }elseif($action='modifythread'){?>
	<form enctype="multipart/form-data" method="post" action="post.php?action=updatethread&tid=<?php echo $modifyinfo['tid']?>&forid=<?php echo $modifyinfo['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" value="<?php echo $modifyinfo['title']?>"></td>
			</tr>
			 <tr>
				<th valign="top" >内容</th>
				<td valign="top"><?php include("editor.tpl.php");?></td>
			</tr>
			<?php if(!empty($modthreadattachs)){?>
			<tr><th valign="top" >&nbsp;</th><td >
<table>
			<tr>
				<th width="60%" class="font_12">文章附件</th>
				<th width="10%" class="font_12">附件大小</th>
				<th width="22%" class="font_12">附件类型</th>
				<th width="8%" class="font_12">下载</th>
			</tr>
   <?php
	foreach($modthreadattachs as $key => $val){
	?>
	<tr>
		  <td>
		  <div id="attach<?php echo $key?>">		 
				[<a href="###" onclick="deleteattach('thread',<?php echo $mid?>,<?php echo $key?>,true)">删除</a>] 
				[<a href="###" onclick="modifyattach('<?php echo $key?>')">修改</a>] 
				[<a href="###" onclick="insertAttachtext('<?php echo $key?>');return false;">插入</a>]
				<?php echo '('.$key.') '.$val['name']?>
				</div>
				<span id="modifyattach<?php echo $key?>"></span>
			</td>
			<td><?php echo sizecount($val['size'])?></td>
			<td><?php echo $val['type']?></td>
			<td><?php echo $val['downtimes']?></td>
			</td>
   </tr>
<?php		}?>

   </table>
				</td>
				</tr>
<?php		}?>
				<tr>
		<th>&nbsp;</th>
		<td ><input type="submit" value="修  改" class="postmsgbtn"></td>
			    </tr>
				</table>
			<div class="clear"></div>
			</div>
		</div>
		<div class="rl_d">&nbsp;</div>
	</div>
	</form>
<?php }?>
		</div>
		<div class="rl_d">&nbsp;</div>
	</div>
	</form>

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