<?php
require($netsFileConfig['sysCoreRoot'].'Cache/DbDescription/commposts.php');
require($netsFileConfig['sysCoreRoot'].'Cache/DbDescription/commpostscont.php');
require($netsFileConfig['sysCoreRoot'].'Cache/DbDescription/commpostsdiscuss.php');
require($netsFileConfig['sysCoreRoot'].'Cache/DbDescription/commpostsdiscusscont.php');
require($netsFileConfig['sysCoreRoot'].'Inc/m_Comm/Posts/commposts.php');
require($netsFileConfig['sysCoreRoot'].'Inc/m_Comm/Posts/commpostsdiscuss.php');

class PaDefault extends CustomPage {
	public function PaDefault(){
		$this->CustomPage();
	}
	public function OnBInitial(){
		$this->sMetaTitle='首页';
		$this->getUser('1,2,3,4,5,');
		$this->sTable=array(
			array('sttTableName'=>'commpostsdiscuss','sttColumnHead'=>'copdt'),
			array('sttTableName'=>'commpostsdiscusscont','sttColumnHead'=>'copdct'),);
		$this->sApp=new commposts($this->sConnString);
		
		$this->sTemplatePath='Comm/postsDetail_Normal.php';
		
		if ($this->sActionType=='DPositive') {
			$this->OnPositive();
		}else if ($this->sActionType=='DNegative') {
			$this->OnNegative();
		}
		
	}
	public function OnPositive(){
		$tmpAR0=$this->AnalyerRequest('ID',0,0);
		$this->sMainID=$tmpAR0[0];
		//-- ------ #Update ------ --
		//Get cookie
		$tmpCookieName=$this->sysCookieHead.'Cookie_CommPosts_Vote_'.$this->sMainID;
		$tmpAR0=$this->AnalyerRequest($tmpCookieName,'',2);
		if ($tmpAR0[0]!='') {
			$this->sMessage='谢谢，您已经投过票了。';
			$this->sJscript=$this->Message('ERROR','',$this->sMessage,'');
			return 1;
		}
		//SQL
		$tmpSQL=' UPDATE {Nets.TableHead}commpostscont AS A 
			SET A.copctCode_Positive=A.copctCode_Positive+1
			WHERE 1=1 AND A.copctIndexID={Nets.ID} ';
		$tmpSTR=str_replace('{Nets.TableHead}',$this->sysTableHead,$tmpSQL);
		$tmpSTR=str_replace('{Nets.ID}',$this->sMainID,$tmpSTR);
		$tmpINT=$this->sDb->Execute($tmpSTR);
		if ($tmpINT!=0) {
			$this->sMessage='对不起，投票失败，请与客服人员联系。';
			$this->sJscript=$this->Message('ERROR','',$this->sMessage,'');
			return 1;
		}
		//Get count
		$tmpSQL=' SELECT A.copctID,copctCode_Positive
			FROM {Nets.TableHead}commpostscont AS A
			WHERE 1=1 AND A.copctIndexID={Nets.ID} ';
		$tmpSTR=str_replace('{Nets.TableHead}',$this->sysTableHead,$tmpSQL);
		$tmpSTR=str_replace('{Nets.ID}',$this->sMainID,$tmpSTR);
		$tmpData0=$this->sDb->Search($tmpSTR);
		if (count($tmpData0)<=0) {
			$this->sMessage='对不起，获取投票数失败，请与客服人员联系。';
			$this->sJscript=$this->Message('ERROR','',$this->sMessage,'');
			return 1;
		}
		//Set cookie
		$this->writeCookie($this->sysNormalCookiePath,$tmpCookieName,1);
		
		$this->sMessage='您已成功投票。'.$this->sysSPLIT1.$tmpData0[0]['copctCode_Positive'];
		$this->sJscript=$this->Message('ERROR','',$this->sMessage,'');
		return 0;
	}
	public function OnNegative(){
		$tmpAR0=$this->AnalyerRequest('ID',0,0);
		$this->sMainID=$tmpAR0[0];
		//-- ------ #Update ------ --
		//Get cookie
		$tmpCookieName=$this->sysCookieHead.'Cookie_CommPosts_Vote_'.$this->sMainID;
		$tmpAR0=$this->AnalyerRequest($tmpCookieName,'',2);
		if ($tmpAR0[0]!='') {
			$this->sMessage='谢谢，您已经投过票了。';
			$this->sJscript=$this->Message('ERROR','',$this->sMessage,'');
			return 1;
		}
		//SQL
		$tmpSQL=' UPDATE {Nets.TableHead}commpostscont AS A 
			SET A.copctCode_Negative=A.copctCode_Negative+1
			WHERE 1=1 AND A.copctIndexID={Nets.ID} ';
		$tmpSTR=str_replace('{Nets.TableHead}',$this->sysTableHead,$tmpSQL);
		$tmpSTR=str_replace('{Nets.ID}',$this->sMainID,$tmpSTR);
		$tmpINT=$this->sDb->Execute($tmpSTR);
		if ($tmpINT!=0) {
			$this->sMessage='对不起，投票失败，请与客服人员联系。';
			$this->sJscript=$this->Message('ERROR','',$this->sMessage,'');
			return 1;
		}
		//Get count
		$tmpSQL=' SELECT A.copctID,copctCode_Negative
			FROM {Nets.TableHead}commpostscont AS A
			WHERE 1=1 AND A.copctIndexID={Nets.ID} ';
		$tmpSTR=str_replace('{Nets.TableHead}',$this->sysTableHead,$tmpSQL);
		$tmpSTR=str_replace('{Nets.ID}',$this->sMainID,$tmpSTR);
		$tmpData0=$this->sDb->Search($tmpSTR);
		if (count($tmpData0)<=0) {
			$this->sMessage='对不起，获取投票数失败，请与客服人员联系。';
			$this->sJscript=$this->Message('ERROR','',$this->sMessage,'');
			return 1;
		}
		//Set cookie
		$this->writeCookie($this->sysNormalCookiePath,$tmpCookieName,1);
		
		$this->sMessage='您已成功投票。'.$this->sysSPLIT1.$tmpData0[0]['copctCode_Negative'];
		$this->sJscript=$this->Message('ERROR','',$this->sMessage,'');
		return 0;
	}
	public function OnAdd(){
		$this->sTable=array(
			array('sttTableName'=>$this->sysTableHead.'commpostsdiscuss','sttColumnHead'=>'copdt'),
			array('sttTableName'=>$this->sysTableHead.'commpostsdiscusscont','sttColumnHead'=>'copdct'),);
		$tmpDbDescriptions=array();
		foreach ($this->sTable as $tableCell){
			$tmpDbDescriptions[]=$this->sDbDescriptions[$tableCell['sttTableName']];
		}
		$tmpApp=new commpostsdiscuss($this->sConnString);
		
		$tmpMainid=$this->AnalyerRequest('mainID',0,1);
		$this->sMainID=$tmpMainid[0];
		$tmpMainUserid=$this->AnalyerRequest('mainUserid',0,1);
		$this->sMainUserid=$tmpMainid[0];
		$tmpMainTableid=$this->AnalyerRequest('mainTableid',0,1);
		$this->sMainTableid=$tmpMainid[0];
		//-- ------ #Submit limit check ------ --
		$tmpINT=$this->submitLimitRead($this->sysPage,-1,-1,-1);
		if($tmpINT!=0){
			$this->sJscript=$this->Message('SUCCESS','','对不起，您登陆次数过多，请'.$this->sysFileConfig['SubmitLimitFreeze'].'秒后再尝试登陆。','');
			return 1;
		}
		//-- ------ #CCode ------ --
		$tmpSTR='CCode';
		$tmpAR0=$this->AnalyerRequest($tmpSTR.'Txt','',1);
		$tmpCCode=$tmpAR0[0];
		$tmpSTR=$tmpSTR.'Txt_IFrame';
		if(!array_key_exists($tmpSTR,$_SESSION)){
			$this->submitLimitWrite($this->sysPage,-1,-1,-1);
			$this->sJscript=$this->Message('ERROR','提交失败','验证码错误','');
			return 1;
		}
		if($_SESSION[$tmpSTR]=='' || $_SESSION[$tmpSTR]!=$tmpCCode){
			$this->submitLimitWrite($this->sysPage,-1,-1,-1);
			$this->sJscript=$this->Message('ERROR','提交失败','验证码错误','');
			return 1;
		}
		//-- ------ #Add ------ --
		$tmpApp->TransStart();
		//#Get numCode
		$tmpSTR=$this->sTable[0]['sttColumnHead'].'NumCode';
		$tmpDbDescriptions[0]['TableDescription']['SearchColumn']=$tmpSTR;
		$tmpDbDescriptions[0]['Columns'][$tmpSTR]['Value']='N'.$this->sysSPLIT11.date('YmdHis');
		$tmpApp->numCode($tmpDbDescriptions[0]);
		//#Set value
		$tmpDbDescription0=$tmpDbDescriptions;
		$Coun0=0;
		foreach ($tmpDbDescription0 as $tableCell){
			foreach ($tableCell['Columns'] as $Column){
				if($Column['stcotName']!=$this->sTable[$Coun0]['sttColumnHead'].'ID' &&
					$Column['stcotName']!=$this->sTable[$Coun0]['sttColumnHead'].'NumCode' &&
					$Column['stcotName']!=$this->sTable[$Coun0]['sttColumnHead'].'CreateBy' &&
					$Column['stcotName']!=$this->sTable[$Coun0]['sttColumnHead'].'CreateTime' &&
					$Column['stcotName']!=$this->sTable[$Coun0]['sttColumnHead'].'IndexID'){
					$tmpAR0=$this->AnalyerRequest($Column['stcotName'].'Txt',$Column['stcoctDefaultValue'],1);
					$tmpDbDescriptions[$Coun0]['Columns'][$Column['stcotName']]['Value']=$tmpAR0[0];
				}
			}
			$Coun0++;
		}
		//-- #Set conventional --
		if(isset($tmpDbDescriptions[0]['Columns'][$this->sTable[0]['sttColumnHead'].'CreateBy']['Value'])){
			$tmpDbDescriptions[0]['Columns'][$this->sTable[0]['sttColumnHead'].'CreateBy']['Value']=$tmpMainUserid[0];
		}
		if(isset($tmpDbDescriptions[0]['Columns'][$this->sTable[0]['sttColumnHead'].'CreateTime'])){
			$tmpDbDescriptions[0]['Columns'][$this->sTable[0]['sttColumnHead'].'CreateTime']['Value']=date($this->sysTimeFormat);
		}
		//DB name,Condition,User index,User column name
		$tmpFlag=0;
		foreach ($this->AnonymousUserData as $Row0){
			if (count($tmpDbDescriptions)>1) {
				if(isset($tmpDbDescriptions[1]['Columns'][$this->sTable[1]['sttColumnHead'].$Row0[0]])){
					$tmpFlag=1;
				}
			}
			if ($this->sUserInfo[0]['Columns']['uitID']['Value']==0 && $tmpFlag==1) {
				$tmpDbDescriptions[1]['Columns'][$this->sTable[1]['sttColumnHead'].$Row0[0]]['Value']=$Row0[4];
			}else if ($tmpFlag==1) {
				$tmpDbDescriptions[1]['Columns'][$this->sTable[1]['sttColumnHead'].$Row0[0]]['Value']=$this->sUserInfo[$Row0[2]]['Columns'][$Row0[3]]['Value'];
			}
		}
		//Spical value array
		foreach ($this->sSpicalValue as $Cell){
			if(isset($tmpDbDescription[$Cell[0]]['Columns'][$Cell[1]]['Value'])){
				$tmpDbDescription[$Cell[0]]['Columns'][$Cell[1]]['Value']=$Cell[2];
			}
		}
		//-- #Set spical --
		$tmpDbDescriptions[0]['Columns'][$this->sTable[0]['sttColumnHead'].'Name']['Value']=$this->sCode->SubString($tmpDbDescriptions[1]['Columns'][$this->sTable[1]['sttColumnHead'].'Content']['Value'],0,60);
		$tmpDbDescriptions[0]['Columns'][$this->sTable[0]['sttColumnHead'].'Parid']['Value']=$this->sMainID;
		$tmpDbDescriptions[0]['Columns'][$this->sTable[0]['sttColumnHead'].'Checked']['Value']=2;
		if ($tmpDbDescriptions[0]['Columns'][$this->sTable[0]['sttColumnHead'].'CreateBy']['Value']==0) {
			$tmpDbDescriptions[0]['Columns'][$this->sTable[0]['sttColumnHead'].'CreateBy']['Value']=2;
		}
		$tmpDbDescriptions[0]['Columns'][$this->sTable[0]['sttColumnHead'].'CreateTime']['Value']=date($this->sysTimeFormat);
		
		//#Add
		$tmpDbDescriptions[1]['Columns'][$this->sTable[1]['sttColumnHead'].'Content']['Value']=$this->sCode->FilterINPUT($tmpDbDescriptions[1]['Columns'][$this->sTable[1]['sttColumnHead'].'Content']['Value'],3);
		$tmpINT=$tmpApp->Check($tmpDbDescriptions,array(),array());
		if($tmpINT!=0){
			$tmpApp->TransRollback();
			$this->sJscript=$this->Message('ERROR','',$tmpApp->sysLastError,'');
			return 1;
		}
		$Coun0=0;
		while (count($tmpDbDescriptions)>$Coun0){
			if($Coun0==0){
				$tmpDbDescriptions[$Coun0]['TableDescription']['SearchColumn']=$this->sTable[$Coun0]['sttColumnHead'].'NumCode,'.$this->sTable[$Coun0]['sttColumnHead'].'ID';
			}else {
				$tmpDbDescriptions[$Coun0]['TableDescription']['SearchColumn']=$this->sTable[$Coun0]['sttColumnHead'].'IndexID';
			}
			$Coun0++;
		}
		$tmpINT=$tmpApp->add($tmpDbDescriptions);
		if($tmpINT!=0){
			$tmpApp->TransRollback();
			$this->sJscript=$this->Message('ERROR','',$tmpApp->sysLastError,'');
			return 1;
		}
		
		$tmpApp->TransCommit();
		$this->submitLimitWrite($this->sysPage,-1,-1,-1);
		$tmpApp->TransCommit();
		$this->sJscript=$this->Message('SUCCESS','','回复成功',$this->sysPage.'?ID='.$tmpDbDescriptions[0]['Columns'][$this->sTable[0]['sttColumnHead'].'Parid']['Value']);
		/*
		$this->sJscript=$this->Message_Frame('A,0',
			$this->sysFileConfig['sysCoreRoot'].$this->sysFileConfig['PathManaFrameMessage'],
			$this->sCode->URL_MakeParameter('添加成功',0),
			$this->sCode->URL_MakeParameter($this->sApp->sysLastError,0),
			$this->sCode->URL_MakeParameter($this->sysFileConfig['sysCoreRoot'].'Mana/m_cms/doc/doc.php',0));
		*/
		return 0;
	}
	public function OnList(){
		$tmpAR0=$this->AnalyerRequest('ID',1,0);
		$this->sMainID=$tmpAR0[0];
		$tmpAR0=$this->AnalyerRequest('DOnly_User',-1,0);
		$this->sOnly_User=$tmpAR0[0];
		//-- ------ #Initial ------ --
		$tmpINT=$this->sApp->initialObject($this->sMainID);
		//-- ------ #This ------ --
		$tmpSQL=' SELECT A.coptID,A.coptName,A.coptParid,A.coptCreateBy,A.coptCreateTime,
			B.copctContent,B.copctPageAble,B.copctTemplateid_Detail,B.copctCode_Positive,B.copctCode_Negative,
			B.copctPublisher_Name,B.copctPublisher_Email,B.copctPublisher_Source,
			D.uictCoSignature
			
			FROM {Nets.TableHead}commposts AS A 
			INNER JOIN {Nets.TableHead}commpostscont AS B ON B.copctIndexID=A.coptID
			INNER JOIN {Nets.TableHead}netsuserinfo AS C ON C.uitID=A.coptCreateBy
			INNER JOIN {Nets.TableHead}netsuserinfocont AS D ON D.uictIndexID=C.uitID
			WHERE 1=1 AND A.coptRecycle=0 AND A.coptChecked>1 AND A.coptID={Nets.ID} ';
		$tmpSTR=str_replace('{Nets.TableHead}',$this->sysTableHead,$tmpSQL);
		$tmpSTR=str_replace('{Nets.ID}',$this->sMainID,$tmpSTR);
		$this->sDetailData=$this->sDb->Search($tmpSTR);
		if(count($this->sDetailData)!=1){
			//Error
			//#Other
			$tmpSQL=' SELECT A.coptID,A.coptName,A.coptParid,A.coptCreateTime
				FROM {Nets.TableHead}commposts AS A 
				WHERE 1=1 AND A.coptRecycle=0 AND A.coptChecked>1
				ORDER BY A.coptOrderBy DESC,A.coptID DESC LIMIT 0,8 ';
			$tmpSTR=str_replace('{Nets.TableHead}',$this->sysTableHead,$tmpSQL);
			$this->sOtherData=$this->sDb->Search($tmpSTR);
			return 1;
		}
		$this->sMainID=$this->sDetailData[0]['coptID'];
		$this->sMetaTitle=$this->sDetailData[0]['coptName'];
		$this->sParid=$this->sDetailData[0]['coptParid'];
		
		if($this->sDetailData[0]['copctPageAble']==1){
			$tmpCListSTR0='DCList0';
			$tmpCListAR0=$this->AnalyerRequest($tmpCListSTR0,'1,0',0);
			$this->sCPButton=new netsConPButton();
			$this->sCPButton->sPage=$this->sysPage;
			$this->sCPButton->sExtendParameter='&ID='.$this->sMainID;
			$this->sCPButton->setPage($tmpCListAR0,$this->sDetailData[0]['copctContent']);
			$this->sDetailData[0]['copctContent']=$this->sCPButton->getContent();
		}else {
			$this->sDetailData[0]['copctContent']=str_replace($this->sysSPLIT12,'',$this->sDetailData[0]['copctContent']);
		}
		//-- ------ #Group ------ --
		$tmpSQL=' SELECT A.copgtID,A.copgtName,
			B.copgctTemplateid_Detail,B.copgctContent,B.copgctInfo_Moderator
			FROM {Nets.TableHead}commpostsgroup AS A 
			INNER JOIN {Nets.TableHead}commpostsgroupcont AS B ON B.copgctIndexID=A.copgtID
			WHERE 1=1 AND A.copgtRecycle=0 AND A.copgtChecked>1 AND A.copgtID={Nets.ID} ';
		$tmpSTR=str_replace('{Nets.TableHead}',$this->sysTableHead,$tmpSQL);
		$tmpSTR=str_replace('{Nets.ID}',$this->sDetailData[0]['coptParid'],$tmpSTR);
		$this->sData_Group=$this->sDb->Search($tmpSTR);
		if(count($this->sData_Group)==0){
			//#Non group
			//#Other
			$this->sData_Group[0]=array(
				'copgctTemplateid_Detail'=>0
				);
		}
		//-- ------ #Template ------ --
		//#List
		$tmpSQL=' SELECT A.stemtID,A.stemtName,B.stemctPath 
			FROM {Nets.TableHead}netssystemplate AS A
			INNER JOIN {Nets.TableHead}netssystemplatecont AS B ON B.stemctIndexID=A.stemtID
			WHERE 1=1 AND A.stemtRecycle=0 AND A.stemtChecked>1 AND A.stemtID={Nets.ID} ';
		$tmpSTR=str_replace('{Nets.TableHead}',$this->sysTableHead,$tmpSQL);
		$tmpSTR=str_replace('{Nets.ID}',$this->sData_Group[0]['copgctTemplateid_Detail'],$tmpSTR);
		$tmpData0=$this->sDb->Search($tmpSTR);
		if(count($tmpData0)!=0){
			$this->sTemplatePath=$tmpData0[0]['stemctPath'];
		}
		//#Detail
		$tmpSQL=' SELECT A.stemtID,A.stemtName,B.stemctPath 
			FROM {Nets.TableHead}netssystemplate AS A
			INNER JOIN {Nets.TableHead}netssystemplatecont AS B ON B.stemctIndexID=A.stemtID
			WHERE 1=1 AND A.stemtRecycle=0 AND A.stemtChecked>1 AND A.stemtID={Nets.ID} ';
		$tmpSTR=str_replace('{Nets.TableHead}',$this->sysTableHead,$tmpSQL);
		$tmpSTR=str_replace('{Nets.ID}',$this->sDetailData[0]['copctTemplateid_Detail'],$tmpSTR);
		$tmpData0=$this->sDb->Search($tmpSTR);
		if(count($tmpData0)!=0){
			$this->sTemplatePath=$tmpData0[0]['stemctPath'];
		}
		//-- ------ #Navigation ------ --
		$this->sNavigation=$this->sDb->getParent($this->sDetailData[0]['coptParid'],$this->sysTableHead.'commpostsgroup','copgt');
		//-- ------ #Other ------ --
		//Next
		$tmpSQL=' SELECT A.coptID,A.coptName,A.coptCreateTime
			FROM {Nets.TableHead}commposts AS A 
			WHERE 1=1 AND A.coptRecycle=0 AND A.coptChecked>1 AND coptID>{Nets.ID} AND A.coptParid={Nets.Parid}
			ORDER BY A.coptOrderBy DESC,A.coptID DESC LIMIT 0,1 ';
		$tmpSTR=str_replace('{Nets.TableHead}',$this->sysTableHead,$tmpSQL);
		$tmpSTR=str_replace('{Nets.ID}',$this->sDetailData[0]['coptID'],$tmpSTR);
		$tmpSTR=str_replace('{Nets.Parid}',$this->sDetailData[0]['coptParid'],$tmpSTR);
		$this->sNextData=$this->sDb->Search($tmpSTR);
		//Previous
		$tmpSQL=' SELECT A.coptID,A.coptName,A.coptCreateTime
			FROM {Nets.TableHead}commposts AS A 
			WHERE 1=1 AND A.coptRecycle=0 AND A.coptChecked>1 AND coptID<{Nets.ID} AND A.coptParid={Nets.Parid}
			ORDER BY A.coptOrderBy DESC,A.coptID DESC LIMIT 0,1 ';
		$tmpSTR=str_replace('{Nets.TableHead}',$this->sysTableHead,$tmpSQL);
		$tmpSTR=str_replace('{Nets.ID}',$this->sDetailData[0]['coptID'],$tmpSTR);
		$tmpSTR=str_replace('{Nets.Parid}',$this->sDetailData[0]['coptParid'],$tmpSTR);
		$this->sPreviousData=$this->sDb->Search($tmpSTR);
		//Other
		$tmpSQL=' SELECT A.coptID,A.coptName,A.coptCreateTime
			FROM {Nets.TableHead}commposts AS A 
			WHERE 1=1 AND A.coptRecycle=0 AND A.coptChecked>1 AND A.coptParid={Nets.Parid}
			ORDER BY A.coptOrderBy DESC,A.coptID DESC LIMIT 0,8 ';
		$tmpSTR=str_replace('{Nets.TableHead}',$this->sysTableHead,$tmpSTR);
		$tmpSTR=str_replace('{Nets.Parid}',$this->sDetailData[0]['coptParid'],$tmpSTR);
		$this->sOtherData=$this->sDb->Search($tmpSTR);
		//-- ------ #Discuss ------ --
		$tmpListSTR0='DList0';
		$tmpListAR0=$this->getQueryString($tmpListSTR0);
		$tmpSortSTR0='DSort0';
		$tmpSortAR0=$this->AnalyerRequest($tmpSortSTR0,'copdtID,2',0);
		//Data
		$tmpSQL=' SELECT A.copdtID,A.copdtCreateTime,A.copdtCreateBy,A.copdtCreateTime,
			B.copdctContent,B.copdctPublisher_Source,B.copdctPublisher_Name,
			D.uictCoSignature
			
			FROM {Nets.TableHead}commpostsdiscuss AS A
			INNER JOIN {Nets.TableHead}commpostsdiscusscont AS B ON B.copdctIndexID=A.copdtID
			INNER JOIN {Nets.TableHead}netsuserinfo AS C ON C.uitID=A.copdtCreateBy
			INNER JOIN {Nets.TableHead}netsuserinfocont AS D ON D.uictIndexID=C.uitID
			WHERE 1=1 AND A.copdtRecycle=0 AND A.copdtChecked>1 AND A.copdtParid={Nets.ID} ';
		if ($this->sOnly_User!=-1){
			$tmpSQL.=' AND A.copdtCreateBy='.$this->sOnly_User.' ';
		}
		$tmpSQL.=' ORDER BY A.copdtOrderBy DESC,A.copdtID DESC ';
		$tmpSTR=str_replace('{Nets.TableHead}',$this->sysTableHead,$tmpSQL);
		$tmpSTR=str_replace('{Nets.ID}',$this->sMainID,$tmpSTR);
		$this->sDiscussData=$this->sDb->SearchP($tmpSTR,$tmpListAR0);
		$this->sRecordCount=$this->sDb->sysPageInfo[3];
		//#Set page button
		$this->sPButton->resetTemlate('../../../Config/m_default/File/BbsListPageButton.htm');
		$this->sPButton->sPage=$this->sysPage;
		$this->sPButton->sExtendParameter='&ID='.$this->sMainID;
		$this->sPButton->setPage($this->sDb->sysPageInfo);
		//-- ------ #Discuss form ------ --
		$this->sUiDescription_0=array();
		$tmpSTR=$this->sUiDescriptionPath.'Plus/comm/posts_discuss.php';
		if(file_exists($tmpSTR)){
			require($tmpSTR);
			$this->sUiDescription_0=$sysUiDescriptions['posts_discuss'];
			$sysUiDescriptions=array();
		}
		
	}
	public function DefUiPanel(&$pColumn,$pFlag){
		if($pColumn['stcotName']=='copdctContent' && $pFlag=='Normal'){
			$pColumn['ControlStyle']='width:640px;height:40px;';
			$pColumn['Parameter_JS_Onfocus']="tmpMCommon.OnDiscussInput(this.name,0);CCodeTxt_ShowCACode(0);";
		}
	}
	
	public function DefUiJscript($pFlag){
?>
function jsDCheck(pPara){
	var tmpControl="";
	var tmpError="";
	var tmpChecker=new netsChecker();
	var tmpActionWithOut=document.getElementById("ActionWithOut");
	var Coun0=0;
	//-- ------ #ActionWithOut ------ --
	if(tmpActionWithOut==undefined){
		return true;
	}
	if(tmpActionWithOut.value=="1"){
		return true;
	}else if(tmpActionWithOut.value=="2"){
		return false;
	}
	//-- ------ #Check ------ --
	//#coprctContent
	tmpCheckCont=document.getElementById("coprctContentTxt");
	tmpCheckCont.value=tmpChecker.Filter(tmpCheckCont.value,0);
	if(tmpCheckCont.value.length<3){
		Coun0++;
		tmpError+=Coun0+".内容不能小于3个字符。"+sysSPLIT8;
	}
	//#coprtCCode
	tmpCheckCont=document.getElementById("coprtCCodeTxt");
	tmpCheckCont.value=tmpChecker.Filter(tmpCheckCont.value,0);
	if(tmpCheckCont.value.length!=5){
		Coun0++;
		tmpError+=Coun0+".验证码必须为5位数字。"+sysSPLIT8;
	}
	//-- ------ #Result ------ --
	if(tmpError!=""){
		tmpSTR="<span class=\"FStrong\">对不起，您提交的内容存在以下错误:</span>"+sysSPLIT8+tmpError;
		showMessage("系统消息 - <?php echo ($this->sysFileConfig['bussinessMetaTitle']); ?>",tmpSTR,"","0");
		return false;
	}else{
		return true;
	}
}
<?php
	}
}
?>