<?php
class tagAction extends baseAction {
    public function index(){
    $data = D('pages');
    if(I('t') == ''){
    	$this->error("参数错误");
    	exit;
    }
    $result_tag = M('tag')->where("title='". I('t') ."'")->find();
	$map = " 1=1 and a.tid='". $result_tag['id'] ."' and b.status=1 ";
	$order = ' order by b.yes desc,b.comment desc, b.id desc ';
	$result = $data->taginfo_page(25,$map,$order,'tag');
	// print_r($result);
	$this->assign('list',$result['list']);
	$this->assign('page',$result['page']);
	//调取列表页笑话大全
	$dq_list = M('tag')->order("number desc")->limit(30)->select();
	//调取爆笑精选，带图片
	$bx_list = M('content_content')->where("status=1 and thumb != ''")->order('rand()')->limit(10)->select();
	$this->assign('dq_list',$dq_list);
	$this->assign('bx_list',$bx_list);
	$this->assign('info',$result_tag);
	$this->assign('counts',$result['count']);
	$this->assign('model','tag');
	$this->assign('action','tag');
	$this->display(C('default_tpl').'/Index/tag');
    }
}