<?php
class IndexAction extends CommonAction{
    public function index(){
		parent::showSiteInfo("微博首页");
		load('extend');
		$group=R("Catch","rCatchGroup");
		$tag=R("Catch","rCatchTag");
		$topic=R("Catch","rNewTopic");
		$topuser=R("Catch","rUserTop");
		$toptag=R("Catch","rTagTop");
		$attenuser=R("Catch","rUserAttention");
		$this->assign('gzuser',$attenuser);
		$this->assign('topic',$topic);
		$this->assign('group',$group);
		$this->assign('tag',$tag);
		$this->assign('toptag',$toptag);
		$this->assign('topuser',$topuser);
		$this->getTop10();
        $this->display();
    }
	private function getTop10()
	{
		$top=M('topic');
		$where['parentid']=0;
		$where['status']=1;
		$list=$top->limit(10)->where($where)->order('id desc')->select();
		foreach($list as $key=>$topic)
		{
			$id=$topic['id'];
			$rlist=$top->limit(2)->where('parentid='.$id)->order('id desc')->select();
			$list[$key]['replay']=$rlist;
		}
		$this->assign('list',$list);
	}
}
?>