欢迎光临! 【模板119】平台每天更新源码-所有VIP源码均有在线演示

logo

建站一条龙服务

模板119告诉你织梦搜索页分页样式的修改要怎么进行

织梦源码推荐

默认的搜索页包含有TD的表格代码,这里主要说的是去掉td表格属性的方法。方便你用css来自定义漂亮的分页模式。
 
方法/步骤
需要修改的文件,include目录下的
arc.searchview.class.php
查找 {首页}上下文就是样式了


下面是详情
获取动态的分页列表
大约在805行
修改代码
     *  获取动态的分页列表
     *
     * @access    public
     * @param     string  $list_len  列表宽度
     * @return    string
     */
    function GetPageListDM($list_len)
    {
        global $oldkeyword;
        $prepage="";
        $nextpage="";
        $prepagenum = $this->PageNo - 1;
        $nextpagenum = $this->PageNo + 1;
        if($list_len=="" || preg_match("/[^0-9]/", $list_len))
        {
            $list_len=3;
        }
        $totalpage = ceil($this->TotalResult / $this->PageSize);
        if($totalpage<=1 && $this->TotalResult>0)
        {
            return "共1页/".$this->TotalResult."条记录";
        }
        if($this->TotalResult == 0)
        {
            return "共0页/".$this->TotalResult."条记录";
        }
        $purl = $this->GetCurUrl();
        
        $oldkeyword = (empty($oldkeyword) ? $this->Keyword : $oldkeyword);
        //当结果超过限制时,重设结果页数
        if($this->TotalResult > $this->SearchMaxRc)
        {
            $totalpage = ceil($this->SearchMaxRc/$this->PageSize);
        }
        $infos = "共找到".$this->TotalResult."条记录/最大显示{$totalpage}页 ";
        $geturl = "keyword=".urlencode($oldkeyword)."&searchtype=".$this->SearchType;
        $hidenform = " ";
        $geturl .= "&channeltype=".$this->ChannelType."&orderby=".$this->OrderBy;
        $hidenform .= " ";
        $hidenform .= " ";
        $geturl .= "&kwtype=".$this->KType."&pagesize=".$this->PageSize;
        $hidenform .= " ";
        $hidenform .= " ";
        $geturl .= "&typeid=".$this->TypeID."&TotalResult=".$this->TotalResult."&";
        $hidenform .= " ";
        $hidenform .= " ";
        $purl .= "?".$geturl;
        //获得上一页和下一页的链接
        if($this->PageNo != 1)
        {
            $prepage.="上一页 ";
            $indexpage="首页 ";
        }
        else
        {
            $indexpage="首页 ";
        }
        if($this->PageNo!=$totalpage && $totalpage>1)
        {
            $nextpage.="下一页 ";
            $endpage="末页 ";
        }
        else
        {
            $endpage="末页 ";
        }
        //获得数字链接
        $listdd="";
        $total_list = $list_len * 2 + 1;
        if($this->PageNo >= $total_list)
        {
            $j = $this->PageNo - $list_len;
            $total_list = $this->PageNo + $list_len;
            if($total_list > $totalpage)
            {
                $total_list = $totalpage;
            }
        }
        else
        {
            $j=1;
            if($total_list > $totalpage)
            {
                $total_list = $totalpage;
            }
        }
        for($j; $j<=$total_list; $j++)
        {
            if($j == $this->PageNo)
            {
                $listdd.= "$j  ";
            }
            else
            {
                $listdd.="[".$j."]  ";
            }
        }
        $plist  =  " ";
        $plist .= "
";
        $plist .= "
$hidenform";
        $plist .= $infos;
        $plist .= $indexpage;
        $plist .= $prepage;
        $plist .= $listdd;
        $plist .= $nextpage;
        $plist .= $endpage;
        if($totalpage>$total_list)
        {
            $plist.="
";
            $plist.="
";
        }
        $plist .= "
";
        return $plist;
    }
     *  获取动态的分页列表
     *
     * @access    public
     * @param     string  $list_len  列表宽度
     * @return    string
     */
    function GetPageListDM($list_len)
    {
        global $oldkeyword;
        $prepage="";
        $nextpage="";
        $prepagenum = $this->PageNo - 1;
        $nextpagenum = $this->PageNo + 1;
        if($list_len=="" || preg_match("/[^0-9]/", $list_len))
        {
            $list_len=3;
        }
        $totalpage = ceil($this->TotalResult / $this->PageSize);
        if($totalpage<=1 && $this->TotalResult>0)
        {
            return "共1页/".$this->TotalResult."条记录";
        }
        if($this->TotalResult == 0)
        {
            return "共0页/".$this->TotalResult."条记录";
        }
        $purl = $this->GetCurUrl();
        
        $oldkeyword = (empty($oldkeyword) ? $this->Keyword : $oldkeyword);
        //当结果超过限制时,重设结果页数
        if($this->TotalResult > $this->SearchMaxRc)
        {
            $totalpage = ceil($this->SearchMaxRc/$this->PageSize);
        }
        //$infos = "共找到".$this->TotalResult."条记录/最大显示{$totalpage}页 ";
        $infos = "共找到".$this->TotalResult."条记录/最大显示{$totalpage}页 ";
        $geturl = "keyword=".urlencode($oldkeyword)."&searchtype=".$this->SearchType;
        $hidenform = " ";
        $geturl .= "&channeltype=".$this->ChannelType."&orderby=".$this->OrderBy;
        $hidenform .= " ";
        $hidenform .= " ";
        $geturl .= "&kwtype=".$this->KType."&pagesize=".$this->PageSize;
        $hidenform .= " ";
        $hidenform .= " ";
        $geturl .= "&typeid=".$this->TypeID."&TotalResult=".$this->TotalResult."&";
        $hidenform .= " ";
        $hidenform .= " ";
        $purl .= "?".$geturl;
        //获得上一页和下一页的链接
        if($this->PageNo != 1)
        {
            //$prepage.="上一页 ";
            //$indexpage="首页 ";
            $prepage.="上一页 ";
            $indexpage="首页 ";
        }
        else
        {
            //$indexpage="首页 ";
            $indexpage="首页 ";
        }
        if($this->PageNo!=$totalpage && $totalpage>1)
        {
            //$nextpage.="下一页 ";
            //$endpage="末页 ";
            $nextpage.="下一页 ";
            $endpage="末页 ";
        }
        else
        {
            //$endpage="末页 ";
            $endpage="末页
        }
        //获得数字链接
        $listdd="";
        $total_list = $list_len * 2 + 1;
        if($this->PageNo >= $total_list)
        {
            $j = $this->PageNo - $list_len;
            $total_list = $this->PageNo + $list_len;
            if($total_list > $totalpage)
            {
                $total_list = $totalpage;
            }
        }
        else
        {
            $j=1;
            if($total_list > $totalpage)
            {
                $total_list = $totalpage;
            }
        }
        for($j; $j<=$total_list; $j++)
        {
            if($j == $this->PageNo)
            {
                //$listdd.= "$j  ";
                $listdd.= "$j ";
            }
            else
            {
                //$listdd.="[".$j."]  ";[搜索页分页样式]
                $listdd.="".$j." ";
            }
        }
        $plist  =  " ";
        $plist .= "
";
        $plist .= "
$hidenform";
        $plist .= $infos;
        $plist .= $indexpage;
        $plist .= $prepage;
        $plist .= $listdd;
        $plist .= $nextpage;
        $plist .= $endpage;
        if($totalpage>$total_list)
        {
            $plist.="
";
            $plist.="
";
        }
        $plist .= "
";
        return $plist;
    }
经过上面步骤。我们可以看到,仅仅是注释了函数中原来的代码,并没有删除,方便后续的查看,但是效果和删除一样的。
在模板search.htm里面调用方式如下:
   
      {dede:pagelist listsize='4'/}
   
他的CSS里面可以如下写,当然你也可以自己写,以下内容仅供参考。最终效果请看截图
#pageNum {
font-size: 14px;
padding: 25px 0;
text-align: center
}
#pageNum a {
text-decoration: none;
padding: 8px 9px;
border: 1px solid #ccc;
background: #fff;
color: #333;
-webkit-transition: all linear .2s;
-moz-transition: all linear .2s;
-ms-transition: all linear .2s;
transition: all linear .2s;
margin-right:5px;
}
#pageNum a:hover,#pageNum a.thisclass {
background: #1592E5;
color: #fff;
border: 1px solid #1592E5
}
 
二维码

本文手机访问二维码

作者:mb119.com        关注度:70        发布时间:2016-11-10 06:15:51
首先声明,只要是我们的vip会员所有源码均可以免费下载,不做任何限制
☉本站的源码不会像其它下载站一样植入大量的广告。
☉本站只提供精品织梦源码,源码在于可用,不在多!!希望在这里找到你合适的。
☉本站提供的整站织梦程序,均带数据及演示地址。可以在任一源码详情页查看演示地址
☉本站所有资源(包括源码、模板、素材、特效等)仅供学习与参考,请勿用于商业用途。
☉如有其他问题,请加网站客服QQ(971977809)进行交流点击这里给我发消息
相关程序开发内容
在线客服