<?

require("datafile/superadmin.php");
require("datafile/config.php");
require("datafile/style.php");
require("global.php");
require("post_global.php");

if (!$action) $action="new";

if ($action=="new" || $action=="reply" || $action=="quote" )
// 灌水预防-----------
if ($flood_control && $username && !flood_limit($username,$flood_control)) {
	include("header.php");
	navi_bar($navi_bar_des,$navi_bar_l2,"灌水预防警告");
	$status="* 灌水预防机制已经打开，在 $flood_control 秒内不能发贴";
	print_err();
	include("footer.php");
	exit;
}
//---------------------------

if ($action=="new") {

	if (!$step) {
		include("header.php");
		navi_bar($navi_bar_des,$navi_bar_l2,"发表新文章");
		$status="* 发表一篇新文章";
		print_form();
		include("footer.php");
		exit;
	}
	elseif($step==2) {
		//----Check-------
		$check=check_data();

		if ($allow_upload && $attachment && $attachment != "none" && ereg("^php[0-9A-Za-z_.-]+$", basename($attachment))) $upload=1;
		else $upload=0;
		
		if ($check && $upload) {
		//-----User has uploaded some file-----
			if ($attachment_size>$max_upload_size) {
			  $check=0; $status='上传文件超过指定大小';
			}else{
			  $available_ext = explode(' ',$upload_type_available);
			  $extcount=count($available_ext); $is_ext_allowed=0;
			  for ($i=0; $i<$extcount; $i++) {
				$currentext=$available_ext[$i];
				if (eregi("\.\\$currentext$",$attachment_name)) {
			  	  $is_ext_allowed=1; break;
			  	}
			  }
			  if (!$is_ext_allowed) {$check=0; $status='上传文件的类型不符合准则';}
			}
		}

		if ($check) {

			if (!$usericon) $usericon="ran";
			if (!isset($articledes)) $articledes=""; else $articledes=stripslashes($articledes);

			//-----Check the input------
			$articlecontent=stripslashes($articlecontent); $articlecontent=safe_convert($articlecontent);
			$articletitle=str_replace('%a%','',$articletitle);
			$articletitle=stripslashes($articletitle); $articletitle=str_replace(",","，",$articletitle);
			$articletitle=safe_convert($articletitle); $articledes=safe_convert($articledes);

			if (file_exists("forum$forumid/list.php")) {
				$filecc=readfromfile("forum$forumid/list.php");
				//-----Let's get the Filename ( f_xxx )	
				$filename=get_next_filename($filecc,$forumid);
			}
			else $filename="f_1";

			if ($upload) {
				$upload_name="upload/forum${forumid}_$filename.$currentext";
				copy($attachment,$upload_name);
				$articletitle='%a%'.$articletitle;

				if (eregi("\.(gif|jpg|jpeg|png)$",$attachment_name)) {
				  $articlecontent="[img]images/attach/pic.gif[/img] 本主题相关图片如下：<br>[url=$upload_name][img]${upload_name}[/img][/url]<br><br>".$articlecontent;
				}elseif (eregi("\.(zip|rar)$",$attachment_name)) {
				  $articlecontent="[url=$upload_name][img]images/attach/zip.gif[/img] 本主题相关压缩包附件：[color=red]${attachment_name}[/color][/url]<br>".$articlecontent;
				}elseif (eregi("\.txt$",$attachment_name)) {
				  $articlecontent="[url=$upload_name][img]images/attach/txt.gif[/img] 本主题相关文本附件：[color=red]${attachment_name}[/color][/url]<br>".$articlecontent;
				}else {
				  $articlecontent="[url=$upload_name][img]images/attach/attach.gif[/img] 本主题相关附件：[color=red]${attachment_name}[/color][/url]<br>".$articlecontent;
				}
			}


			$lm=$articletitle.",".$username.",".$timestamp;
			$newlist="$articletitle|$username|$timestamp|$articledes|$usericon|$filename|0|0|$lm|0|\n";
			if (isset($filecc)) $newlist.=$filecc;
			$newlist=push_heldtopics($newlist); //----push the Held Topics to the beginning of the list
		
			writetofile("forum$forumid/list.php",$newlist);//------OK, write to the list-----
			
			$file_line=array($articletitle,
					$username,
					$articlecontent,
					$timestamp,
					convert_ip($REMOTE_ADDR),
					$usericon );
			if ($usesignature=="checkbox") $file_line[6]="1";  else $file_line[6]="0";
			$line_cc=implode("|",$file_line)."|\n";

			writetofile("forum$forumid/$filename",$line_cc,"a"); //-----OK, write to the f_xxxx -------
			
			if ($upload) $articletitle=str_replace('%a%','',$articletitle);
			send_suc();

			jump_page("viblist.php?forumid=$forumid","发表帖子成功",
			"<b>POST程式成功完成了发贴动作</b><br>
			你现在可以选择：<br><ul><li><a href='viblist.php?forumid=$forumid'>返回版块</a><br>
			<br></li>
			<li><a href='vibread.php?forumid=$forumid&filename=$filename'>返回主题</a><br>
			<br></li>
			<li><a href='viboard.php'>返回论坛首页</a></li></ul>");

		} else {
			include("header.php");
			navi_bar($navi_bar_des,$navi_bar_l2,"发生错误");
			print_err();
			include("footer.php");
			exit;
		}
	}
}

if ($action=="reply" || $action=="quote") {

	if (!$filename || !$forumid || !ereg("^f_[0-9]+$",$filename)) exit;
	if (!file_exists("forum$forumid/$filename")) exit;

	$oldlist=readfromfile("forum$forumid/list.php");
	$oldlist=explode("\n",$oldlist);
	$count=count($oldlist);

	for ($i=0; $i<$count; $i++ ) {
		//if (strpos($oldlist[$i],"|$filename|")) {
		$detail = explode("|", $oldlist[$i]);
		if ($detail[5]==$filename) {
			$new=explode("|",$oldlist[$i]);
			unset($oldlist[$i]); #$mark=$i;
			$oldlm=$new[8];
			break;
		}
	}
	if ($new[9]==1) {
		$status="该贴已被锁住，不可回复";
		include("header.php");
		navi_bar($navi_bar_des,$navi_bar_l2,"回复失败");
		print_err();
		include("footer.php");
		exit;
	}

	if (!$step) {
		$status="直接回复文章";
		$file_content=file("forum$forumid/$filename");
		$articletitle="回复:";
		if ($action=="quote") {
			$status="引用并回复文章";
			if ($file_content[$article]) {
				$info=explode("|",$file_content[$article]);
				$oruser=$info[1]; $ortitle=str_replace('%a%','',$info[0]); $ortime=get_date($info[3])." ".get_time($info[3]);
				$orcontent=$info[2];
				$orcontent=preg_replace("/\[quote\](.*)\[\/quote\]/is","",$orcontent);
				$orcontent=str_replace("<br>","\n",$orcontent);
				$contentall = explode("\n",$orcontent);
				if (count($contentall) > 4) {
					$orcontent = "$contentall[0]\n$contentall[1]\n$contentall[2]\n$contentall[3]\n.......";
				}
				$articlecontent="[quote][i][b]下面是引用{$oruser}于{$ortime}发表的{$ortitle}：[/b][/i]\n{$orcontent}[/quote]\n";
				$articletitle="回复:$ortitle";
			}
		}
		include("header.php");
		navi_bar($navi_bar_des,$navi_bar_l2,"回复文章");
		print_form();
		print_old($file_content);
		include("footer.php");
		exit;
	}
	elseif ($step==2) {
		//----Check-------
		$check=check_data();
		
		if ($allow_upload && $attachment && $attachment != "none" && ereg("^php[0-9A-Za-z_.-]+$", basename($attachment))) $upload=1;
		else $upload=0;
		
		if ($check && $upload) {
		//-----User has uploaded some file-----
			if ($attachment_size>$max_upload_size) {
			  $check=0; $status='上传文件超过指定大小';
			}else{
			  $available_ext = explode(' ',$upload_type_available);
			  $extcount=count($available_ext); $is_ext_allowed=0;
			  for ($i=0; $i<$extcount; $i++) {
				$currentext=$available_ext[$i];
				if (eregi("\.\\$currentext$",$attachment_name)) {
			  	  $is_ext_allowed=1; break;
			  	}
			  }
			  if (!$is_ext_allowed) {$check=0; $status='上传文件的类型不符合准则';}
			}
		}
		
		if ($check) {
			if (!$usericon) $usericon="ran";
			if (!isset($articledes)) $articledes=""; else $articledes=stripslashes($articledes);

			//-----Check the Input------
			$articlecontent=stripslashes($articlecontent);	$articletitle=stripslashes($articletitle);
			$articletitle=str_replace(",","，",$articletitle); $articletitle=safe_convert($articletitle);
			$articlecontent=safe_convert($articlecontent);	$articledes=safe_convert($articledes);

			if ($upload) {
				$upload_name="upload/forum${forumid}_".$filename."_".$timestamp.".".$currentext;
				copy($attachment,$upload_name);				

				if (eregi("\.(gif|jpg|jpeg|png)$",$attachment_name)) {
				  $articlecontent="[img]images/attach/pic.gif[/img] 本主题相关图片如下：<br>[url=$upload_name][img]${upload_name}[/img][/url]<br><br>".$articlecontent;
				}elseif (eregi("\.(zip|rar)$",$attachment_name)) {
				  $articlecontent="[url=$upload_name][img]images/attach/zip.gif[/img] 本主题相关压缩包附件：[color=red]${attachment_name}[/color][/url]<br>".$articlecontent;
				}elseif (eregi("\.txt$",$attachment_name)) {
				  $articlecontent="[url=$upload_name][img]images/attach/txt.gif[/img] 本主题相关文本附件：[color=red]${attachment_name}[/color][/url]<br>".$articlecontent;
				}else {
				  $articlecontent="[url=$upload_name][img]images/attach/attach.gif[/img] 本主题相关附件：[color=red]${attachment_name}[/color][/url]<br>".$articlecontent;
				}
			}
			
			//-----Do some preparation---
			$newcount=count($new); for ($j=11; $j<$newcount; $j++) unset($new[$j]);
			$lm=$articletitle.",".$username.",".$timestamp;
			$new[8]=$lm; $new[6]++;
			$new_line=implode("|",$new)."|\n";
			$oldlist=implode("\n",$oldlist);
			$newlist=push_heldtopics($new_line.$oldlist);

			writetofile("forum$forumid/list.php",$newlist); //OK, write to the list
			
			$file_line=array($articletitle,
					$username,
					$articlecontent,
					$timestamp,
					convert_ip($REMOTE_ADDR),
					$usericon );
			if ($usesignature=="checkbox") $file_line[6]="1"; else $file_line[6]="0";
			$line_cc=implode("|",$file_line)."|\n";

			writetofile("forum$forumid/$filename",$line_cc,"a");//OK, write to the f_xxx

			//------OK,send e-mail to the latest user--------
			if ($send_mail==1) {
			$temp = explode("," , $oldlm);
			$receiver = $temp[1];
			if ($receiver != $username) {
			 $old_title=$temp[1];
			 $temp = get_user_info($receiver);
			 $send_address= $temp[3];
			 $textmessage="Hi, $receiver ,\n    这是『游戏永远』的邮件，\n    你在{$bbs_title}发的文章: $old_title\n    现在有人回复喽.快来看吧\n    {$script_pos}vibread.php?forumid=$forumid&filename=$filename\n    下次再有人参与主题时,我将不来打扰了\n\n___________________________________\n欢迎访问 Gaming.Ximan.Com ";
			 if (empty($temp[14]) || $temp[14]=="text") {
				//-----Send text Mail-----
				mail("$send_address", "你在『游戏永远』中有回复~~~", "$textmessage","From: $admin_email\nReply-To: $admin_email\nX-Mailer: VIB邮件快递");

			 } elseif ($temp[14]=="html") {
				//-----Send HTML Mail------
				send_HTML_mail();
			 }
			}
			}

			send_suc();
			jump_page("viblist.php?forumid=$forumid","回复帖子成功",
			"<b>POST程式成功完成了回复动作</b><br>
			你现在可以选择：<br><ul>
			<li><a href='viblist.php?forumid=$forumid'>返回版块</a><br>
			<br></li>
			<li><a href='vibread.php?forumid=$forumid&filename=$filename'>返回主题</a><br>
			<br></li>
			<li><a href='viboard.php'>返回论坛首页</a></li></ul>");

		} else {
			include("header.php");
		navi_bar($navi_bar_des,$navi_bar_l2,"发表失败");
			print_err();
			include("footer.php");
			exit;
		}
	}
}

if ($action=="modify") {
	if (!$filename || !$forumid || !ereg("^f_[0-9]+$",$filename)) exit;
	if (!file_exists("forum$forumid/$filename")) exit;
	$articlelist=file("forum$forumid/$filename");
	$count=count($articlelist);
	if (!isset($article) || !$articlelist[$article]) exit;
	list($oldarticletitle,$author,$oldarticlecontent,$time,$area,$oldicon)=explode("|",$articlelist[$article]);

	//------Check if the user got the right to modify--------
	$check_user=0;
	if ($login_status==1 && ($author==$username || $username==$admin_name || ($forum_admin && in_array($username,$forum_admin)) )) $check_user=1;

	if ($check_user==0) {
		$status="您没有权利修改该贴，请您以合适的身份登录(文章原作者 或者 管理员)";
		include("header.php");
		navi_bar($navi_bar_des,$navi_bar_l2,"发生错误");
		print_err();
		include("footer.php");
		exit;
	}

	if (!$step) {
		$articletitle=str_replace('%a%','',$oldarticletitle);
		$articlecontent=str_replace("<br>","\r\n",$oldarticlecontent);
		$status="* 修改一篇旧文章";
		include("header.php");
		navi_bar($navi_bar_des,$navi_bar_l2,"修改文章");
		print_form();
		include("footer.php");
		exit;
	}
	elseif($step==2) {
		if (!$usericon) $usericon=$oldicon;
		//----Check-------
		$check=check_data();
		if ($check) {

			//-----安全检查------
			$articlecontent=stripslashes($articlecontent);	$articletitle=stripslashes($articletitle);
			$articletitle=str_replace(",","，",$articletitle); $articletitle=safe_convert($articletitle);
			$articlecontent=safe_convert($articlecontent); $articledes=safe_convert($articledes);

			if ($article==0) {
				$lm=$articletitle.",".$username.",".$timestamp;
				$oldlist=readfromfile("forum$forumid/list.php");
				$oldlist=explode("\n",$oldlist);

				$listcount=count($oldlist);
				for ($j=0;$j<$listcount;$j++) {
					//if (strpos($oldlist[$i],"|$filename|")) {
					$listdetail=explode("|",$oldlist[$j]);
					if ($listdetail[5]==$filename) {
						$new_line=explode("|",$oldlist[$j]);//$listdetail;
						unset($oldlist[$j]);
					}
				}
				$oldlist=implode("\n",$oldlist);

				$new_line[0]=$articletitle;
				$new_line[3]=$articledes;
				if ($usericon) $new_line[4]=$usericon;
				$new_line[8]=$lm;
				$newlist=implode("|",$new_line)."\n".$oldlist;
				$newlist=push_heldtopics($newlist);

				writetofile("forum$forumid/list.php",$newlist); //ok, write to the list
			}
			$file_line=array($articletitle,
					$author,
					$articlecontent,
					$timestamp,
					convert_ip($REMOTE_ADDR),
					$usericon );
			if ($usesignature=="checkbox") $file_line[6]='1'; else $file_line[6]='0';
			$articlelist[$article]=implode("|",$file_line)."|\n";
			
			$articlelist=implode("",$articlelist);
			writetofile("forum$forumid/$filename",$articlelist);
			
			jump_page("viblist.php?forumid=$forumid","修改帖子成功",
			"<b>POST程式成功完成了修改动作</b><br>
			你现在可以选择：<br>
			<ul>
			<li><a href='viblist.php?forumid=$forumid'>返回版块</a><br>
			<br>
			</li>
			<li><a href='vibread.php?forumid=$forumid&filename=$filename'>返回主题</a><br>
			<br>
			</li>
			<li><a href='viboard.php'>返回论坛首页</a></li>
			</ul>");

		} else {
			include("header.php");
			navi_bar($navi_bar_des,$navi_bar_l2,"修改失败");
			print_err();
			include("footer.php");
			exit;
		}
	}
}

function print_old($oldlist) {
//-----取出旧文章供参考-----------
global $echo_reply,$vibcode_echo;
require("vibcode.lib");
$allow=array('pic'=>'yes','flash'=>'no','fontsize'=>'no');
	echo "<br><center>以前文章内容回顾</center>";
	$count	=	count($oldlist)-1;
	$lastreply =	max($count-$echo_reply,0);
	for ($i=$count; $i>=$lastreply; $i--) {
		if ($i==0) $oldlist[0] = str_replace('%a%', '', $oldlist[0]);
		echo "<hr size=1 width=650><table align=center width=550 cellspacing=1 cellpadding=2><tr><td>";
		$detail=explode("|",$oldlist[$i]);
		print("<b>&nbsp; {$detail[1]}： $detail[0]</b><br>".vibconvert($detail[2],$vibcode_echo));
		echo "</td></tr></table>";
	}
}
function print_form() {
global $login_status,$status,$articletitle,$articlecontent,$action,$forumid,
$filename,$article,$cautioncolor,$bordercolor,$subcolor,$max_post_length,
$titlecolor,$tablewidth,$vibcode_post,$timestamp,$postjs,$vibemote,$panelbar,
$loginform,$allow_upload,$max_upload_size,$upload_type_available;

?>
<script language="JavaScript1.2">
<!--

helpstat = false;
stprompt = true;
basic = false;
clckcnt = 0;
var postmaxchars = <?=$max_post_length?>;
ie = (document.all)? true:false
if (ie){
function ctlent(eventobject){if(event.ctrlKey && window.event.keyCode==13){this.document.FORM.submit();}}
}
function clckcntr() {
clckcnt++;
if(clckcnt > 1) {
	if(clckcnt > 2) { return false; }
	alert('贴子已经发出了......\n\n' + '请等待片刻......\n\n' + '不要重复按提交键，谢谢！');
	return false;
}
return true;
}

function thelp(swtch){
if (swtch == 1){
	basic = false;
	stprompt = false;
	helpstat = true;
	} else if (swtch == 0) {
		helpstat = false;
		stprompt = false;
		basic = true;
	} else if (swtch == 2) {
		helpstat = false;
		basic = false;
		stprompt = true;
	}
}

function AddText(NewCode) {
document.FORM.articlecontent.value+=NewCode
}
function validate(theform) {
	if (theform.articletitle.value=="" || theform.articlecontent.value=="") {
		alert("请完成标题和内容栏目.");
		clckcnt=0;
		return false; }
	if (postmaxchars != 0) {
		if (theform.articlecontent.value.length > <?=$max_post_length?>) {
			alert("你的信息太长了.\n\n请限制在 <?=$max_post_length?> 字节以内.\n当前已有 "+theform.articlecontent.value.length+" 字节.");
			clckcnt=0;
			return false; }
		else { return true; }
	} else { return true; }
}
function checklength(theform) {
	if (postmaxchars != 0) { message = "\n最大的字符为 <?=$max_post_length?> 字节."; }
	else { message = ""; }
	alert("你的信息已经有 "+theform.articlecontent.value.length+" 字节."+message);
}

//-->
</script>
<table width=<?=$tablewidth?> border=0 cellspacing=0 bgcolor=<?=$bordercolor?> cellpadding=0 align=center>
<form name="FORM" method=POST action="vibpost.php" onSubmit="return validate(this)" enctype="multipart/form-data">
<tr><td>
<table cellspacing=1 cellpadding=4 width=100% border=0>
<tr bgcolor=<?=$titlecolor ?>> 
<td background=images/style/catbg.gif colspan=3><b>&nbsp<?=$status?></b>
</td>
</tr>
<tr bgcolor=FFFFFF> 
<td valign=top width=25%><b>文章标题</b>：</td>
<td valign=top width=50%>
<input <? if (isset($articletitle)) echo "value='$articletitle'"; ?> maxlength=45 size=45 name=articletitle style="background-color:#ffffff; border: 1 double #B4B4B4" onMouseOver = "this.style.backgroundColor = '#E5F0FF'" onMouseOut = "this.style.backgroundColor = ''">
</td>
<td align=center rowspan=2 bgcolor=FFFFFF width=25%>
<table cellspacing=0 cellpadding=3 border=0>
<tr>
<td align=center>
<table cellspacing=0 cellpadding=0 width=70 bgcolor=<?=$bordercolor?> border=0><tr><td height=1></td></tr></table>
<table cellspacing=0 cellpadding=3 width=70 border=1 bordercolor=<?=$bordercolor?>>
<tr bgcolor=<?=$subcolor?>> 
<td align=middle><b><? echo get_time($timestamp); ?></b></td>
</tr>
</table>
</td>
</tr>
<tr> 
<td align=middle>
<table cellspacing=0 cellpadding=0 width=70 bgcolor=<?=$bordercolor?> border=0><tr><td height=1></td></tr></table>
<table cellspacing=0 cellpadding=3 width=70 border=1 bordercolor=<?=$bordercolor?>>
<tr bgcolor="<?=$subcolor?>"> 
<td align=center> 
<? echo get_date($timestamp); ?>
</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
<tr bgcolor=EEEEEE>
<td><b>文章描述</b>：</td>
<td>
<? if (($action=="new") || ($action=="modify" && $article==0)) echo "<input maxlength=45 size=45 name=articledes style=\"background-color:#ffffff; border: 1 double #B4B4B4\" onMouseOver=\"this.style.backgroundColor = '#E5F0FF'\" onMouseOut=\"this.style.backgroundColor = ''\">";
else echo "回复贴无需描述";
?>
</td>
</tr>
<?
if ($login_status==0) {
print $loginform;
}
print '<TR bgColor=FFFFFF>
<TD valign=top><B>你的心情</B>：</TD>
<TD colspan=2>';

$listmin=0; $listmax=25;
for ($j=$listmin; $j<=$listmax; $j++) {
print ("<INPUT type=radio value='$j.gif' name='usericon'><IMG height=13 src=\"images/emotion/$j.gif\" width=13 border=0>&nbsp;");
if ($j-$listmin==12) echo"<br>";
}
?>
</TD>
</TR>
<tr bgcolor=FFFFFF> 
<td valign=top width=125> 
<b>文章内容</b>：<br><br>
HTML 代码不可以用哦 <br>
不过 <b class=cau><a href="javascript:openScript('vibfaq.php',700,500)"><font face="Courier New, Courier">VIB Code</font></a></b> 可以<br>
点击 <a href="javascript:openScript('vibfaq.php',700,500)"><b>这里</b></a> 看使用方法
<br><b>VIB代码选项</b>：<br><br><font face=verdana><?
echo '[img] &nbsp; -';
if ($vibcode_post['pic']) echo ' 开启'; else echo ' 关闭';
echo '<br>[flash] -';
if ($vibcode_post['flash']) echo ' 开启'; else echo ' 关闭';
echo '<br>[size]&nbsp; -';
if ($vibcode_post['fontsize']) echo ' 开启'; else echo ' 关闭';
?></font>
<br><br>
<b>签名档</b>：<br>
<input type=checkbox name="usesignature" value="checkbox" checked>使用签名
</td>
<td colspan=2 align=left>
<?=$panelbar?>
<textarea onkeydown=ctlent() name=articlecontent rows=12 wrap=hard cols=85 style="background-color:#F0F0f3; border: 1 double #B4B4B4"><? if ($articlecontent) echo $articlecontent; ?></textarea>
<br>
<b>帮助模式</b>：<select name="helpmode" onChange="thelp(document.FORM.helpmode.options[document.FORM.helpmode.selectedIndex].value)">
<option value=2>完 全
<option value=1>帮 助
<option value=0>基 本
</select> -- 使用 VIB 辅助面板时，工作状态在这里制定 &nbsp; &nbsp; &nbsp;
<a href="javascript:checklength(document.FORM);">[查看帖子长度]</a>
</td>
</tr>
<tr bgcolor=#FFFFFF> 
<td colspan=3> 
<table width=100% border=0 cellspacing=1 cellpadding=2>
<tr> 
<td><b>点击下面图标加入表情符号</b></td>
</tr>
<?=$vibemote?>
</table>
</td>
</tr>

<? if (($action=="new" || $action=="reply" || $action=="quote") && $allow_upload) print <<<EOT
<tr bgcolor=EEEEEE>
	<td valign=top><font face="verdana, arial">上传附件:</font><br>
	<font face="verdana,arial">最大字节: $max_upload_size 字节</font></td>
	<td colspan=2><font face="verdana,arial">
	<input style="background-color:#ffffff; border: 1 double #B4B4B4"  type="file" name="attachment"><br>
	有效文件类型: $upload_type_available</font></td>
</tr>
EOT;
?>
<tr bgcolor=FFFFFF align=center>
<td colspan=3> 
<input onclick="return clckcntr();" type=submit value="发 表" style="height:20px;background-color:#f3f3f3;border:1 solid black" onMouseOver ="this.style.backgroundColor='#FFC864'" onMouseOut ="this.style.backgroundColor='#f3f3f3'">
 &nbsp;&nbsp; 
 <input type=hidden value=2 name=step>
<input type=hidden value="<?=$action?>" name=action>
<input type=hidden value="<?=$forumid?>" name=forumid>
<?
if ($filename) echo "<input type=hidden value='$filename' name='filename'>";
if (isset($article)) echo "<input type=hidden value='$article' name='article'>";
?>
 <input type=reset value="重 填" style="height:20px;background-color:#f3f3f3;border:1 solid black" onMouseOver ="this.style.backgroundColor='#FFC864'" onMouseOut ="this.style.backgroundColor='#f3f3f3'">
  </td>
 </tr>
 <tr bgcolor=<?=$subcolor?>> 
  <td colspan=3>谁可以发帖子?注册会员都可以啦&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;可按 [CTRL]+[ENTER] 直接发表</td>
 </tr>
</table></td></tr></form>
<TABLE style=BORDER-COLLAPSE: collapse borderColor=#111111 cellSpacing=0 cellPadding=0 width=95% align=center border=0><TBODY><tr>
  <td background=images/style/bottombg.gif><P align=left><IMG height=18 src=images/style/bottomleft.gif width=2 border=0></P></td>
  <td background=images/style/bottombg.gif><P align=right><IMG height=18 src=images/style/bottomright.gif width=2 border=0></P></td>
</TBODY></tr>
</TABLE>
</table>
<?
}