Esempio n. 1
0
 public function before_update($data)
 {
     if ($data['type'] == 0) {
         $data['name'] = get_cate_nameByid($data['cid']);
         $data['url'] = 'ZSU("/artlist/"' . $data['cid'] . ',"Index/artlist",array("cid"=>' . $data['cid'] . '))';
     }
     if ($data['type'] == 1) {
         $group = C('CATE_TYPE');
         $data['name'] = $group[$data['gid']];
         switch ($data['gid']) {
             case 1:
                 $data['url'] = 'ZSU("/artlist/all","Index/artlist")';
                 break;
             case 2:
                 $data['url'] = 'ZSU("/musiclist/all","Index/musiclist")';
                 break;
             case 3:
                 $data['url'] = 'ZSU("/grouplist/all","Index/grouplist")';
                 break;
         }
     }
     if ($data['type'] == 2) {
         $data['url'] = 'U(' . $data['controll'] . '/' . $data['action'] . ')';
     }
     return $data;
 }
            echo $vo['user']['nickname'];
            ?>
"><?php 
            echo $vo['user']['nickname'];
            ?>
</a>
                <span class="split"></span>
                <?php 
            echo friendlyDate($vo["create_time"]);
            ?>
                     <span class="split"></span>
                 <code><a href="<?php 
            echo CSU('/artlist/' . $vo['cid'], 'Index/artlist', array('cid' => $vo['cid']));
            ?>
"><?php 
            echo get_cate_nameByid($vo["cid"]);
            ?>
</a></code>

            </li>
                    </ul>
        <h2 class="title"><a href="<?php 
            echo CSU('/artc/' . $vo['id'], 'Index/artc', array('id' => $vo['id']));
            ?>
"><?php 
            echo $vo["titleicon"];
            ?>
<span><?php 
            echo $vo["title"];
            ?>
</span></a></h2>
Esempio n. 3
0
 public function artlist()
 {
     $cid = I('cid', 0, 'int');
     if ($cid == 0) {
         $this->error('请选择一个分类!', U('Index/index'), false, true, 'Public:404');
     }
     if ($cid == 'all') {
         //$cid=0;
     }
     $m = D('cate');
     $catelist = $m->field('*,CONCAT(spid,id) as path2')->where(array('type' => 1, 'status' => 1))->order('path2')->select();
     $t = new tree();
     $catelistarr = $t->unlimitCategoryFormat($catelist);
     $catehtml = $t->treeFormat($catelistarr);
     $this->assign('cid', $cid);
     $this->assign('cparent', getcidparent($cid));
     $this->assign('webdescription', get_cate_nameByid($cid));
     $this->assign('webkeyword', get_cate_nameByid($cid));
     $this->assign('webtitle', get_cate_nameByid($cid));
     $this->assign('catehtml', $catehtml);
     $cateinfo = M('cate')->where(array('id' => $cid))->find();
     $cateinfo['path'] = getThumbImageById($cateinfo['img']);
     if ($cateinfo['des'] == '') {
         //dump($cateinfo['des']==0);
         //$cateinfo['des']='暂无介绍';
     }
     $this->assign('cateinfo', $cateinfo);
     $this->display();
 }