<?php
require($netsFileConfig['sysCoreRoot'].'Cache/DbDescription/commmicroblogging.php');
require($netsFileConfig['sysCoreRoot'].'Cache/DbDescription/commmicrobloggingcont.php');
require($netsFileConfig['sysCoreRoot'].'Cache/DbDescription/commmicrobloggingdiscuss.php');
require($netsFileConfig['sysCoreRoot'].'Cache/DbDescription/commmicrobloggingdiscusscont.php');
require($netsFileConfig['sysCoreRoot'].'Inc/m_Comm/Microblogging/commmicroblogging.php');
require($netsFileConfig['sysCoreRoot'].'Inc/m_Comm/Microblogging/commmicrobloggingdiscuss.php');

require($netsFileConfig['sysCoreRoot'].'Inc/m_Oa/Oa/oacontact.php');

class PaDefault extends CustomPage {
	public function PaDefault(){
		$this->CustomPage();
	}
	public function OnBInitial(){
		$this->sMetaTitle='微博详细页';
		$this->getUser('1,2,3,4,5,');
		$this->sApp=new commmicroblogging($this->sConnString);
		$this->sTemplatePath='Comm/microbloggingDetail_Normal.php';
		
		//-- ------ #Contact ------ --
		$this->sContactApp=new oacontact($this->sConnString);
		$this->sContacts=array();
		$tmpINT=$this->sContactApp->GetContactToArray($this->sUserInfo[0]['Columns']['uitID']['Value'],$this->sContacts);
		
		//-- ------ #ActionType ------ --
		if ($this->sActionType=='DPositive') {
			$this->OnPositive();
		}else if ($this->sActionType=='DNegative') {
			$this->OnNegative();
			
		}else if ($this->sActionType=='DAdd_Get') {
			$this->OnAdd_Get();
			
		}
	}
	public function OnPositive(){
		$tmpAR0=$this->AnalyerRequest('ID',0,0);
		$this->sMainID=$tmpAR0[0];
		//-- ------ #Update ------ --
		//Get cookie
		$tmpCookieName=$this->sysCookieHead.'Cookie_CommMicroblogging_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}commmicrobloggingcont AS A 
			SET A.combctCode_Positive=A.combctCode_Positive+1
			WHERE 1=1 AND A.combctIndexID={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.combctID,combctCode_Positive
			FROM {Nets.TableHead}commmicrobloggingcont AS A
			WHERE 1=1 AND A.combctIndexID={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]['combctCode_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_CommMicroblogging_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}commmicrobloggingcont AS A 
			SET A.combctCode_Negative=A.combctCode_Negative+1
			WHERE 1=1 AND A.combctIndexID={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.combctID,combctCode_Negative
			FROM {Nets.TableHead}commmicrobloggingcont AS A
			WHERE 1=1 AND A.combctIndexID={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]['combctCode_Negative'];
		$this->sJscript=$this->Message('ERROR','',$this->sMessage,'');
		return 0;
	}
	public function OnAdd_Get(){
		//-- ------ #Content ------ --
		//Content,Parid,CreateBy,Publisher_Name
		$tmpCONTENTS=$this->AnalyerRequest('DAdd_Get',',-1,-1,,',0);
		//-- ------ #ADD ------ --
		$this->sTable=array(
			array('sttTableName'=>$this->sysTableHead.'commmicrobloggingdiscuss','sttColumnHead'=>'combdt'),
			array('sttTableName'=>$this->sysTableHead.'commmicrobloggingdiscusscont','sttColumnHead'=>'combdct'),);
		$tmpDbDescriptions=array();
		foreach ($this->sTable as $tableCell){
			$tmpDbDescriptions[]=$this->sDbDescriptions[$tableCell['sttTableName']];
		}
		$tmpApp=new commmicrobloggingdiscuss($this->sConnString);
		
		$tmpMainUserid[0]=$tmpCONTENTS[2];
		//-- ------ #Add ------ --
		$this->sApp->TransStart();
		//#Get numCode
		$tmpSTR=$this->sTable[0]['sttColumnHead'].'NumCode';
		$tmpDbDescriptions[0]['TableDescription']['SearchColumn']=$tmpSTR;
		$tmpDbDescriptions[0]['Columns'][$tmpSTR]['Value']='N_'.date('YmdHis');
		$tmpApp->numCode($tmpDbDescriptions[0]);
		//-- #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]])){
					if ($tmpDbDescriptions[1]['Columns'][$this->sTable[1]['sttColumnHead'].$Row0[0]]['Value']==$Row0[1]) {
						$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 && isset($tmpDbDescriptions[1]['Columns'][$this->sTable[1]['sttColumnHead'].$Row0[0]])) {
				$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($tmpDbDescriptions[$Cell[0]]['Columns'][$Cell[1]]['Value'])){
				$tmpDbDescriptions[$Cell[0]]['Columns'][$Cell[1]]['Value']=$Cell[2];
			}
		}
		//-- #Set spical --
		//Content,Parid,CreateBy,Publish_Name
		$tmpDbDescriptions[1]['Columns'][$this->sTable[1]['sttColumnHead'].'Content']['Value']=$tmpCONTENTS[0];
		$tmpDbDescriptions[0]['Columns'][$this->sTable[0]['sttColumnHead'].'Parid']['Value']=$tmpCONTENTS[1];
		$tmpDbDescriptions[0]['Columns'][$this->sTable[0]['sttColumnHead'].'CreateBy']['Value']=$tmpCONTENTS[2];
		$tmpDbDescriptions[1]['Columns'][$this->sTable[1]['sttColumnHead'].'Publisher_Name']['Value']=$tmpCONTENTS[3];
		
		$tmpDbDescriptions[0]['Columns'][$this->sTable[0]['sttColumnHead'].'Name']['Value']=$tmpCONTENTS[0];
		$tmpDbDescriptions[0]['Columns'][$this->sTable[0]['sttColumnHead'].'Checked']['Value']=2;
		
		//#Add
		$tmpINT=$tmpApp->Check($tmpDbDescriptions,array(),array());
		if($tmpINT!=0){
			$tmpApp->TransRollback();
			$this->sMessage=$tmpApp->sysLastError.$this->sysSPLIT1.$tmpCONTENTS[1];
			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->sMessage=$tmpApp->sysLastError.$this->sysSPLIT1.$tmpCONTENTS[1];
			return 1;
		}
		
		foreach ($this->sDb->sysDbCacheClear as $Cell){
			$this->clearCache($Cell);
		}
		foreach ($this->sysPageCacheClear as $Cell){
			$this->clearCache($Cell);
		}
		$tmpApp->TransCommit();
		$this->sMessage='回复成功'.$this->sysSPLIT1.$tmpCONTENTS[1];
		/*
		$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 OnAdd(){
		$this->sTable=array(
			array('sttTableName'=>$this->sysTableHead.'commmicrobloggingdiscuss','sttColumnHead'=>'combdt'),
			array('sttTableName'=>$this->sysTableHead.'commmicrobloggingdiscusscont','sttColumnHead'=>'combdct'),);
		$tmpDbDescriptions=array();
		foreach ($this->sTable as $tableCell){
			$tmpDbDescriptions[]=$this->sDbDescriptions[$tableCell['sttTableName']];
		}
		$tmpApp=new commmicrobloggingdiscuss($this->sConnString);
		
		$tmpMainid=$this->AnalyerRequest('mainID','0',1);
		$tmpMainUserid=$this->AnalyerRequest('mainUserid',0,1);
		$tmpMainTableid=$this->AnalyerRequest('mainTableid',0,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_'.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($tmpDbDescriptions[$Cell[0]]['Columns'][$Cell[1]]['Value'])){
				$tmpDbDescriptions[$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->sCode->Int32($tmpMainid[0],0);
		$tmpDbDescriptions[0]['Columns'][$this->sTable[0]['sttColumnHead'].'CreateTime']['Value']=date($this->sysTimeFormat);
		$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;
		}
		//#Add
		$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;
		}
		
		foreach ($this->sDb->sysDbCacheClear as $Cell){
			$this->clearCache($Cell);
		}
		foreach ($this->sysPageCacheClear as $Cell){
			$this->clearCache($Cell);
		}
		$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('DType',0,0);
		$this->sType=$tmpAR0[0];
		//-- ------ #Initial ------ --
		$tmpINT=$this->sApp->initialObject($this->sMainID);
		//-- ------ #Datas ------ --
		$tmpSQL=' SELECT A.combtID,A.combtName,A.combtParid,A.combtCreateBy,A.combtCreateTime,
			B.combctTemplateid_Detail,B.combctCount_Views,B.combctContent,B.combctSources,
			B.combctCount_Discuss,B.combctPageAble,B.combctTemplateid_Detail,B.combctPublisher_Name
			FROM {Nets.TableHead}commmicroblogging AS A 
			INNER JOIN {Nets.TableHead}commmicrobloggingcont AS B ON B.combctIndexID=A.combtID
			WHERE 1=1 AND A.combtRecycle=0 AND A.combtChecked>1 AND A.combtID={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)==0){
			//#Error
			//#Other
			$tmpSQL=' SELECT A.combtID,A.combtName,A.combtParid,A.combtCreateTime
				FROM {Nets.TableHead}commmicroblogging AS A 
				WHERE 1=1 AND A.combtRecycle=0 AND A.combtChecked>1
				ORDER BY A.combtOrderBy DESC,A.combtID 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]['combtID'];
		$this->sMetaTitle=$this->sDetailData[0]['combtName'];
		$this->sParid=$this->sDetailData[0]['combtParid'];
		
		if($this->sDetailData[0]['combctPageAble']==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]['combctContent']);
			$this->sDetailData[0]['combctContent']=$this->sCPButton->getContent();
		}else {
			$this->sDetailData[0]['combctContent']=str_replace($this->sysSPLIT12,'',$this->sDetailData[0]['combctContent']);
		}
		//-- ------ #Group ------ --
		$tmpSQL=' SELECT A.combgtID,A.combgtName,B.combgctTemplateid_Detail
			FROM {Nets.TableHead}commmicroblogginggroup AS A 
			INNER JOIN {Nets.TableHead}commmicroblogginggroupcont AS B ON B.combgctIndexID=A.combgtID
			WHERE 1=1 AND A.combgtRecycle=0 AND A.combgtChecked>1 AND A.combgtID={Nets.ID} ';
		$tmpSTR=str_replace('{Nets.TableHead}',$this->sysTableHead,$tmpSQL);
		$tmpSTR=str_replace('{Nets.ID}',$this->sDetailData[0]['combtParid'],$tmpSTR);
		$this->sData_Group=$this->sDb->Search($tmpSTR);
		if(count($this->sData_Group)==0){
			//#Non group
			//#Other
			$this->sData_Group[0]=array(
				'combgctTemplateid_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]['combgctTemplateid_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]['combctTemplateid_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]['combtParid'],$this->sysTableHead.'commmicroblogginggroup','combgt');
		//-- ------ #Other ------ --
		//Next
		$tmpSQL=' SELECT A.combtID,A.combtName,A.combtCreateTime
			FROM {Nets.TableHead}commmicroblogging AS A 
			WHERE 1=1 AND A.combtRecycle=0 AND A.combtChecked>1 AND combtID>{Nets.ID} AND A.combtParid={Nets.Parid}
			ORDER BY A.combtOrderBy DESC,A.combtID DESC LIMIT 0,1 ';
		$tmpSTR=str_replace('{Nets.TableHead}',$this->sysTableHead,$tmpSQL);
		$tmpSTR=str_replace('{Nets.ID}',$this->sDetailData[0]['combtID'],$tmpSTR);
		$tmpSTR=str_replace('{Nets.Parid}',$this->sDetailData[0]['combtParid'],$tmpSTR);
		$this->sNextData=$this->sDb->Search($tmpSTR);
		//Previous
		$tmpSQL=' SELECT A.combtID,A.combtName,A.combtCreateTime
			FROM {Nets.TableHead}commmicroblogging AS A 
			WHERE 1=1 AND A.combtRecycle=0 AND A.combtChecked>1 AND combtID<{Nets.ID} AND A.combtParid={Nets.Parid}
			ORDER BY A.combtOrderBy DESC,A.combtID DESC LIMIT 0,1 ';
		$tmpSTR=str_replace('{Nets.TableHead}',$this->sysTableHead,$tmpSQL);
		$tmpSTR=str_replace('{Nets.ID}',$this->sDetailData[0]['combtID'],$tmpSTR);
		$tmpSTR=str_replace('{Nets.Parid}',$this->sDetailData[0]['combtParid'],$tmpSTR);
		$this->sPreviousData=$this->sDb->Search($tmpSTR);
		//Other
		$tmpSQL=' SELECT A.combtID,A.combtName,A.combtCreateTime
			FROM {Nets.TableHead}commmicroblogging AS A 
			WHERE 1=1 AND A.combtRecycle=0 AND A.combtChecked>1 AND A.combtParid={Nets.Parid}
			ORDER BY A.combtOrderBy DESC,A.combtID DESC LIMIT 0,8 ';
		$tmpSTR=str_replace('{Nets.TableHead}',$this->sysTableHead,$tmpSQL);
		$tmpSTR=str_replace('{Nets.Parid}',$this->sDetailData[0]['combtParid'],$tmpSTR);
		$this->sOtherData=$this->sDb->Search($tmpSTR);
		//-- ------ #Discuss ------ --
		$tmpListSTR0='DList0';
		$tmpListAR0=$this->getQueryString($tmpListSTR0);
		$tmpSortSTR0='DSort0';
		$tmpSortAR0=$this->AnalyerRequest($tmpSortSTR0,'combdtID,2',0);
		//Data
		$tmpSQL=' SELECT A.combdtID,A.combdtCreateTime,A.combdtCreateBy,B.combdctContent,
			B.combdctPublisher_Source,B.combdctPublisher_Name
			FROM {Nets.TableHead}commmicrobloggingdiscuss AS A
			INNER JOIN {Nets.TableHead}commmicrobloggingdiscusscont AS B ON B.combdctIndexID=A.combdtID
			WHERE 1=1 AND A.combdtRecycle=0 AND A.combdtChecked>1 AND A.combdtParid={Nets.ID}
			ORDER BY A.combdtOrderBy DESC,A.combdtID 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->sPAjaxButton->sPage=$this->sysPage;
		$this->sPAjaxButton->sFlag='discussBox';
		$this->sPAjaxButton->sPanel='discussBox_'.$this->sMainID;
		$this->sPAjaxButton->resetTemlate('../../../Config/m_default/File/pageAjaxButton3.htm');
		$this->sPAjaxButton->sExtendParameter='&ID='.$this->sMainID;
		$this->sPAjaxButton->setPage($this->sDb->sysPageInfo);

	}

}

?>