//<?    
        $this->_checked['index_post']=" class='current'";
		$this->_title[] = $this->conf['seo_title'] ? $this->conf['seo_title'] :$this->conf['app_name'];
		$this->_seo_keywords = $this->conf['seo_keywords'];
		$this->_seo_description = $this->conf['seo_description'];
		
		$pagesize = 15;
		$toplist = array(); // only top 3
		$readtids = '';
		
		//$this->kv->delete('index_forum_list');
		// 贴吧分类
		$cate_cache=$this->kv->get('index_forum_list');
		
		if(!$cate_cache){
			$catelist=$this->kv->get('index_bbs_show');//$this->category->index_fetch(array('pid'=>0), array('rank'=>-1), 0, 20);
			
			$forums=array();
			foreach($catelist as $cid=>&$cate){
				$cat_forums=array();
				$flist=$this->forum->get_list(array('cat_tid'=>$cid,'recommend'=>1),array('rank'=>-1),0,$cate['max']);
				foreach($flist as $f){
				   $cat_forums[]=$forums[]=$f['fid'];
				}
				if($cate['showtype']==1){
					$m=count($cat_forums)%$cate['num'];
					if($m){
						if(count($cat_forums)<$cate['num']) $m=$cate['num']-count($cat_forums);
						for($i=1;$i<=$m;$i++){
							array_push($cat_forums,'0');
						}
					}
				}
				$ncate=array('name'=>$cate['name'],'forumlist'=>$cat_forums,'showtype'=>$cate['showtype']);//'forumlist'=>$flist,
				if($cate['showtype']==1){
					$ncate['num']=$cate['num'];	
					$ncate['width']=100/$cate['num'];	
					$ncate['line']=ceil(count($cat_forums)/$cate['num']);
				}
				$cate=$ncate;
			}
			$cate_cache=array();
			$cate_cache['forums']=$forums;
			$cate_cache['catelist']=$catelist;
			$this->kv->set('index_forum_list',$cate_cache);
		}else{
			$catelist=$cate_cache['catelist'];
			$forums=$cate_cache['forums'];
		}
		//print_r($cate_cache);exit;
		$forum_list=$this->forum->mget($forums);
		$forum_list2=array();
		foreach($forum_list as $fm){
			if(empty($fm)) continue;
			$this->forum->format($fm);
			$forum_list2[$fm['fid']]=$fm;
		}
		$forum_list=$forum_list2;
		
		
		$ismod = ($this->_user['groupid'] > 0 && $this->_user['groupid'] <= 4);
		$fid = 0;
		
		$friendlinklist = $this->mcache->read('friendlink');
		//热门标签
		$hot_tags=$this->kv->get('index_hottags');
		if(!$hot_tags){
		     $hot_tags=$this->tags->get_hots(32);
			 $this->kv->set('index_hottags',$hot_tags,3600);
		}
		//显示焦点图、帖子
		$show_newtopics=1;
		
		$this->view->assign('show_newtopics',$show_newtopics);
		$this->view->assign('hot_tags',$hot_tags);
		$this->view->assign('friendlinklist', $friendlinklist);
		$this->view->assign('ismod', $ismod);
		$this->view->assign('fid', $fid);
		$this->view->assign('catelist',$catelist);
		$this->view->assign('forum_list',$forum_list);
		
		$this->view->display('index.html');
		exit;