织梦搜索页面分页码样式修改

发布期:2020-07-30 | 来源处:本站 | 编辑者:站长助手 | 浏览量:0
30
07
2020

  织梦网站系统自带的搜索页面的分页码样式,不太美观,需要二次开发修改,才能达到美观的效果,下面为全宝鑫技术员,讲述一下怎样修改。



织梦搜索页面分页修改
上图为原代码显示图

需要修改的文件,include目录下的
arc.searchview.class.php

查找
获取动态的分页列表
大约在809行

原代码为:

    /**
     *  获取动态的分页列表
     *
     * @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 = "<td>共找到<b>".$this->TotalResult."</b>条记录/最大显示<b>{$totalpage}</b>页 </td>
";
        $geturl = "keyword=".urlencode($oldkeyword)."&searchtype=".$this->SearchType;
        $hidenform = "<input type='hidden' name='keyword' value='".rawurldecode($oldkeyword)."'>
";
        $geturl .= "&channeltype=".$this->ChannelType."&orderby=".$this->OrderBy;
        $hidenform .= "<input type='hidden' name='channeltype' value='".$this->ChannelType."'>
";
        $hidenform .= "<input type='hidden' name='orderby' value='".$this->OrderBy."'>
";
        $geturl .= "&kwtype=".$this->KType."&pagesize=".$this->PageSize;
        $hidenform .= "<input type='hidden' name='kwtype' value='".$this->KType."'>
";
        $hidenform .= "<input type='hidden' name='pagesize' value='".$this->PageSize."'>
";
        $geturl .= "&typeid=".$this->TypeID."&TotalResult=".$this->TotalResult."&";
        $hidenform .= "<input type='hidden' name='typeid' value='".$this->TypeID."'>
";
        $hidenform .= "<input type='hidden' name='TotalResult' value='".$this->TotalResult."'>
";
        $purl .= "?".$geturl;

        //获得上一页和下一页的链接
        if($this->PageNo != 1)
        {
            $prepage.="<td width='50'><a href='".$purl."PageNo=$prepagenum'>上一页</a></td>
";
            $indexpage="<td width='30'><a href='".$purl."PageNo=1'>首页</a></td>
";
        }
        else
        {
            $indexpage="<td width='30'>首页</td>
";
        }
        if($this->PageNo!=$totalpage && $totalpage>1)
        {
            $nextpage.="<td width='50'><a href='".$purl."PageNo=$nextpagenum'>下一页</a></td>
";
            $endpage="<td width='30'><a href='".$purl."PageNo=$totalpage'>末页</a></td>
";
        }
        else
        {
            $endpage="<td width='30'>末页</td>
";
        }

        //获得数字链接
        $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.= "<td>$j&nbsp;</td>
";
            }
            else
            {
                $listdd.="<td><a href='".$purl."PageNo=$j'>[".$j."]</a>&nbsp;</td>
";
            }
        }
        $plist  =  "<table border='0' cellpadding='0' cellspacing='0'>
";
        $plist .= "<tr align='center' style='font-size:10pt'>
";
        $plist .= "<form name='pagelist' action='".$this->GetCurUrl()."'>$hidenform";
        $plist .= $infos;
        $plist .= $indexpage;
        $plist .= $prepage;
        $plist .= $listdd;
        $plist .= $nextpage;
        $plist .= $endpage;
        if($totalpage>$total_list)
        {
            $plist.="<td width='38'><input type='text' name='PageNo' style='width:28px;height:14px' value='".$this->PageNo."' /></td>
";
            $plist.="<td width='30'><input type='submit' name='plistgo' value='GO' style='width:30px;height:22px;font-size:9pt' /></td>
";
        }
        $plist .= "</form>
</tr>
</table>
";
        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 = "<td>共找到<b>".$this->TotalResult."</b>条记录/最大显示<b>{$totalpage}</b>页 </td>
";
        $infos = "<b>共".$this->TotalResult."条记录</b>
";
        $geturl = "keyword=".urlencode($oldkeyword)."&searchtype=".$this->SearchType;
        $hidenform = "<input type='hidden' name='keyword' value='".rawurldecode($oldkeyword)."'>
";
        $geturl .= "&channeltype=".$this->ChannelType."&orderby=".$this->OrderBy;
        $hidenform .= "<input type='hidden' name='channeltype' value='".$this->ChannelType."'>
";
        $hidenform .= "<input type='hidden' name='orderby' value='".$this->OrderBy."'>
";
        $geturl .= "&kwtype=".$this->KType."&pagesize=".$this->PageSize;
        $hidenform .= "<input type='hidden' name='kwtype' value='".$this->KType."'>
";
        $hidenform .= "<input type='hidden' name='pagesize' value='".$this->PageSize."'>
";
        $geturl .= "&typeid=".$this->TypeID."&TotalResult=".$this->TotalResult."&";
        $hidenform .= "<input type='hidden' name='typeid' value='".$this->TypeID."'>
";
        $hidenform .= "<input type='hidden' name='TotalResult' value='".$this->TotalResult."'>
";
        $purl .= "?".$geturl;

        //获得上一页和下一页的链接

        if($this->PageNo != 1)
        {
            //$prepage.="<td width='50'><a href='".$purl."PageNo=$prepagenum'>上一页</a></td>
";
            //$indexpage="<td width='30'><a href='".$purl."PageNo=1'>首页</a></td>
";
            $prepage.="<a href='".$purl."PageNo=$prepagenum'>上一页</a>
";
            $indexpage="<a href='".$purl."PageNo=1'>首页</a>
";
        }
        else
        {
            //$indexpage="<td width='30'>首页</td>
";
            $indexpage="<a>首页</a>
";
        }
        if($this->PageNo!=$totalpage && $totalpage>1)
        {
            //$nextpage.="<td width='50'><a href='".$purl."PageNo=$nextpagenum'>下一页</a></td>
";
            //$endpage="<td width='30'><a href='".$purl."PageNo=$totalpage'>末页</a></td>
";
            $nextpage.="<a href='".$purl."PageNo=$nextpagenum'>下一页</a>
";
            $endpage="<a href='".$purl."PageNo=$totalpage'>末页</a>
";
        }
        else
        {
            //$endpage="<td width='30'>末页</td>
";
            $endpage="<a>末页</a
";
        }

        //获得数字链接
        $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.= "<td>$j&nbsp;</td>
";
                $listdd.= "<a class='thisclass'>$j</a>
";
            }
            else
            {
                //$listdd.="<td><a href='".$purl."PageNo=$j'>[".$j."]</a>&nbsp;</td>
";[搜索页分页样式]
                $listdd.="<a href='".$purl."PageNo=$j'>".$j."</a>
";
            }
        }
        $plist  =  "<table border='0' cellpadding='0' cellspacing='0'>
";
        $plist .= "<tr align='center' style='font-size:10pt'>
";
        $plist .= "<form name='pagelist' action='".$this->GetCurUrl()."'>$hidenform";   
        $plist .= $indexpage;
        $plist .= $prepage;
        $plist .= $listdd;
        $plist .= $nextpage;
        $plist .= $endpage;
        $plist .= $infos;
        if($totalpage>$total_list)
        {
            $plist.="<td width='38'><input type='text' name='PageNo' style='width:28px;height:14px' value='".$this->PageNo."' /></td>
";
            $plist.="<td width='30'><input type='submit' name='plistgo' value='GO' style='width:30px;height:22px;font-size:9pt' /></td>
";
        }
        $plist .= "</form>
</tr>
</table>
";
        return $plist;
    }


CSS 代码如下:

/*搜索页面页码top*/
#pageNum ,#pageNum b {
font-size: 14px;
padding: 25px 0;
text-align: center
}

#pageNum a ,#pageNum b {
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
}
/*搜索页面页码end*/



织梦搜索页面分页修改

上图为修改后的效果





下面推荐类似信息

UEditor编辑器中插入的代码被自动过滤解决方法

发布日期:2018-11-29
我创建文章的过程中,插入代码后,看起来是正常的,然后保存完之后,且保存到数据库中也正常,但是当对该文章进行编辑的时候,发现UEditor编辑器会自动过滤掉部分代码。百度搜索了

织梦ueditor百度编辑器最新1.4.3安装方法与下载

发布日期:2018-11-28
织梦整合ueditor百度编辑器最新1.4.3方法详细步骤与下载链接

织梦文章频道模型增加图集功能效果

发布日期:2021-04-26
织梦DEDECMS文章频道模型增加图集功能图文教程

织梦中英文分别搜索决解方法

发布日期:2023-06-18
织梦dedecms制作中英文站时,需要在中文站中只搜索出中文站的内容,而在英文站中只搜索出英文站的内容

kindeditor4.1编辑内容时默认显示字体大小设置

发布日期:2018-12-05
kindeditor4.1编辑内容时默认显示字体大小觉得编辑的时候字体实在太小,我查看元素,才发现,原来只有12PX,的确是够小的。那应该如何来调整其样式呢?

织梦系统上传阿里云服务器,文件管理器排序乱修改

发布日期:2020-07-04
织梦网站系统后台文件管理器,上传到阿里云的服务器,文件夹与文件名排序混乱, 恢复按文件名顺序修改的正确方法。
做网站保障承诺

全宝鑫公司,给客户做网站八大保障承诺:


1、按客户要求订制,专业技术员做到客户满意为止。


2、网页栏目和网页数不限,用户可通过网站后台增加和修改。


3、网站电脑版和移动版同时开发,同一网址,电脑打开是电脑版网页,手机打开自适应手机版网页。


4、网站美工和客户相互配合,客户提供产品相关的图片资料,美工排版,上传到网站。


5、网站搭建完成后,配网站操作说明书,和操作视频教学。


6、配相关网站优化排名资料,和网页图片处理软件,管理操作资料推送给客户。


7、根据搜索引擎规则编写网站代码,自然排名和竞价排名,容易被搜索引擎收录。


8、交一次搭建网站制作费用,获得终身网站使用权。


订制网站价格:普通型3至5千;高端型6至9千;特殊功能型1万以上,最终价格,根据您的要求定。



网店代管理说明

全宝鑫电商美工代管理网店流程,提供技术服务说明:


1、从专业拍摄产品图片;


2、到美工处理产品图片;


3、到上传产品资料图片;


4、到网店旺铺排版装修;


5、到优化管理网店旺铺。


同时网店经营商家只需要每天上班时间,按时登录网店的在线客服沟通工具,等待与询盘过来的客户及时沟通,也就是开始等待接订单。



TAG 标签
热线(微信同号):
137-6042-7131
在线客服:
售前
售前
售前
售后
微信图标
联系微信:
微信联系二维码
欢迎留言,我们及时与您沟通!
为您公司定制,最符合您公司的官方网站!

搭建网站定制网站,将获得全宝鑫公司,设计师免费为您设计
创意LOGO(商标),和设计您满意的名片

网店托管服务流程:拍摄产品、美工处理、上传网店、
版面设计、资料优化,按年托管!

工作日 9:00-18:00 等您联系咨询!(微信同号)137-6042-7131
留言说明您需要的服务!

您需要的服务?(可选填)


QQ咨询