Exemplo n.º 1
0
 public function index()
 {
     $is_subsite = false;
     $typeinfo = get_type_infos();
     if (intval($typeinfo['typeid']) < 1) {
         $typeinfo = get_area_type_infos($this->siteInfo['id']);
         $is_subsite = true;
     }
     $typeid = $typeinfo['typeid'];
     $typeset = $typeinfo['typeset'];
     //left
     $listparm['type_id'] = $typeid;
     //$typeinfo = Array ( [typeset] => 1 [templet] => list_index [typeid] => 37 )
     $listparm['limit'] = 20;
     if ($is_subsite === false) {
         $leftlist = getTypeListActa($listparm);
     } else {
         $listparm['area_id'] = $this->siteInfo['id'];
         $leftlist = getAreaTypeList($listparm);
     }
     $this->assign("leftlist", $leftlist);
     $this->assign("cid", $typeid);
     if ($typeset == 1) {
         $parm['pagesize'] = 15;
         $parm['type_id'] = $typeid;
         if ($is_subsite === false) {
             $list = getArticleList($parm);
             $vo = D('Acategory')->find($typeid);
             if ($vo['parent_id'] != 0) {
                 $this->assign('cname', D('Acategory')->getFieldById($vo['parent_id'], 'type_name'));
             } else {
                 $this->assign('cname', $vo['type_name']);
             }
         } else {
             $vo = D('Aacategory')->find($typeid);
             if ($vo['parent_id'] != 0) {
                 $this->assign('cname', D('Aacategory')->getFieldById($vo['parent_id'], 'type_name'));
             } else {
                 $this->assign('cname', $vo['type_name']);
             }
             $parm['area_id'] = $this->siteInfo['id'];
             $list = getAreaArticleList($parm);
         }
         $this->assign("vo", $vo);
         $this->assign("list", $list['list']);
         $this->assign("pagebar", $list['page']);
     } else {
         if ($is_subsite === false) {
             $vo = D('Acategory')->find($typeid);
             if ($vo['parent_id'] != 0) {
                 $this->assign('cname', D('Acategory')->getFieldById($vo['parent_id'], 'type_name'));
             } else {
                 $this->assign('cname', $vo['type_name']);
             }
         } else {
             $vo = D('Aacategory')->find($typeid);
             if ($vo['parent_id'] != 0) {
                 $this->assign('cname', D('Aacategory')->getFieldById($vo['parent_id'], 'type_name'));
             } else {
                 $this->assign('cname', $vo['type_name']);
             }
         }
         $this->assign("vo", $vo);
     }
     // 新增改动左侧菜单高亮
     $active_bar = '';
     if (!empty($vo) && isset($vo['type_nid'])) {
         $active_bar = $vo['type_nid'];
     }
     $this->assign("active_bar", $active_bar);
     // 政策法规特殊处理
     $is_zcfg = 0;
     if (!empty($vo) && isset($vo['type_nid']) && $vo['type_nid'] == 'zcfg') {
         $is_zcfg = 1;
     }
     $this->assign("is_zcfg", $is_zcfg);
     $this->display($typeinfo['templet']);
 }
Exemplo n.º 2
0
 public function index()
 {
     $is_subsite = false;
     $typeinfo = get_type_infos();
     if (intval($typeinfo['typeid']) < 1) {
         $typeinfo = get_area_type_infos($this->siteInfo['id']);
         $is_subsite = true;
     }
     $typeid = $typeinfo['typeid'];
     $typeset = $typeinfo['typeset'];
     //left
     $listparm['type_id'] = $typeid;
     $listparm['limit'] = 10;
     if ($is_subsite === false) {
         $leftlist = getTypeList($listparm);
     } else {
         $listparm['area_id'] = $this->siteInfo['id'];
         $leftlist = getAreaTypeList($listparm);
     }
     $this->assign("leftlist", $leftlist);
     $this->assign("cid", $typeid);
     if ($typeset == 1) {
         $parm['pagesize'] = 10;
         $parm['type_id'] = $typeid;
         if ($is_subsite === false) {
             $list = getArticleList($parm);
             $vo = D('Acategory')->find($typeid);
             if ($vo['parent_id'] != 0) {
                 $this->assign('cname', D('Acategory')->getFieldById($vo['parent_id'], 'type_name'));
             } else {
                 $this->assign('cname', $vo['type_name']);
             }
         } else {
             $vo = D('Aacategory')->find($typeid);
             if ($vo['parent_id'] != 0) {
                 $this->assign('cname', D('Aacategory')->getFieldById($vo['parent_id'], 'type_name'));
             } else {
                 $this->assign('cname', $vo['type_name']);
             }
             $parm['area_id'] = $this->siteInfo['id'];
             $list = getAreaArticleList($parm);
         }
         $this->assign("vo", $vo);
         $this->assign("list", $list['list']);
         $this->assign("pagebar", $list['page']);
     } else {
         if ($is_subsite === false) {
             $vo = D('Acategory')->find($typeid);
             if ($vo['parent_id'] != 0) {
                 $this->assign('cname', D('Acategory')->getFieldById($vo['parent_id'], 'type_name'));
             } else {
                 $this->assign('cname', $vo['type_name']);
             }
         } else {
             $vo = D('Aacategory')->find($typeid);
             if ($vo['parent_id'] != 0) {
                 $this->assign('cname', D('Aacategory')->getFieldById($vo['parent_id'], 'type_name'));
             } else {
                 $this->assign('cname', $vo['type_name']);
             }
         }
         $this->assign("vo", $vo);
     }
     $this->display($typeinfo['templet']);
 }