<?php
class PaDefault extends CustomPage {
	public function PaDefault(){
		$this->CustomPage();
	}
	public function OnBInitial(){
		$this->sMetaTitle='首页';
		$this->getUser('1,2,3,4,5,');
	}
	public function OnList(){
		$this->sMainID=2;
		//-- ------ #INFO ------ --
		//-- #Today --
		$tmpDate=date($this->sysTimeFormat);
		$tmpAR0=$this->sCode->TimeToArray($tmpDate);
		$tmpAR0[2]--;
		$tmpDatetime=$this->sCode->TimeFormat($tmpAR0[0].'-'.$tmpAR0[1].'-'.$tmpAR0[2].' '.$tmpAR0[3].':'.$tmpAR0[4].':'.$tmpAR0[5],0);
		$tmpSQL=' SELECT A.coptID
			FROM {Nets.TableHead}commposts AS A
			WHERE 1=1 AND A.coptRecycle=0 AND A.coptChecked>1 AND A.coptCreateTime>\'{Nets.CreateTime}\'';
		$tmpSTR=str_replace('{Nets.TableHead}',$this->sysTableHead,$tmpSQL);
		$tmpSTR=str_replace('{Nets.CreateTime}',$tmpDatetime,$tmpSTR);
		$tmpData0=$this->sDb->Search($tmpSTR);
		$this->sRecordCount_Today=count($tmpData0);
		//-- #All --
		$tmpSQL=' SELECT A.coptID
			FROM {Nets.TableHead}commposts AS A
			WHERE 1=1 AND A.coptRecycle=0 AND A.coptChecked>1 ';
		$tmpSTR=str_replace('{Nets.TableHead}',$this->sysTableHead,$tmpSQL);
		$tmpData0=$this->sDb->Search($tmpSTR);
		$this->sRecordCount_AllPost=count($tmpData0);
		//-- #User --
		$tmpSQL=' SELECT A.uitID
			FROM {Nets.TableHead}netsuserinfo AS A
			WHERE 1=1 AND A.uitRecycle=0 AND A.uitChecked>1 ';
		$tmpSTR=str_replace('{Nets.TableHead}',$this->sysTableHead,$tmpSQL);
		$tmpData0=$this->sDb->Search($tmpSTR);
		$this->sRecordCount_User=count($tmpData0);
		//-- #News --
		$tmpParid=1;
		$tmpSQL=' SELECT A.cdtID,A.cdtName,A.cdtNameStyle,A.cdtCreateTime
			FROM {Nets.TableHead}cmsdoc AS A
			WHERE 1=1 AND A.cdtRecycle=0 AND A.cdtChecked>1 AND A.cdtParid={Nets.Parid}
			ORDER BY A.cdtOrderBy DESC,A.cdtID DESC LIMIT 0,1 ';
		$tmpSTR=str_replace('{Nets.TableHead}',$this->sysTableHead,$tmpSQL);
		$tmpSTR=str_replace('{Nets.Parid}',$tmpParid,$tmpSTR);
		$this->sData_News=$this->sDb->Search($tmpSTR);
		
		
		//-- ------ #Boards ------ --
		$this->sPostsGroupSQL=' SELECT A.copgtID,A.copgtName,
			B.copgctSourceR00,B.copgctCount_Info
			FROM '.$this->sysTableHead.'commpostsgroup AS A 
			INNER JOIN '.$this->sysTableHead.'commpostsgroupcont AS B ON B.copgctIndexID=A.copgtID
			WHERE 1=1 AND A.copgtRecycle=0 AND A.copgtChecked>1 AND A.copgtParid={Nets.ID}
			ORDER BY A.copgtOrderBy DESC,A.copgtID DESC ';
	}
}
?>