16
2020
11

帝国cms自定义分页(列表分页,内容分页)样式步骤


下面说下列表页分页样式自定义的方法,内容分页同理

第一步:进入帝国cms后台,点击系统设置->系统参数设置->信息设置:里面有个"列表分页函数(列表)"选项,将里面的函数名修改为user_ShowListMorePage

第二部:到 e/class/userfun.php <?php   ?>  之间插入下面代码

function user_ShowListMorePage($num,$page,$dolink,$type,$totalpage,$line,$ok,$search=""){
    global $fun_r,$public_r;
    if($num<=$line)
    {
        $pager['showpage']='';
        return $pager;
    }
    $page_line=$public_r['listpagelistnum'];
    $snum=2;
 
    //上一页
    if($page<>1)
    {
        $toppage='<a href="'.$dolink.'index'.$type.'" class="disabled">'.$fun_r['startpage'].'</a>';    //首页
        $pagepr=$page-1;
        if($pagepr==1)
        {
            $prido="index".$type;
        }
        else
        {
            $prido="index_".$pagepr.$type;
        }
        $prepage='<a href="'.$dolink.$prido.'" class="disabled">'.$fun_r['pripage'].'</a>';     //上一页
    }
    //下一页
    if($page!=$totalpage)
    {
        $pagenex=$page+1;
        $nextpage='<a href="'.$dolink.'index_'.$pagenex.$type.'" class="disabled">'.$fun_r['nextpage'].'</a>';   //下一页
        $lastpage='<a href="'.$dolink.'index_'.$totalpage.$type.'" class="disabled">'.$fun_r['lastpage'].'</a>';    //最后一页
    }
    $starti=$page-$snum<1?1:$page-$snum;
    $no=0;
    for($i=$starti;$i<=$totalpage&&$no<$page_line;$i++)    //详细页码信息
    {
        $no++;
        if($page==$i)
        {
            $is_1="<a class='cur'>";    //当前
            $is_2="</a>";
        }
        elseif($i==1)
        {
            $is_1='<a href="'.$dolink.'index'.$type.'">';   //第一页
            $is_2="</a>";
        }
        else
        {
            $is_1='<a href="'.$dolink.'index_'.$i.$type.'">';    //其他页
            $is_2="</a>";
        }
        $returnstr.=$is_1.$i.$is_2;
    }
    $returnstr=$firststr.$toppage.$prepage.$returnstr.$nextpage.$lastpage; 
    $pager['showpage']=$returnstr;
    return $pager;
}

第三步:在你的列表页中写上分页就好了【[!--show.listpage--]】

15
2020
11

帝国CMS替换当前位置导航[!---newsnav--]标签,实现样式自定义

如何解决[!---newsnav--]标签的样式死板,不改官方源码,避免升级时会痛苦不堪。

15
2020
11

帝国CMS内容页自定义样式调用上一篇和下一篇的方法

帝国CMS用传统的方法调用上一篇和下一篇,无法用css控制会出现乱位。

«1»