<?php
class PaDefault extends CustomPage {
	public function PaDefault(){
		$this->CustomPage();
	}
	public function OnBInitial(){
		$this->sMetaTitle='用户首页';
		$this->getUser('1,2,3,4,5,');
		
		//Parid
		$tmpAR0=$this->sControl->sDbInTemplate;
		$tmpAR0['Connection']=$this->sConnString;
		$tmpAR0['SQL']=' SELECT A.combgtID,A.combgtName,A.combgtParid,A.combgtNameStyle 
			FROM '.$this->sysTableHead.'commmicroblogginggroup AS A
			WHERE 1=1 AND A.combgtRecycle=0 AND A.combgtChecked>1 AND 
			A.combgtParid IN (SELECT combgtID FROM '.$this->sysTableHead.'commmicroblogginggroup WHERE 1=1 AND combgtRecycle=0 AND combgtChecked>1 AND combgtParid={Nets.Parid})
			ORDER BY A.combgtOrderBy DESC,A.combgtID DESC ';
		$tmpAR0['InitialString']=2;
		$tmpAR0['Parid']='combgtID';
		$tmpAR0['Text']='combgtName';
		$tmpAR0['Value']='combgtID';
		$tmpAR0['Type']=1;
		$tmpAR0['Style']='';
		$tmpAR0['Title']='';
		$tmpAR0['AddOne']='';
		$tmpCacheFlag='comm/comm_Microblogginggroup_list_ALL';
		$this->sControl->getOptions($tmpAR0,$tmpCacheFlag,$this->sControl->sDpReturnTemplate,$this->sParid1);
		$this->sParid2=$this->sParid1;
		$tmpAR0=$this->sControl->sDpReturnTemplate;
		$tmpAR0['Text']='所有分类';
		$tmpAR0['Value']=2;
		$tmpAR0['Style']='';
		$tmpAR0['Title']='';
		$tmpAR0['AddOne']='';
		array_push($this->sParid2,$tmpAR0);
		
	}
	public function OnList(){
		$tmpAR0=$this->AnalyerRequest('UID',1,0);
		$this->sMainUserid=$tmpAR0[0];
		
		$tmpSQL=' SELECT A.uitID,A.uitNickname,A.uitEmail,
			B.uictSourceR00,B.uictCo_Software,B.uictCo_Website,B.uictCoSignature,B.uictTemplatepath_Blog
			FROM {Nets.TableHead}netsuserinfo AS A
			INNER JOIN {Nets.TableHead}netsuserinfocont AS B ON B.uictIndexID=A.uitID
			WHERE 1=1 AND A.uitRecycle=0 AND A.uitChecked>1 AND A.uitID={Nets.ID} ';
		$tmpSTR=str_replace('{Nets.TableHead}',$this->sysTableHead,$tmpSQL);
		$tmpSTR=str_replace('{Nets.ID}',$this->sMainUserid,$tmpSTR);
		$this->sData_User=$this->sDb->Search($tmpSTR);
		if (count($this->sData_User)<=0) {
			//#Error
			$this->sTemplatePath=$this->sysFileConfig['bussinessUserHome_Non'];
			return 1;
		}else {
			$this->sTemplatePath=$this->sData_User[0]['uictTemplatepath_Blog'].'default.php';
		}
		$this->sPlace_Root=$this->sysFileConfig['bussinessTemplateRootPath'].$this->sData_User[0]['uictTemplatepath_Blog'];
		$this->sMetaTitle='用户'.$this->sData_User[0]['uitNickname'].'的个人主页';
		
		//-- ------ #Datas ------ --
		$tmpAR0=$this->AnalyerRequest('ID',2,0);
		$this->sMainID=$tmpAR0[0];
		
		$tmpListSTR0='DList0';
		$tmpListAR0=$this->AnalyerRequest($tmpListSTR0,'1,0,24,0',0);
		$tmpSortSTR0='DSort0';
		$tmpSortAR0=$this->AnalyerRequest($tmpSortSTR0,'combtID,2',0);
		//-- #Spell SQL --
		$tmpSQL=' SELECT A.combtID,A.combtName,A.combtParid,A.combtCreateBy,A.combtCreateTime,
			B.combctContent,B.combctSourceR00,
			B.combctCount_Views,B.combctCode_Positive,B.combctCode_Negative,B.combctCount_Discuss,
			B.combctPublisher_Name,B.combctPublisher_Email,B.combctPublisher_Source

			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.combtCreateBy={Nets.CreateBy}
			ORDER BY A.combtOrderBy DESC,A.combtID DESC ';
		$tmpSTR=str_replace('{Nets.TableHead}',$this->sysTableHead,$tmpSQL);
		$tmpSTR=str_replace('{Nets.CreateBy}',$this->sUserInfo[0]['Columns']['uitID']['Value'],$tmpSTR);
		$this->sListData=$this->sDb->SearchP($tmpSTR,$tmpListAR0);
		$this->sRecordCount=$this->sDb->sysPageInfo[3];
		//#Set page button
		$this->sPButton->resetTemlate('../../../Config/m_default/File/pageButton3.htm');
		$this->sPButton->sPage=$this->sysPage;
		$this->sPButton->sExtendParameter='&UID='.$this->sMainUserid.'&ID='.$this->sMainID;
		$this->sPButton->setPage($this->sDb->sysPageInfo);
		
	}
	public function getSearch($pValue,$pType){
		$tmpAR0=array($this->sMainID,);
		if($pType==0) $tmpAR0[0]=$pValue;

		//#SPICAL
		if ($pType==100) {
			/*
			$tmpAR0[8]=0;
			$tmpAR0[9]=0;
			*/
		}else if ($pType==101) {
		}
		//#SPELL
		$tmpSTR=$this->sysPage.'?UID='.$this->sMainUserid.'&ID='.$tmpAR0[0];
		return $tmpSTR;
	}
	
}
?>