function SpGetTopID($tid){ global $_Cs; if(!is_array($_Cs)){ require_once(dirname(__FILE__)."/../data/cache/inc_catalog_base.php"); } if($v[$tid][0]==0) return $tid; else return SpGetTopID($tid); }
function GetMyNews($row=1,$titlelen=30,$innertext=""){ if($row=="") $row=1; if($titlelen=="") $titlelen=30; if($innertext=="") $innertext = GetSysTemplets("mynews.htm"); if($this->TypeID > 0){ $topid = SpGetTopID($this->TypeID); $idsql = " where typeid='$topid' "; }else{ $idsql = ""; } $this->dsql->SetQuery("Select * from #@__mynews $idsql order by senddate desc limit 0,$row"); $this->dsql->Execute(); $ctp = new DedeTagParse(); $ctp->SetNameSpace("field","[","]"); $ctp->LoadSource($innertext); $revalue = ""; while($row = $this->dsql->GetArray()) { foreach($ctp->CTags as $tagid=>$ctag){ @$ctp->Assign($tagid,$row[$ctag->GetName()]); } $revalue .= $ctp->GetResult(); } return $revalue; }