chengkun
2025-05-26 8f3df543230cd4403368b39b9bbe5726d11a0284
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
<?php
 
class index_controller extends common{
    /**
     * 网站公告列表/公告详情
     */
    function index_action(){
        if((int)$_GET['id']){
            $id                =    (int)$_GET['id'];
            $announcementM    =    $this->MODEL('announcement');
            $gonggao        =    $announcementM->getInfo(array('id'=>$id));
            
            if($gonggao['id']==''){
                $this->ACT_msg($this->config['sy_weburl'],"没有找到该公告!");
            }
            //上一篇
            $annou_last=$announcementM->getInfo(array('id'=>array('<',$id),'orderby'=>'id,desc'));
            if(!empty($annou_last)){
                $annou_last['url']=Url('announcement',array('id'=>$annou_last['id']));
            }
            $gonggao["last"]    =    $annou_last;
            //下一篇
            $annou_next=$announcementM->getInfo(array('id'=>array('>',$id),'orderby'=>'id,asc'));
            if(!empty($annou_next)){
                $annou_next['url']=Url('announcement',array('id'=>$annou_next['id']));
            }
            $gonggao["next"]    =    $annou_next;
            $this->yunset("Info",$gonggao);
            
            $data['gg_title']    =    $gonggao['title'];//新闻名称
            $description        =    $gonggao['description']?$gonggao['description']:$gonggao['content'];
            $data['gg_desc']    =    $this->GET_content_desc($gonggao['description']);//描述
            $this->data            =    $data;
            $this->seo("announcement");
            
            $this->yun_tpl(array('show'));
        }else{
            $this->seo("announcement_index");
            $this->yun_tpl(array('index'));
        }
    }
    function show_action(){
 
        $this->seo("announcement");
        $this->yun_tpl(array('show'));
    }
}
?>