<?php
if( !defined('ISDVBBS') ){
	header('HTTP/1.0 404 Not Found');
	exit;
}

global $pagecharset,$imgurl,$fsetting, $groupsetting, $board_settings,$ActionName;

$Forum_sn = GetFormID();
$star = ( !is_numeric($GLOBALS['star']) ? 1 : intval($GLOBALS['star']) );
$page = ( !is_numeric($GLOBALS['page']) ? 1 : intval($GLOBALS['page']) );

$width = $lang['Dvbbs.mainsetting0'];
$alertcolor = $lang['Dvbbs.mainsetting1'];
$Dvbbs_Mode = intval($groupsetting[67]);
if( $board_settings[66] == 0 ){
	$Dvbbs_Mode = 2;
}
if( $Action !== 4 && isset($userinfo['postdata']) === true ){
	$content = $userinfo['postdata'];
}
$tmpArr = explode(',',$lang['template.strings8']);
if( $groupsetting[59] != 1){
	$MoneyPostInfo = '';
}
$MyTopicMode = 0;
switch($Action){
	case 5:
	case 7:
	case 8:
	case 1:
		if( $userid <= 0 ){
			$post_membername = $lang['tpl.str1'].'" readonly="readonly';
			$memberword = '**********" readonly="readonly';
		} else{
			$post_membername = $GLOBALS['membername'];
			$memberword = '**********';
		}
		$content = htmlspecialchars($content);
		$TopModeSelect = $MyTopicMode;
		$totalusetable = $fsetting['nowtablename'];
		break;
	case 2:
		if( $userid <= 0 ){
			$post_membername = $lang['tpl.str1'].'" readonly="readonly';
			$memberword = '**********" readonly="readonly';
		} else{
			$post_membername = $GLOBALS['membername'];
			$memberword = '**********';
		}
		$TopModeSelect = $MyTopicMode;
		if( !empty($_topicInfo) ){
			if( $lockuser == 1 || $lockuser == 2 ){
				$content = '';
			} elseif( $_topicInfo['locktopic'] == 2 || $_topicInfo['locktopic'] == 3 ){
				$content = '';
			} elseif( $_topicInfo['isbest'] == 1 && $groupsetting[41] == 0 ){
				$content = '';
			} else{
				$content =& $_topicInfo['body'];
			}
			$PostBuyUser = $_topicInfo['postbuyuser'];
			if( $_topicInfo['getmoneytype'] == 3 && strpos($PostBuyUser,'|||$PayMoney|||') !== false ){
				if( strpos($PostBuyUser,"|||{$post_membername}") === false ){
					$content = '';
				}
			}
			$topic = '';
			$username = $_topicInfo['username'];
			$postdate = gmdate("Y-m-d H:i:s",$_topicInfo['dateandtime']+getUserTimeZoneOffset());
			$ubblists =& $_topicInfo['ubblist'];
			if( $username == $post_membername ){
				if( $groupsetting[4] == 0 ){
					showmsg($lang['Error.strings73']);
					exit;
				}
			} else{
				if( $groupsetting[2] == 0 ){
					showmsg($lang['Error.strings31']);
					exit;
				}
			}
			if( $_topicInfo['signflag'] == 2 && $board_settings[58] == 1 ){
				$username = $lang['tpl.str2'];
				$fullip = explode('.',$_topicInfo['ip']);
				$postip = '('.$fullip[0].$fullip[1].')';
			}
			$username .= $postip;
		}
		if( $topic != '' ){
			$retitle = str_replace('{$UserName}',$username,$lang['template.strings31']).$topic;
		} else{
			$retitle = str_replace('{$UserName}',$username,$lang['template.strings31']).$content;
		}
		$topic = cutStr($topic,50);
		$topic = str_replace("\r","",str_replace("\n","",addslashes($topic)));
		if( $GLOBALS['reply'] == 'true' && $content != '' ){
			$content = reUBBCode(Ubb2Html($content));
			if( $GLOBALS['Dvbbs_Mode'] == 2 ){
				$content = "[quote][b]{$lang['tpl.str3']}[i]{$username}[/i]{$lang['tpl.str4']}{$postdate}{$lang['tpl.str5']}[/b][b]{$content}[/quote]";
			} else{
				$content = "<DIV class=quote><B>{$lang['tpl.str3']}<i>{$username}</i>{$lang['tpl.str4']}{$postdate}{$lang['tpl.str5']}</B><br>{$content}</DIV><p>";
			}
			$content = htmlspecialchars($content);
		} else{
			$content = '';
		}
		break;
	case 3:
		if( $userid <= 0 ){
			$post_membername = $lang['tpl.str1'].'" readonly="readonly';
			$memberword = '**********" readonly="readonly';
		} else{
			$post_membername = $GLOBALS['membername'];
			$memberword = '**********';
		}
		$TopModeSelect = $MyTopicMode;
		$totalusetable = $fsetting['nowtablename'];
		$content = htmlspecialchars($content);
		break;
	case 4:
		$post_membername = $GLOBALS['membername'];
		if( $content != '' ){
			$content = preg_replace(
					    array(
						 '/<div align=right><font color=#000066>(.|\n)*<\/font><\/div>/i'
						,'/\[align=right\]\[color=#000066\](.|\n)*\[\/color\]\[\/align\]/i'
						,'/<div align=right><font color=#000066>(.|\n)*<\/font><\/div>/i'
						,'/\[align=right\]\[color=#000066\](.|\n)*\[\/color\]\[\/align\]/i'
						)
					   ,''
					   ,$content);
			$phid=(preg_match('/\[mergepic,[\d]?]([_0-9a-z]*)\[\/mergepic]/ei',$content,$arr)==1)?$arr[1]:false;
	        $content=preg_replace('/\[mergepic,[\d]?][_0-9a-z]*\[\/mergepic]/ei','',$content);		   
			$content = htmlspecialchars(Ubb2Html($content));
		}

		break;
		case 9:
			$post_membername = $GLOBALS['membername'];#活动修改
		break;
}
$displaysignopts = true;
if (!isset($signflag)) {
	if ('1' == $groupsetting[55] OR '1' == $fsetting['usersign']) {
		$signflag = 1;
	} elseif ('1' != $groupsetting[55] AND '1' != $fsetting['usersign']) {
		$signflag = 0;
		$displaysignopts = false;
	} else {
		$signflag = 0;
	}
}
if (!isset($mailflag)) {
	$mailflag = 0;
}
if( $userid <= 0 ){
	$checksign0 = ' checked="checked" ';
	$checksign1 = ' disabled="disabled" ';
	$checksign2 = ' disabled="disabled" ';
	$checkbox2 = ' checked="checked" ';
	$checkbox3 = ' disabled="disabled" ';
	$checkbox4 = ' disabled="disabled" ';
	$checkbox5 = ' disabled="disabled" ';
} else{
	$checksign0 = '';
	$checksign1 = '';
	$checksign2 = '';
	if ($board_settings[58] == 0 OR $Notanony) {
		$checksign2 = ' disabled="disabled" ';
		if( $signflag == 2 ) $signflag = 1;
	}
	${'checksign'.$signflag} = ' checked="checked" ';
	$checkbox2 = '';
	$checkbox3 = '';
	$checkbox4 = '';
	$checkbox5 = '';
	${'checkbox'.($mailflag+2)} = ' checked="checked" ';
}
$SelectFace = $Expression;
global $_GET;
$toaction .= "&star={$_GET['star']}&page={$_GET['page']}&pagecount={$_GET['pagecount']}";

print <<<EOT
<table class="mainbox tableborder"  cellspacing="0" cellpadding="0">
EOT;

if (5 != $Action){print <<<EOT
<!--post.php##发帖、回帖、投票、编辑整体页面 更新时间2008-1-12，注意要和post.php一起更新-->
<script src="templates/lang/{$GLOBALS['fsetting']['lang']}/js/dv_ajaxclass.js" type="text/javascript"></script>	
<script src="templates/lang/{$GLOBALS['fsetting']['lang']}/js/post/dhtmlEdit.js" type="text/javascript" ></script>
<div onkeydown="if(window.ctlent){ctlent()}">
<form name="Dvform" method="post" action="{$toaction}" onsubmit="try{Dvbbs_CopyData('body');return Checkpostdata();}catch(e){alert(e.description);return false;}">
EOT;
#辩论
} else { print <<<EOT
<script src="templates/lang/{$GLOBALS['fsetting']['lang']}/js/post/Argue.js" type="text/javascript"></script>
<form name="ArgueForm" method="post" action="{$toaction}" onsubmit="return ArgumentationOnSubmit(this)">
EOT;
}
print <<<EOT
<input type="hidden" name="upfilerename" />
<input type="hidden" name="__upload_subdir" />
<input type="hidden" name="__upfileinfo" />
<input type="hidden" name="body" id="Body" value="{$content}" />
<input type="hidden" name="dvbbs" value="{$Forum_sn}" />
<input type="hidden" name="star" value="{$star}" />
<input type="hidden" name="page" value="{$page}" />
<input type="hidden" name="totalusetable" value="{$totalusetable}" />
EOT;
if( $Action == 2 ){
	$replyid = $ReplyID;
	$announceid = $AnnounceID;
print <<<EOT
<!--{$rehiddeninput}--><!--post.php##回复帖隐含表单-->
<input type="hidden" name="followup" value="{$replyid}" />
<input type="hidden" name="rootid" value="{$announceid}" />
EOT;
}
if( $Action == 4 ){
	$announceid = $AnnounceID;
	$replyid = $ReplyID;
print <<<EOT
<!--{$edithiddeninput}--><!--post.php##编辑帖隐含表单-->
<input type="hidden" name="replyid" value="{$replyid}" />
<input type="hidden" name="id" value="{$announceid}" />
<input type="hidden" name="announceid" value="{$announceid}" />
EOT;
}
#标题
print <<<EOT
  <tr >
	<th colspan="2">&nbsp;&nbsp;{$ActionName}
EOT;
#版面所有帖子都要经过
if( $IsAudit == 1 ){
	print <<<EOT
		<!--{$auditinfo}-->{$lang['tpl.str6']}
EOT;
}
#用户和密码,已隐藏
print <<<EOT
	</th>
  </tr>
  <tr style="display:none">
	<td class="list_post1 list_post3"><b>{$lang['tpl.str7']}</b></td>
	<td class="list_post1"><input name="username" readonly alt="{$lang['tpl.str230']}" title="{$lang['tpl.str230']}" value="{$post_membername}" class="FormClass">&nbsp;&nbsp;<font color="{$alertcolor}"><b>*</b></font><a href="reg.php">{$lang['tpl.str8']}</a></td>
  </tr>
  <tr style="display:none">
	<td class="list_post1 list_post3"><b>{$lang['tpl.str9']}</b></td>
	<td class="list_post2"><input name="passwd" readonly alt="{$lang['tpl.str231']}" title="{$lang['tpl.str231']}" type="password" value="{$memberword}" class="FormClass" /><font color="{$alertcolor}">&nbsp;&nbsp;<b>*</b></font><a href="lostpass.php">{$lang['tpl.str10']}</a>
EOT;
if( $Action == 2 ){print <<<EOT
	<!--{$reinfo1}--><!--post.php#合集部分-->
	&nbsp;&nbsp;<input type="checkbox" name="reishow" id="reishow" value=""  onclick="showtitle();" class="chkbox"/>
	{$lang['tpl.str11']}
EOT;
}
print <<<EOT
	</td>
  </tr>
EOT;

if( $board_settings[46] != 0 ){
	$getcodehtml=get_cercode(100,24,0,3);
print <<<EOT
  <tr>
	<td class="list_post1 list_post3"><b>{$lang['tpl.str12']}</b></td>
	<td class="list_post2"><div style="float:left;">{$getcodehtml}</div><div style="float:left;margin-top:6px;">{$lang['tpl.str232']}</div>
	</td>
  </tr>
EOT;
}

//------------------------------  guesttoday---------------------------------------------

if( $userid < 0 ){
	$UserToday = 0;
} else{
	if( $userinfo['usertoday'] == '' ){
		$arrUserToday = array(0,0,0,0,0);
	} else{
		$arrUserToday = explode('|',$userinfo['usertoday']);
	}
	$UserToday = intval($arrUserToday[0]);//Dvbbs.UserToday(0)
}
$isargumentationpost = ($Action >= 5 AND $Action <= 8);
if (true === $isargumentationpost) {	
	$imoney = 0;
	$ipoint = 0;
	$iusercp = 0;
	$ipower = 0;
	$iarticle = 0;
	$ireplyview = 0;
	$iusemoney = 0;
	$iuseusername = 0;
}
if ($Action != 5) {
print <<<EOT
  <tr>
	<td class="list_post1 list_post3"><b>{$lang['tpl.str13']}</b>
		<select name="font" onchange="DoTitle(this.options[this.selectedIndex].value)">
		<option selected="selected" value="">{$lang['tpl.str14']}</option>
EOT;
	if( is_array($tmpArr) ){
		foreach ($tmpArr AS $val) {print <<<EOT
			<option value="{$val}">{$val}</option>
EOT;
		}
	}
	print <<<EOT
	</select>
  </td>
  <td class="list_post2">
	<input name="topic" id="topic" size="45" class="FormClass" {$styletitle} value="{$topic}">
EOT;
	if( $groupsetting[51] == 1 ){print <<<EOT
		<a class="pointer"  style="position:absolute;margin:0 0 0 -25px!important;margin:1px 0 0 -28px;right:!important;right:;z-index:3px;"><input type="button" title="在发帖子使用彩色标题。" id="dvEditor_color"  /></a>
		<input id="topicximoo" name="topicximoo" value="{$TopicMode}" type="hidden" />
		<input id="topicfont" name="topicfont" value="{$TopicFont}" type="hidden" />
EOT;
	}
	if( $Action == 1 || $Action == 3 OR $Action == 5){
		if( $groupsetting[65] != 0 ){
			if( $boardinfo['board_setting'] !== '' ){print <<<EOT
				<select name=topicmode size=1>
				<option value=0 >{$lang['tpl.str16']}</option>
EOT;
				$BoardTopic = explode('$$',$boardinfo['board_setting']);
				if( is_array($BoardTopic) ){
					$count = count($BoardTopic);
					for( $i = 1 ; $i < $count ; $i++ ){
					$get_select = (intval($_GET[topicmode]) === intval($i))?'selected="selected"':'';
	
print <<<EOT
						<option value="{$i}" {$get_select}>{$BoardTopic[$i]}</option>
EOT;
					}
				}
				print <<<EOT
				</select><input type="hidden" id="selecttmode" value="{$groupsetting[65]}" />
EOT;
			}
		}
	}
	for($i=0;$i<count($_DCACHE['forum_postface'])-1;$i++){
		$Forum_PostFace .= $_DCACHE['forum_postface'][$i]. '|||';
	}
	for($i=0;$i<count($_DCACHE['forum_emot'])-1;$i++){
		$Forum_emot .= $_DCACHE['forum_emot'][$i]. '|||';
	}
	$Forum_emot = str_replace('|||','<><><>',$Forum_emot);
	$PostType = 1;
	$topiclimited = $board_settings[47];
	if ($topiclimited > 127) {
		$topiclimited = 127;
	}
	$lang['tpl.str17']=str_replace('{$topiclimited}', $topiclimited, $lang['tpl.str17']);
	print <<<EOT
		&nbsp;<font color="{$alertcolor}"><b>*</b></font>{$lang['tpl.str17']}<span id="titlestr"></span>
	</td>
  </tr>
EOT;
#发起一个新的辩论
} elseif (5 == $Action) {		

	$bodylimited = $board_settings[49];
	$ihtml=$iubb=$iimg=$iflash=$imidea=$iemot=$iupload=$imoney=$ipoint=$iusercp=$ipower=$iarticle=$ireplyview=$iusemoney=$iuseusername=0;
	if( $groupsetting[62] == 0 ){
		$AffordPost = $lang['template.strings30'];
	} else{
		$AffordPost = $groupsetting[62];
	}

	$topiclimited = $board_settings[47];
	if ($topiclimited > 127) {
		$topiclimited = 127;
	}
	$lang['tpl.str17']=str_replace('{$topiclimited}',$topiclimited,$lang['tpl.str17']);
	$time_format = $start_time = gmdate('Y-m-d H:i', time()+getUserTimeZoneOffset());
	$end_time = gmdate('Y-m-d H:i', time()+(24*3600)+getUserTimeZoneOffset());
	print <<<EOT
  <tr>
	<td class="list_post1 list_post3"><b>{$lang['tpl.str219']}</b></td>
	<td class="list_post2"><input name="argue_topic" id="topic" size="45" class="FormClass" value="{$topic}">&nbsp;<font color="{$alertcolor}"><b>*</b></font>{$lang['tpl.str17']}<span id="titlestr"></span></td>
  </tr>
<!-- <script type="text/JavaScript" src="templates/lang/{$GLOBALS['fsetting']['lang']}/js/mymodify.js"></script> -->
  <tr>
	<td valign=top class="list_post1 list_post3"><b>{$lang['tpl.str220']}</b></td>
	<td class="list_post2" valign="top"><div style="line-height:100%;padding-left:5px;text-indent:0px;" >{$lang['tpl.str221']}<input type="text" name="argue_start_time" value="{$start_time}" readonlyl="readonly" onclickl="show_cele_date(argue_start_time,'','',argue_start_time)" />&nbsp;&nbsp;{$lang['tpl.str222']}<input type="text" name="argue_end_time" value="{$end_time}" readonlyl="readonly" onclickl="show_cele_date(argue_end_time,'','',argue_end_time)" />&nbsp;&nbsp;({$lang['tpl.str223']}{$time_format})</div>
	</td>
  </tr>
  <tr>
	<td valign=top class="list_post1 list_post3"><b>{$lang['tpl.str224']}</b></td>
	<td class="list_post2"><input type="text" name="argue_title_obverse" size="45" />&nbsp;<font color="{$alertcolor}"><b>*</b></font>{$lang['tpl.str17']}<span id="titlestr"></span></td>
  </tr>
  <tr>
	<td valign=top class="list_post1 list_post3"><b>{$lang['tpl.str225']}</b></td>
	<td class="list_post2"><input type="text" name="argue_title_reversed" size="45" />&nbsp;<font color="{$alertcolor}"><b>*</b></font>{$lang['tpl.str17']}<span id="titlestr"></span></td>
  </tr>
  <tr>
	<td valign=top class="list_post1 list_post3"><b>{$lang['tpl.str226']}</b><br />
		<div style="text-indent: 0px;">

		</div>
	</td>
	<td class="list_post2" valign="top"><textarea name="argue_context_info" cols="95" rows="22"></textarea></td>
  </tr>
  <tr>
	<td colspan="2" class="list_post2"><b>{$lang['tpl.str227']}</b>
		<style>
		ul.timesettings2 { margin-top: 7px; text-indent: 0px; }
		ul.timesettings2 li { padding: 3px 2px; line-height: 16px; }
		</style>
		<ul class="timesettings2">
		{$lang['tpl.str228']}
		</ul>
	</td>
  </tr>
EOT;
}
#投票
if( $Action == 3 ){
	$votelimited = $board_settings[54];
	$lang['tpl.str20']=str_replace('{$topiclimited}',$topiclimited,$lang['tpl.str20']);
	$lang['tpl.str20'] = str_replace('{$votelimited}', $votelimited, $lang['tpl.str20']);
	print <<<EOT
	<!--{$voteinfo}--><!--post.php##投票信息-->
  <tr>
	<td class="list_post1 list_post3"><b>{$lang['tpl.str18']} </b> 
		<!--{$posttimesel}-->{$lang['tpl.str19']}
		<br /><br />
		{$lang['tpl.str20']}
		<li>{$lang['tpl.str21']}</li><br /><br />
		<input type="radio" name="votetype" value="0" checked="checked" class="radio"/>&nbsp;{$lang['tpl.str22']}<br />
		<input type="radio" name="votetype" value="1" class="radio" />&nbsp;{$lang['tpl.str23']}
	</td>
	<td class="list_post2"><textarea name="vote" cols="95" rows="8"></textarea></td>
  </tr>
  <tr>
	<td class="list_post1 list_post3"><b>{$lang['tpl.str24']}</b> </td>
	<td class="list_post2">
	{$lang['tpl.str25']}<input type="text" name="uarticle" size="5" value="0" />&nbsp;
	{$lang['tpl.str26']}<input type="text" name="uwealth" size="5" value="0" />&nbsp;
	{$lang['tpl.str27']}<input type="text" name="uep" size="5" value="0" />&nbsp;
	{$lang['tpl.str28']}<input type="text" name="ucp" size="5" value="0" />&nbsp;
	{$lang['tpl.str29']}<input type="text" name="upower" size="5" value="0">
	</td>
  </tr>
EOT;
}
#发表活动
if( $Action == 9 ){
	$start_time = gmdate('Y-m-d H:i', time()+getUserTimeZoneOffset());
	$end_time = gmdate('Y-m-d H:i', time()+(24*3600*7)+getUserTimeZoneOffset());
print <<<EOT
  <tr>
	<td class="list_post1 list_post3">{$lang['tpl_Active.str1']}</td>
	<td class="list_post2">
	<INPUT id=subject tabIndex=3 maxLength=200 size=45 name=activesubject>
	</td>
  </tr>
  <tr>
	<td class="list_post1 list_post3">{$lang['tpl_Active.str2']}</td>
	<td class="list_post2">
	<INPUT tabIndex=3 maxLength=50 size=45 name=activiecity>
	</td>
  </tr>
  <tr>
	<td class="list_post1 list_post3">{$lang['tpl_Active.str3']}</td>
	<td class="list_post2">
	<INPUT tabIndex=4 maxLength=50 size=45 name=activieclass>
	</td>
  </tr>
  <tr>
	<td class="list_post1 list_post3">{$lang['tpl_Active.str4']}</td>
<SCRIPT LANGUAGE="JavaScript">
<!--
function get_obj(obj){
   return document.getElementById(obj);
}
//-->
</SCRIPT>
	<td class="list_post2">
	<input type="radio" name="timemode" value="0" checked onclick="choose_type('');">
	{$lang['tpl_Active.str5']}
	<input type="radio" name="timemode" value="1" onclick="choose_type('new');">
	{$lang['tpl_Active.str6']}
	<div id="Charset_typez" style=''> 
		<INPUT tabIndex=4 maxLength=45 size=45 name=startall value="{$start_time}"> {$lang['tpl_Active.str7']}<BR></div>
	<div id="Charset_type" style='display:none;'>
		<INPUT tabIndex=4 maxLength=45 size=45 name=startall value="{$start_time}"> - 
		<INPUT tabIndex=4 maxLength=45 size=45 name=end value="{$end_time}">{$lang['tpl_Active.str8']}</div>
	</td>
  </tr>
<SCRIPT LANGUAGE="JavaScript">
<!--
function choose_type(type){
	if(type=='new'){
		get_obj('Charset_type').style.display='';
		get_obj('Charset_typez').style.display='none';
	}else{
		get_obj('Charset_type').style.display='none';
		get_obj('Charset_typez').style.display='';
	}
}
//-->
</SCRIPT>
<tr>
	<td class="list_post1 list_post3">{$lang['tpl_Active.str9']}</td>
	<td class="list_post2">
	<INPUT tabIndex=6 maxLength=300 size=45 name=activieplace>
	</td>
</tr>
<tr>
	<td class="list_post1 list_post3">{$lang['tpl_Active.str10']}</td>
	<td class="list_post2">
	<INPUT tabIndex=6 maxLength=9 size=45 name=cost value=0 onkeyup="this.value=this.value.replace(/[^0-9.]/g,'')"> {$lang['tpl_Active.str11']}
	</td>
</tr>
<tr>
	<td class="list_post1 list_post3">{$lang['tpl_Active.str12']}</td>
	<td class="list_post2">
	<INPUT class=radio type=radio CHECKED value=-1 name=gender>{$lang['tpl_Active.str13']} <INPUT class=radio type=radio value=1 name=gender>{$lang['tpl_Active.str14']}  <INPUT class=radio type=radio value=0 name=gender>{$lang['tpl_Active.str15']} 
	</td>
</tr>
<tr>
	<td class="list_post1 list_post3">{$lang['tpl_Active.str16']}</td>
	<td class="list_post2">
	<INPUT tabIndex=6 maxLength=6 size=45 name=strength onkeyup="this.value=this.value.replace(/[^0-9.]/g,'')">
	</td>
</tr>
<tr>
	<td class="list_post1 list_post3">{$lang['tpl_Active.str17']}</td>
	<td class="list_post2">
	<INPUT tabIndex=6 size=45 name=alltime value="{$end_time}">
	</td>
</tr>
EOT;
}

if ($Action != 5) {
	$jsForum_PostFace = format_jscode($Forum_PostFace);
	$jsForum_PostFacearr = explode('|||',$jsForum_PostFace);
	print <<<EOT
	<INPUT TYPE="hidden" NAME="expression" value="{$jsForum_PostFacearr[1]}">
EOT;
	$jsPostType = format_jscode($PostType);
	$jsForum_PostFace = format_jscode($Forum_PostFace);
	$jsretitle = format_jscode($retitle);
	$jsForum_emot = format_jscode($Forum_emot);
	$jsTopModeSelect = intval($TopModeSelect);
	print <<<EOT
	<SCRIPT LANGUAGE="JavaScript">
	<!--
	function DoTitle(addTitle) { 
		var revisedTitle; 
		var currentTitle = document.Dvform.topic.value; 
		revisedTitle = addTitle+currentTitle; 
		document.Dvform.topic.value=revisedTitle; 
		document.Dvform.topic.focus(); 
		return; 
	}	
	//-->
	</SCRIPT>
EOT;
}
#支付宝
if( $GLOBALS['stype'] == 1 ){
	if( $userid > 0 ){
		$paytomail = $userinfo['usermail'];
	} else{
		$paytomail = $userinfo['usermail'];
	}
	print <<<EOT
	<!--{$isalipay}-->
<tr>
	<td class="list_post1 list_post3">{$lang['tpl.str41']}</td>
	<td class="list_post2"><input name="alipay_seller" value="{$paytomail}" class="FormClass" size="30">{$lang['tpl.str42']}</td>
</tr>
<tr>
	<td class="list_post1 list_post3"><b>{$lang['tpl.str43']}</b><li><a href="http://server.dvbbs.net/dvbbs/alipay/s.htm" target=_blank><font color=blue>{$lang['tpl.str44']}</font></a></td>
	<td class="list_post2"><input name="alipay_subject" class="FormClass" size="45" />{$lang['tpl.str45']}</td>
</tr>
<tr>
	<td class="list_post1 list_post3"><b>{$lang['tpl.str46']}</b></td>
	<td class="list_post2">
	<input type=radio class="radio" ID="ialipay_transport" name="ialipay_transport" value="3" onclick="document.getElementById('alipay_mail').disabled=true; document.getElementById('alipay_express').disabled=true;alipay_transport.value=3;"> {$lang['tpl.str47']}
	<input type=radio class="radio" ID="ialipay_transport" name="ialipay_transport" checked value="1" onclick="document.getElementById('alipay_mail').disabled=true; document.getElementById('alipay_express').disabled=true;alipay_transport.value=1;"> {$lang['tpl.str48']}
	<input type=radio class="radio" ID="ialipay_transport" name="ialipay_transport" value="2" onclick="document.getElementById('alipay_mail').disabled=false; document.getElementById('alipay_express').disabled=false;alipay_transport.value=2;"> {$lang['tpl.str49']}<BR>
	<input type="hidden" value="1" ID="alipay_transport">
	{$lang['tpl.str50']}</td>
</tr>
<tr>
	<td class="list_post1 list_post3"><b>{$lang['tpl.str51']}</b></td>
	<td class="list_post2"><input name="alipay_demo" class="FormClass" size="45" value="http://">{$lang['tpl.str52']}</td>
</tr>
<tr>
	<td class="list_post1 list_post3"><b>{$lang['tpl.str53']}</b></td>
	<td class="list_post2">{$lang['tpl.str54']}</td>
</tr>
EOT;
}

if($Action != 5 AND ($groupsetting[7] == 1 || $groupsetting[7] == 2) && $fsetting['isvipgroups'] != 999 )
{
	$TempArray = explode('|',$board_settings[51]);
	$divtype='<div class="submenu" id="div_type" onmouseout="hidemenu(1);hidemenu(0);"><ul>';
	foreach( $TempArray as $val ){
		$uploadlist .= '<li><a href=#>'.$val.'</a></li>';
	}
	$divtype=$divtype.$uploadlist.'</ul></div>';
	global $fsetting;
	$uploadsettings = explode('|', $fsetting['uploadsetting']);
	#图片上传
	if ($uploadsettings[2] != '0') {
	print <<<EOT
	<!--{$uploadinfo}-->
  <tr>
	<td class="list_post1 list_post3">
		<div id="t_menu1">
		  <ul>
			<li class="m_li" style="height:20px;line-height:20px;">{$lang['tpl.str55']}</li>
			<li class="m_li" style="height:20px;line-height:20px;" onmouseover="showmenu('div_type',0);">{$lang['tpl.str57']}{$divtype}</li>
		  </ul>	
		</div>
	</td>
	<td class="list_post2">
<table align=left width="100%" border="0" style="border:none">
  <tr>
    <td width=80 valign=top style="border:none"><div class="ajaxaddpic" onclick="DvAjaxSend('dv_ajax.php?action={$Action}&setSign=PicTab&boardid={$boardid}','',this.id,'showAjaxPic');">{$lang['tpl.str234']}</div></td>
    <td width=80 valign=top style="border:none"><div class="ajaxaddEmot" onclick="DvAjaxSend('dv_ajax.php?action={$Action}&setSign=Emot&boardid={$boardid}','',this.id,'showAjaxPic');">{$lang['tpl.str235']}</div></td>
EOT;
#魔法表情部分，用于主题发表页面
if($Action == 1 || $Action == 4 OR 7 == $Action OR 8 == $Action){
	if($fsetting['plus_magicface'] == 1 && $board_settings[56] == 1 && $groupsetting[69] == 1 ){print <<<EOT
    <td width=80 valign=top style="border:none"><Div id="MagicFaced" Style="POSITION:absolute;Z-INDEX: 900;display:none;float:left;"></Div>
			<div class="ajaxaddmagicface" onclick="DvAjaxSend('dv_ajax.php?action={$Action}&setSign=Eagicframe&boardid={$boardid}','',this.id,'showAjaxPic');">
			{$lang['tpl.str236']}
			</div>
			<input name="imagicface" value="{$firstmagicface}" type="hidden" id="smagicface" />
			<input name="tmagicface"  type="hidden" id="tmagicface" />
		</td>
EOT;
	}
}
print <<<EOT
    <td width=*  style="border:none">&nbsp;
<iframe name="Annex" id="Annex" frameborder="0" width="100%" height="22"  scrolling="no" src="post_upload.php?boardid={$boardid}&t=4" style="background:#fff;"></iframe> 
</td>
  </tr>
</table>
		</td>
	</tr>
EOT;
}

}
//$tmpstr = ((false === $isargumentationpost) ? $lang['tpl.str58'] : $lang ['tpl.str211']);
if ($Action != 5) {
	$ihtml = $board_settings[66]?$board_settings[66]:0;
	$iubb = $board_settings[67]?$board_settings[67]:0;
	$iimg = $board_settings[68]?$board_settings[68]:0;
	$iflash = $board_settings[70]?$board_settings[70]:0;
	$imidea = $board_settings[71]?$board_settings[71]:0;
	$iemot = $board_settings[69]?$board_settings[69]:0;
	$iupload = $groupsetting[7]?$groupsetting[7]:0;//可以上传附件
	$bodylimited = $board_settings[49]?$board_settings[49]:0;
	$imoney = $board_settings[72]?$board_settings[72]:0;
	$ipoint = $board_settings[73]?$board_settings[73]:0;
	$iusercp = $board_settings[74]?$board_settings[74]:0;
	$ipower = $board_settings[75]?$board_settings[75]:0;
	$iarticle = $board_settings[76]?$board_settings[76]:0;
	$ireplyview = $board_settings[77]?$board_settings[77]:0;
	$iusemoney = $board_settings[78]?$board_settings[78]:0;
	$iuseusername = $board_settings[79]?$board_settings[79]:0;
	if( $groupsetting[62] == 0 ){
		$AffordPost = $lang['template.strings30'];
	} else{
		$AffordPost = $groupsetting[62];
	}
	if( $userid <= 0 ){
		$UserToday = 0;
	} else{
		if( $userinfo['usertoday'] == '' ){
			$arrUserToday = array(0,0,0,0,0);
		} else{
			$arrUserToday = explode('|',$userinfo['usertoday']);
		}
		$UserToday = intval($arrUserToday[0]);//Dvbbs.UserToday(0)
	}

	print <<<EOT
<tr>
<td valign=top class="list_post1 list_post3">
<table width="200" cellpadding="0" cellspacing="0">
	<tr>
		<td style="border:none" valign=top >
		<div class="tabtitle" style="width:100%">
			<div id="tabgroup_bot">
			<p class="tabgroup_on" ><b>{$lang['tpl.str58']}</b></p>
			<p class="tabgroup_on" ><b>{$lang['tpl.str72']}</b></p>
			</div>
			<div id="tabgroupbody" style="overflow:hidden;">
			<dl>
				<div id="showcon" class="nav_con"></div>	
				<script language = "javascript" type="text/javascript">
				function iif(strin,idname,str0,str,str1,str2){
					var strcon ;
					if ( getObj(idname).innerHTML != 'undefined') strcon =getObj(idname).innerHTML;
					if ( strin == 1 ){
						if (str==1){str=str1}else{str=str2}
					}else if ( strin == 2 ){
						if (str==1 || str==2){str=str1}else{str=str2}
					}
					getObj(idname).innerHTML=strcon+str0+str;
				}
				iif(1,'showcon','{$lang['tpl.str59']}','{$ihtml}','<font color="red">{$lang['tpl.str60']}</font>','<font color="#CCCCCC">{$lang['tpl.str61']}</font>');
				iif(1,'showcon','{$lang['tpl.str62']}',{$iubb},'<font color="red">{$lang['tpl.str60']}</font>','<font color="#CCCCCC">{$lang['tpl.str61']}</font>');
				iif(1,'showcon','{$lang['tpl.str63']}',{$iimg},'<font color="red">{$lang['tpl.str60']}</font>','<font color="#CCCCCC">{$lang['tpl.str61']}</font>');
				iif(1,'showcon','{$lang['tpl.str64']}',{$iflash},'<font color="red">{$lang['tpl.str60']}</font>','<font color="#CCCCCC">{$lang['tpl.str61']}</font>');
				iif(1,'showcon','{$lang['tpl.str65']}',{$imidea},'<font color="red">{$lang['tpl.str60']}</font>','<font color="#CCCCCC">{$lang['tpl.str61']}</font>');
				iif(1,'showcon','{$lang['tpl.str66']}',{$iemot},'<font color="red">{$lang['tpl.str60']}</font>','<font color="#CCCCCC">{$lang['tpl.str61']}</font>');
				iif(2,'showcon','{$lang['tpl.str67']}',{$iupload},'<font color="red">{$lang['tpl.str60']}</font>','<font color="#CCCCCC">{$lang['tpl.str61']}</font>');
				iif(0,'showcon','{$lang['tpl.str68']}<font color="red">{$AffordPost}</font>','','','');
				iif(0,'showcon','{$lang['tpl.str69']}<font color="red">{$UserToday}</font> {$lang['tpl.str70']}','','','');
				iif(0,'showcon','{$lang['tpl.str71']}' + Math.floor((Math.floor({$bodylimited})/1024)) + 'KB','','',''); 
				getObj('showcon').innerHTML='<ul>'+getObj('showcon').innerHTML+'</ul>';
				
				</script>
			</dl>
			<dl>
				<div id="showconCorps" class="nav_con"></div>
				<SCRIPT LANGUAGE="JavaScript">
				iif(1,"showconCorps","",{$imoney},"<li><a href='javascript:Dv_Signal(\"Money\")' title='{$lang['tpl.str73']}'>{$lang['tpl.str74']}</a>","<li>{$lang['tpl.str75']}");
				iif(1,"showconCorps","",{$ipoint},"<li><a href='javascript:Dv_Signal(\"Point\")' title='{$lang['tpl.str76']}'>{$lang['tpl.str77']}</a>","<li>{$lang['tpl.str78']}");
				iif(1,"showconCorps","",{$iusercp},"<li><a href='javascript:Dv_Signal(\"UserCP\")' title='{$lang['tpl.str79']}'>{$lang['tpl.str80']}</a>","<li>{$lang['tpl.str81']}");
				iif(1,"showconCorps","",{$ipower},"<li><a href='javascript:Dv_Signal(\"Power\")' title='{$lang['tpl.str82']}'>{$lang['tpl.str83']}</a>","<li>{$lang['tpl.str84']}");
				iif(1,"showconCorps","",{$iarticle},"<li><a href='javascript:Dv_Signal(\"Post\")' title='{$lang['tpl.str85']}'>{$lang['tpl.str86']}</a>","<li>{$lang['tpl.str87']}");
				iif(1,"showconCorps","",{$ireplyview},"<li><a href='javascript:Dv_ubb(\"replyview\")' title='{$lang['tpl.str88']}'>{$lang['tpl.str89']}</a>","<li>{$lang['tpl.str90']}");
				iif(1,"showconCorps","",{$iusemoney},"<li><a href='javascript:Dv_Signal(\"UseMoney\")' title='{$lang['tpl.str91']}'>{$lang['tpl.str92']}</a>","<li>{$lang['tpl.str93']}");
				iif(1,"showconCorps","",{$iuseusername},"<li><a href='javascript:Dv_Signal(\"UserName\")' title='{$lang['tpl.str94']}'>{$lang['tpl.str95']}</a>","<li>{$lang['tpl.str96']}");			getObj('showconCorps').innerHTML='<ul>'+getObj('showconCorps').innerHTML+'</ul>';
			
				</SCRIPT>								
			</dl>
			</div>
		</div>
		<div class="partition" style="overflow:hidden;"></div>
		<SCRIPT LANGUAGE="JavaScript">									
			var newcon = new NewsSpanBar();
			newcon.f=0;
			newcon.titleid = "tabgroup_bot";
			newcon.bodyid = "tabgroupbody";
			newcon.class_hiton = "tabgroup_on";
			newcon.class_hitno = "tabgroup";
			newcon.load();
		</SCRIPT>
	    <BR><div id="ShowTagCorps"></div></td>
	</tr>
	<tr>
		<td style="border:none" valign=top ><div id="ShowAjaxEmot"></div></td> 
	</tr>
</table>
</td>
<td class="list_post2" valign="top">
<!--post.php##Dvbbs多功能编辑器-->
<link rel="STYLESHEET" type="text/css" href="images/post/edit.css">	
<table id="Dvbbs_Container" class="Dvbbs_Body" height="300" width="100%" cellpadding="3" cellspacing="0" border="0">
<tr>
<td>
	<table style=" text-align:left;float:left;" cellpadding="0" cellspacing="0" border="0">
	<tr class="yToolbar" id="ExtToolbar0" >
		<td class="Dvbbs_Btn_ALL" language="javascript" onclick="DvAjaxSendDhtml('dv_ajax.php?action={$Action}&setSign=Dhtml&boardid={$boardid}','','ExtToolbar1','ShowTagCorps','ShowAjaxEmot','FewTOall');this.className='Dvbbs_TabOn';ondrag='return false;'" onmouseout=this.className='Dvbbs_Btn_ALL'><span id="FewTOall" class="dvEditor_FewTOall_Out" onmouseover=this.className='dvEditor_FewTOall_Over'; onmouseout=this.className='dvEditor_FewTOall_Out' ></span>
		</td>
		<td><input type="button" id="dvEditor_PhFormat" value={$lang['tpl.str97']}></td>
		<td><input type="button" id="dvEditor_font" value={$lang['tpl.str102']}></td>
		<td><input type="button" id="dvEditor_fontNum" value={$lang['tpl.str111']}></td>
		<td></td>
		<td  class="Dvbbs_Btn" title="{$lang['tpl.str119']}" language="javascript" onclick="FormatText('selectAll');this.className='Dvbbs_TabOn';ondrag='return false;'" onmouseover="dvEditorOver(this)" onmouseout="dvEditorOut(this)" ><img  class="Dvbbs_Ico" src="images/post/selectAll.gif" width="16" height="16" unselectable="on" /></td>
		<td class="Dvbbs_Btn" title="{$lang['tpl.str120']}" language="javascript" onclick="FormatText('cut');this.className='Dvbbs_TabOn';ondrag='return false;'" onmouseover="dvEditorOver(this)" onmouseout="dvEditorOut(this)" >
		<img  class="Dvbbs_Ico" src="images/post/cut.gif" width="16" height="16" unselectable="on" /></td>
		<td class="Dvbbs_Btn" title="{$lang['tpl.str121']}" language="javascript" onclick="FormatText('copy');this.className='Dvbbs_TabOn';ondrag='return false;'" onmouseover="dvEditorOver(this)" onmouseout="dvEditorOut(this)" >
		<img  class="Dvbbs_Ico" src="images/post/copy.gif" width="16" height="16" unselectable="on" /></td>
		<td class="Dvbbs_Btn" title="{$lang['tpl.str122']}" language="javascript" onclick="FormatText('paste');this.className='Dvbbs_TabOn';ondrag='return false;'" onmouseover="dvEditorOver(this)" onmouseout="dvEditorOut(this)" >
		<img  class="Dvbbs_Ico" src="images/post/paste.gif" width="16" height="16" unselectable="on" /></td>
		<td id="forecolor" name="forecolor" class="Dvbbs_Btn" title="{$lang['tpl.str112']}" language="javascript" onclick="Dvbbs_foreColor();this.className='Dvbbs_TabOn';" onmouseover="dvEditorOver(this)" onmouseout="dvEditorOut(this)"><img  class="Dvbbs_Ico" src="images/post/fgcolor.gif" width="16" height="16" unselectable="on"  /></td>
		<td id="backcolor" class="Dvbbs_Btn" title="{$lang['tpl.str113']}" language="javascript" onclick="Dvbbs_backColor();this.className='Dvbbs_TabOn';ondrag='return false;'" onmouseover="dvEditorOver(this)" onmouseout="dvEditorOut(this)"><img  class="Dvbbs_Ico" src="images/post/fbcolor.gif" width="16" height="16" unselectable="on" /></td>
		<td class="Dvbbs_Btn" title="{$lang['tpl.str137']}" language="javascript" onclick="FormatText('bold', '');this.className='Dvbbs_TabOn';ondrag='return false;'" onmouseover="dvEditorOver(this)" onmouseout="dvEditorOut(this)" >
		<img  class="Dvbbs_Ico" src="images/post/bold.gif" width="16" height="16" unselectable="on" /></td>
		<td class="Dvbbs_Btn" title="{$lang['tpl.str138']}" language="javascript" onclick="FormatText('italic', '');this.className='Dvbbs_TabOn';ondrag='return false;'" onmouseover="dvEditorOver(this)" onmouseout="dvEditorOut(this)" >
		<img  class="Dvbbs_Ico" src="images/post/italic.gif" width="16" height="16" unselectable="on" /></td>
		<td class="Dvbbs_Btn" title="{$lang['tpl.str139']}" language="javascript" onclick="FormatText('underline', '');this.className='Dvbbs_TabOn';ondrag='return false;'" onmouseover="dvEditorOver(this)" onmouseout="dvEditorOut(this)" >
		<img  class="Dvbbs_Ico" src="images/post/underline.gif" width="16" height="16" unselectable="on" /></td>
		<td><img  src="images/post/separator.gif"></td>
		<td class="Dvbbs_Btn" title="{$lang['tpl.str144']}" NAME="Justify" language="javascript" onclick="FormatText('justifyleft', '');this.className='Dvbbs_TabOn';ondrag='return false;'" onmouseover="dvEditorOver(this)" onmouseout="dvEditorOut(this)" >
		<img  class="Dvbbs_Ico" src="images/post/aleft.gif" width="16" height="16" unselectable="on" /></td>
		<td class="Dvbbs_Btn" title="{$lang['tpl.str145']}" NAME="Justify" language="javascript" onclick="FormatText('justifycenter', '');this.className='Dvbbs_TabOn';ondrag='return false;'" onmouseover="dvEditorOver(this)" onmouseout="dvEditorOut(this)" >
		<img  class="Dvbbs_Ico" src="images/post/center.gif" width="16" height="16" unselectable="on" /></td>
		<td class="Dvbbs_Btn" title="{$lang['tpl.str146']}" NAME="Justify" language="javascript" onclick="FormatText('justifyright', '');this.className='Dvbbs_TabOn';ondrag='return false;'" onmouseover="dvEditorOver(this)" onmouseout="dvEditorOut(this)" >
		<img  class="Dvbbs_Ico" src="images/post/aright.gif" width="16" height="16" unselectable="on" /></td>
		<td></td>
	</tr>
	</table>
	<div id="ExtToolbar1"></div>
	<div id="ExtToolbar2"></div>
	<BR>
	<table style=" text-align:left;float:left;width:100%" cellpadding="2" cellspacing="2" >
		<tr class="yToolbar" id="old_Toolbars" style="display:none;">
			<td>
EOT;
	$PicUrl = 'images/';
	$TempArray = explode('|',"{$PicUrl}ubb/|bold.gif|italicize.gif|underline.gif|center.gif|url1.gif|email1.gif|image.gif|swf.gif|shockwave.gif|rm.gif|mp.gif|qt.gif|quote1.gif|fly.gif|move.gif|glow.gif|shadow.gif|ubb_smilie.gif|csound.gif");
	$count = count($TempArray);
	for( $i = 1 ; $i < $count ; $i++ ){
		${'ubb'.$i} = $TempArray[0].$TempArray[$i];
	}
	print <<<EOT
<!--{$old_oldToolbars}-->
<img onclick="Dv_ubb('B')" src="{$ubb1}" alt="{$lang['tpl.str155']}" border="0" style="cursor:pointer;"/>
<img onclick="Dv_ubb('I')" src="{$ubb2}" alt="{$lang['tpl.str156']}" border="0" style="cursor:pointer;"/>
<img onclick="Dv_ubb('U')" src="{$ubb3}" alt="{$lang['tpl.str157']}" border="0" style="cursor:pointer;"/>
<img onclick="Dv_ubb('center')" src="{$ubb4}" alt="{$lang['tpl.str158']}" border="0" style="cursor:pointer;"/>
<img onclick="Curl()" src="{$ubb5}" alt="{$lang['tpl.str159']}" border="0" style="cursor:pointer;"/>
<img onclick="Dv_Signal('EMAIL')" src="{$ubb6}" alt="{$lang['tpl.str160']}" border="0" style="cursor:pointer;"/>
<img onclick="Dv_Signal('IMG')" src="{$ubb7}" alt="{$lang['tpl.str161']}" border="0" style="cursor:pointer;"/>
<img onclick="Cswf()" src="{$ubb8}" alt="{$lang['tpl.str162']}" border="0" style="cursor:pointer;"/>
<img onclick="Cdir()" src="{$ubb9}" alt="{$lang['tpl.str163']}" border="0" style="cursor:pointer;"/>
<img onclick="Crm()" src="{$ubb10}" alt="{$lang['tpl.str164']}" border="0" style="cursor:pointer;"/>
<img onclick="Cwmv()" src="{$ubb11}" alt="{$lang['tpl.str165']}" border="0" style="cursor:pointer;"/>
<img onclick="Cmov()" src="{$ubb12}" alt="{$lang['tpl.str166']}" border="0" style="cursor:pointer;"/>
<img onclick="Dv_ubb('QUOTE')" src="{$ubb13}" alt="{$lang['tpl.str167']}" border="0" style="cursor:pointer;"/>
<img onclick="Dv_ubb('fly')" src="{$ubb14}" alt="{$lang['tpl.str168']}" border="0" style="cursor:pointer;"/>
<img onclick="Dv_ubb('move')" src="{$ubb15}" alt="{$lang['tpl.str169']}" border="0" style="cursor:pointer;"/>
<img onclick="Cguang()" src="{$ubb16}" alt="{$lang['tpl.str170']}" border="0" style="cursor:pointer;"/>
<img onclick="Cying()" src="{$ubb17}" alt="{$lang['tpl.str171']}" border="0" style="cursor:pointer;"/>
<img onclick="Dv_Signal('SOUND')" src="{$ubb19}" alt="{$lang['tpl.str172']}" border="0" style="cursor:pointer;"/>
<!--post.php##ubb部分End-->
			</td>
		</tr>
	</table>
					</td>
				</tr>
				<tr>
					<td height="100%" width="100%"  id="PostiFrame">
					<iframe class="Dvbbs_Composition" id="Dvbbs_Composition" marginheight="5" marginwidth="5" width="100%" height="100%"></iframe>
					</td>
				</tr>
				<tr>
					<td>
						<table cellpadding="0" cellspscing="0" border="0" width="100%">
						<tr>
							<td width="10">&nbsp;</td>
							<td class="Dvbbs_TabOn" id="Dvbbs_TabDesign" onclick="if (Dvbbs_bTextMode!=1) {Dvbbs_setMode(1);}" unselectable="on" width="60" ><img  unselectable="on" src="images/post/mode.design.gif" align="absmiddle" width="21" height="20">&nbsp;Design</td>
							<td style="width:10px"></td>
							<td class="Dvbbs_TabOff" id="Dvbbs_TabOldTools" onclick="if (Dvbbs_bTextMode!=3){Dvbbs_setMode(3);}" unselectable="on" width="80"><img  unselectable="on" src="images/post/oldubb.gif" align="absmiddle"  height="20">&nbsp;{$lang['tpl.str173']}</td>
							<td style="width:10px"></td>
							<td class="Dvbbs_TabOff" id="Dvbbs_TabView" onclick="Dvbbs_View();" unselectable="on" width="60" ><img  unselectable="on" src="images/post/mode.view.gif" align="absmiddle" width="20" height="20">&nbsp;VIEW</td>
							<td style="width:10px"></td>

							<!--post.php##Dvbbs多功能编辑器HTML工具按钮-->
							<td class="Dvbbs_TabOff" id="Dvbbs_TabHtml" onclick="if (Dvbbs_bTextMode!=2) {Dvbbs_setMode(2);}" unselectable="on" width="60" style="cursor: pointer;"><img unselectable="on" src="images/post/mode.html.gif" align="absmiddle" width="21" height="20">&nbsp;HTML</td>
							<td style="width:10px"></td>
							<td ><input type="checkbox" class="chkbox" name="autofix" id="autofix" value="1" checked="checked" />{$lang['tpl.str174']}</td>
							<td align='right'>
								<select id="Zoom" class="Dvbbs_TBGen" onchange="doZoom(this)" >
									<option value="100">100%</option>
									<option value="50">50%</option>
									<option value="75">75%</option>
									<option value="100">100%</option>
									<option value="125">125%</option>
									<option value="150">150%</option>
									<option value="175">175%</option>
									<option value="200">200%</option>
								</select>
								<a href="javascript:Dvbbs_Size(-300)"><img  src="images/post/minus.gif" unselectable="on" border="0" /></a> <a href="javascript:Dvbbs_Size(300)"><img  src="images/post/plus.gif" unselectable="on" border="0" /></a>
							</td>
							<td width='20'></td>
						</tr>
						</table>
					</td>
				</tr>
			</table>
			<script language = "javaScript" type="text/javascript">
			var Dvbbs_bIsIE5=document.all;
			var Dvbbs_bLoad=false;
			var Dvbbs_FewROAll=document.getElementById("FewTOall");
			Dvbbs_FewROAll.innerHTML='全部功能';

			var Dvbbs_Mode = {$Dvbbs_Mode};
			if (Dvbbs_bIsIE5){
				var IframeID=frames["Dvbbs_Composition"];
			}
			else{
				var IframeID=document.getElementById("Dvbbs_Composition").contentWindow;
				var Dvbbs_bIsNC=true;
			}
			if (Dvbbs_bLoad==false)
			{
				Dvbbs_InitDocument("Body","GB2312");
			}

			</script>
			<!-- <div id="constr"></div> -->
		</td>
	</tr>
EOT;
}

if( $Action == 1 || $Action == 3){
print <<<EOT
				<!--{$MoneyPostInfo}-->
				<tr>
					<td class="list_post1 list_post3"><b>{$lang['tpl.str176']}</b></td>
					<td class="list_post2">
						<select name="getposttype" onchange="ChkPostMoney(this.options[this.selectedIndex].value)">
						<option value="">{$lang['tpl.str177']}</option>
						<option value="0">{$lang['tpl.str178']}</option>
						<option value="1">{$lang['tpl.str179']}</option>
						<option value="2">{$lang['tpl.str180']}</option>
						</select>
						{$lang['tpl.str181']}<input name="tomoney" size="4" value="">
						<div id="Buy_setting" style="display:none">
						{$lang['tpl.str182']}<input name="buy_orders" size="4" value="-1">{$lang['tpl.str183']}<BR>
						{$lang['tpl.str184']}<INPUT TYPE="radio" class="radio" NAME="buy_viptype" value="0" checked="checked" />{$lang['tpl.str185']}<input type="radio" class="radio" name="buy_viptype" value="1" /><br />
						{$lang['tpl.str186']}<input name="buy_userlist" size="30" value="" />{$lang['tpl.str187']}
						</div>
						<div id="PostMoneyInfo" class="Redfont"></div>
					</td>
				</tr>
EOT;
} elseif ($Action == 2 AND $GetMoneyType == 2) {
	print <<<EOT
				<!--{$MoneyPostInfo}-->
				<tr>
					<td class="list_post1 list_post3"><b>{$lang['tpl.str188']}</b></td>
					<td class="list_post2">
					<input type="radio" class="radio" name="getposttype" value="0" checked="checked" />{$lang['tpl.str189']}
					<input type="radio" class="radio" name="getposttype" value="1">{$lang['tpl.str190']}
					&nbsp;&nbsp;{$lang['tpl.str191']}<input name="tomoney" size="4" value="0" />
					</td>
				</tr>
EOT;
}

//奇虎组图插件
(!isset($istopic))&&($istopic=true);
if(($Action!=2)&&($Action!=4||$istopic==true)){
	if(file_exists(CACHE_PATH.'qihoo.config.php')){
		global $qihoo;
		if(intval($qihoo['open'])==1){
		if($phid){
			$sphid=$phid?"&phid={$phid}":"";
			$code="sid={$qihoo['sid']}&spassword={$qihoo['spassword']}&phid={$phid}&";
		}else{
			$code="spassword={$qihoo['spassword']}";
		}
		$code=urlencode(authcode($code,'ENCODE',$qihoo['skey']));
		print <<<EOT
				<tr>
					<td width="20%" class="tablebody6"><b>上传组图:</b></td>
					<td width="80%" class="tablebody5">
			<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" id="uploadimages" width="750" height="240" align="middle">
			<param name="allowScriptAccess" value="always" />
			<param name="FlashVars" value="sid={$qihoo['sid']}&code={$code}{$sphid}"> 
			<param name="movie" value="http://p.qihoo.com/flash/upload.swf?sid={$qihoo['sid']}&code={$code}{$sphid}" />
			<param name="quality" value="high" />
			<param name="bgcolor" value="#FFFFFF" />
			<embed src="http://p.qihoo.com/flash/upload.swf?sid={$qihoo['sid']}&code={$code}{$sphid}" quality="high" bgcolor="#FFFFFF" width="750" height="240" swLiveConnect=true id="uploadimages" name="uploadimages" align="middle" allowScriptAccess="always" FlashVars="sid=25&code=39pMtceQrPwlLk%2Bbw%2BSIS%2F4lTzb3SN95fgfOvPptEkjBsI5d" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />
			</object>
			<input type="hidden" name="dvid" id="dvid" value="{$phid}" />
			<input type="hidden" name="dvstatus" id="dvstatu" value="2" />
			</td>
			
			<script type="text/javascript">
				var mergepicstatu = 0;
				lang=new Array();
		        lang['succeed'] = '组图保存成功,现在你可以安全发表贴子！';
		        uploadimages=document.getElementById('uploadimages');
				function setImageInfo(dvid, dvstatu) {
					document.getElementById('dvid').value = dvid;
					document.getElementById('dvstatu').value = dvstatu;
					mergepicstatu=dvstatu;
					if(dvstatu==0)alert(lang['succeed']);
				}
			</script>
		</tr>
				
EOT;
}
}
}
//END 奇虎组图插件

if (false === $isargumentationpost) {
	print <<<EOT
				<tr>
					<td valign="top" colspan='2'><b>{$lang['tpl.str192']}</b>
EOT;
	if (true == $displaysignopts) {
print <<<EOT
					{$lang['tpl.str193']}<input type="radio" name="signflag" value="0" class="radio" {$checksign0}/>{$lang['tpl.str194']}
					<input type="radio" name="signflag" value="1" class="radio" {$checksign1}/>{$lang['tpl.str195']}
					<input type="radio" name="signflag" value="2" class="radio" {$checksign2}/>{$lang['tpl.str196']}&nbsp;&nbsp;
EOT;
	}
	print <<<EOT
					<BR><B>{$lang['tpl.str197']}</B><input type="radio" name="emailflag" class="radio" value="0" {$checkbox2} />{$lang['tpl.str198']}
					 <input type="radio" name="emailflag" value="1" class="radio" {$checkbox3} />{$lang['tpl.str199']}
					 <input type="radio" name="emailflag" value="2" class="radio" {$checkbox4} />{$lang['tpl.str200']}
					 <input type="radio" name="emailflag" value="3" class="radio" {$checkbox5} />{$lang['tpl.str201']}
EOT;
	if( ( $Action == 1 || $Action == 3 OR $Action == 5 ) && $groupsetting[51] == 1 ){
		print <<<EOT
					<!--{$useraction}-->&nbsp;&nbsp;<input type="checkbox" name="locktopic" value="yes" class="chkbox">{$lang['tpl.str202']}&nbsp;&nbsp;<input type="checkbox" name="istop" value="yes" class="chkbox">{$lang['tpl.str203']}&nbsp;&nbsp;<input type="checkbox" name="istopall" value="yes" class="chkbox" />{$lang['tpl.str204']}
EOT;
	}
	print <<<EOT
						</td>
					</tr>
EOT;
}
if ($Action != 5) {
	print <<<EOT
	<!-- 发帖小帖士<tr><td valign=top class="list_post2" colspan="2">{$lang['tpl.str205']}</td></tr> -->
EOT;
}
print <<<EOT
	<tr >
		<td valign="middle" colspan="2" class="list_post2" style="text-align : center; ">
		<button onMousemove="button_move(this)" onMouseout="button_out(this)"  name="Submit" type="submit"> {$lang['tpl.str206']} </button>
EOT;
if (false === $isargumentationpost) {
	print <<<EOT
	&nbsp;<button onMousemove="button_move(this)" onMouseout="button_out(this)"  onclick="gopreview()" name="button" type="button"> {$lang['tpl.str207']} </button>
EOT;
}
print <<<EOT
	&nbsp;<button onMousemove="button_move(this)" onMouseout="button_out(this)"  onclick="ClearReset()" name="Submit2" type="reset"> {$lang['tpl.str208']} </button>

	</td>
  </tr>
</form>
</table>
EOT;
if ($Action != 5) {

		if (false === $isargumentationpost) {
			print <<<EOT
		<form name="preview" action="preview.php?boardid={$boardid}" method="post" target="preview_page">
			<input type="hidden" name="upload_tmp_dir" value="">
			<input type="hidden" name="uploadrepl" value="">
			<input type="hidden" name="Dvtitle" value="" /><input type="hidden" name="theBody" value="" />
		</form>
EOT;
}
		print <<<EOT
	</div>
EOT;
}

if ($Action != 5) {
	print <<<EOT

	<script src="templates/lang/{$GLOBALS['fsetting']['lang']}/js/post/dhtmlEdit1.js" type="text/javascript" ></script>
	<script src="templates/lang/{$GLOBALS['fsetting']['lang']}/js/post/dveditor.js" type="text/javascript" ></script>
	<script src="templates/lang/{$GLOBALS['fsetting']['lang']}/js/post/post.js" type="text/javascript"></script>
	<SCRIPT LANGUAGE="JavaScript">
	<!--
		var dvColorValue = ["1", "2", "3", "4", "5", "6", "7", "8", "9"];
		var dvColorName = ["HTML","{$lang['tpl.color1']}","{$lang['tpl.color2']}", "{$lang['tpl.color3']}", "{$lang['tpl.color4']}", "{$lang['tpl.color5']}", "{$lang['tpl.color6']}", "{$lang['tpl.color7']}", "{$lang['tpl.color8']}"];
		var dvFontValue = ["{$lang['tpl.str103']}", "{$lang['tpl.str104']}", "{$lang['tpl.str105']}_GB2312", "{$lang['tpl.str106']}_GB2312", "{$lang['tpl.str107']}","{$lang['tpl.str108']}","{$lang['tpl.str109']}","{$lang['tpl.str110']}","Arial","Arial Black", "Arial Narrow", "Bradley Hand ITC", "Brush Script	MT", "Century Gothic", "Comic Sans MS", "Courier", "Courier New", "MS Sans Serif", "Script", "System", "Times New Roman", "Viner Hand ITC", "Verdana", "Wide Latin", "Wingdings"];
		var dvFontName = ["{$lang['tpl.str103']}","{$lang['tpl.str104']}","{$lang['tpl.str105']}", "{$lang['tpl.str106']}", "{$lang['tpl.str107']}", "{$lang['tpl.str108']}", "{$lang['tpl.str109']}", "{$lang['tpl.str110']}","Arial","Arial Black","Arial Narrow","Bradley Hand ITC", "Brush Script	MT", "Century Gothic", "Comic Sans MS", "Courier", "Courier New", "MS Sans Serif", "Script", "System", "Times New Roman", "Viner Hand ITC", "Verdana", "Wide Latin", "Wingdings"];
		var dvFontNumValue = ["1", "2", "3", "4", "5", "6", "7"];
		var dvFontNumName = ["1", "2", "3", "4", "5", "6", "7"];
		var dvPhFormatValue = ["&lt;P&gt;", "&lt;H1&gt;", "&lt;H2&gt;", "&lt;H3&gt;", "&lt;H4&gt;", "&lt;H5&gt;", "&lt;H6&gt;", "&lt;H7&gt;", "&lt;PRE&gt;", "&lt;ADDRESS&gt;"];
		var dvPhFormatName = ["{$lang['tpl.str98']}", "{$lang['tpl.str99']} 1", "{$lang['tpl.str99']} 2", "{$lang['tpl.str99']} 3", "{$lang['tpl.str99']} 4", "{$lang['tpl.str99']} 5", "{$lang['tpl.str99']} 6", "{$lang['tpl.str99']} 7", "{$lang['tpl.str100']}", "{$lang['tpl.str101']}"];
	//-->
	</SCRIPT>
	<SCRIPT LANGUAGE="JavaScript">
	<!--
		initMenuText();
	//-->
	</SCRIPT>
	{$debug}
EOT;
}

if( $Action == 1 || $Action == 3 OR $Action == 5){
	$scriptCode = 'ispostnew = 1;';
}
if ($Action != 5) {
	print <<<EOT
	<script type="text/javascript">
	Maxtitlelength = {$board_settings[47]};
	{$scriptCode}
	MaxConlength = {$board_settings[49]};
	</script>
EOT;
}


?>
