专题分类列表

2018-11-14  本文已影响12人  MenChem

打开 modules\special\templates\content_list.tpl.php
10行下面添加

<div class="content-menu ib-a blue line-x">
   &nbsp;&nbsp; <a href="?m=special&c=content&a=init&specialid=<?php echo $_GET['specialid']?>" class="<?php echo $actives['0'];?>"><em>所有分类</em></a>  
   <?php foreach ($types as $r) {?>    
     <a href="?m=special&c=content&a=init&specialid=<?php echo $_GET['specialid']?>&typeid=<?php echo $r['typeid']?>"  class="<?php echo $actives[$r['typeid']];?>"><em><?php echo $r['name']?></em></a>  
   <?php }?>
</div>

打开 modules\special\content.php
180 行修改 init函数

public function init() {
                $_GET['specialid'] = intval($_GET['specialid']);
                if(!$_GET['specialid']) showmessage(L('illegal_action'), HTTP_REFERER);
                $types = $this->type_db->select(array('module'=>'special', 'parentid'=>$_GET['specialid']), 'name, typeid', '', '`listorder` ASC, `typeid` ASC', '', 'typeid');
                //add by warfu
                $len=count($types)+1;                
                $actives=array();
                
                for($i=0;$i<$len;$i++)
                   array_push($actives,"null");

                
                $page = max(intval($_GET['page']), 1);        
                //edit by warfu         
            if(!$_GET['typeid'])
                {
                   $datas = $this->db->listinfo(array('specialid'=>$_GET['specialid']), '`listorder` ASC , `id` DESC', $page);
                   $actives[0]="on";
                }
                else                 
                {
                  $datas = $this->db->listinfo(array('specialid'=>$_GET['specialid'],'typeid'=>$_GET['typeid']), '`listorder` ASC , `id` DESC', $page);
                   $actives[$_GET['typeid']]="on";
                }
                
                $pages = $this->db->pages;
                $big_menu = array(array('javascript:openwinx(\'?m=special&c=content&a=add&specialid='.$_GET['specialid'].'\',\'\');void(0);', L('add_content')), array('javascript:window.top.art.dialog({id:\'import\',iframe:\'?m=special&c=special&a=import&specialid='.$_GET['specialid'].'\', title:\''.L('import_content').'\', width:\'700\', height:\'500\', lock:true}, function(){var d = window.top.art.dialog({id:\'import\'}).data.iframe;var form = d.document.getElementById(\'dosubmit\');form.click();return false;}, function(){window.top.art.dialog({id:\'import\'}).close()});void(0);', L('import_content')));
                include $this->admin_tpl('content_list');
        }
上一篇 下一篇

猜你喜欢

热点阅读