dedecms 首页arclist按照'weight'排序

softyun3年前cms教程49


dedecms 首页arclist按照'weight'排序
织梦默认情况下是没有开启weight排序的需要修改arclist.lib.php
 
1、 在织梦系统中找到以下目录\include\taglib中的arclist.lib.php文件并打开,大约在74 、75行找到:

<span style="font-size:14px;"><span style="font-family:tahoma,geneva,sans-serif;">1 // arclist是否需要weight排序,默认为"N",如果需要排序则设置为"Y"  
   $isweight = $ctag->GetAtt('isweight');  
</span></span>  
把这行修改为:

<span style="font-size:14px;"><span style="font-family:tahoma,geneva,sans-serif;">1 $weight = $ctag->GetAtt('weight'); 
</span></span> 
2、大约在327行找到
 
    //文档排序的方式
    $ordersql = '';
    if($orderby=='hot' || $orderby=='click') $ordersql = " ORDER BY arc.click $orderWay";
    else if($orderby == 'sortrank' || $orderby=='pubdate') $ordersql = " ORDER BY arc.sortrank $orderWay";
    else if($orderby == 'id') $ordersql = "  ORDER BY arc.id $orderWay";
    else if($orderby == 'near') $ordersql = " ORDER BY ABS(arc.id - ".$arcid.")";
    else if($orderby == 'lastpost') $ordersql = "  ORDER BY arc.lastpost $orderWay";
    else if($orderby == 'scores') $ordersql = "  ORDER BY arc.scores $orderWay";
    else if($orderby == 'rand') $ordersql = "  ORDER BY rand()";

  

<span style="font-size:14px;"><span style="font-family:tahoma,geneva,sans-serif;">1 else if($orderby == 'weight') $ordersql = "  order by arc.weight asc";//在这里增加一行---->如果没有特定设置排序则按照权重先排序 
</span></span> 
    else $ordersql = " ORDER BY arc.sortrank $orderWay";
仅供大家参考学习哦,有需要的可以记录下来。
 

标签: dedecms
免责声明:本文内容来自用户上传并发布,站点仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。请核实广告和内容真实性,谨慎使用。

相关文章

织梦CMS转换其它CMS程序的方法【CMS通用转换方法】

织梦cms一张公告发出,根据dedecms授权协议,除个人非营利网站外,均需购买dedecms商业使用授权,授权费为人民币5800元。一则通知让开源10年之久的织梦也要开始步入版权收费的模式,这就导致...

DedeCMS 核心类TypeLink.class.php摘要笔记

DedeCMS 核心类TypeLink.class.php摘要笔记注:'//+' 表示为本人另外加上的注释 Class TypeLink { var $typeDir; var $dsql; var...

最新织梦dedecms转WordPress方法(脚本一键转换)

dedecms开始对网站进行商业授权,织梦cms授权一个域名就要5800元,一般小站长肯定接受不了,用织梦CMS搭建站群的站长就更别说了,没授权的将被起诉,听说通过AI已经完成了取证,这种情况肯定一告...

织梦DedeCMS获取文章链接的函数GetOneArchive使用方法

织梦DedeCMS获取文章链接的函数GetOneArchive使用方法在某自定义的会员页面中调用指定栏目(typeid=’36′)最新文章,前提是这个页面允许直接使用PHP代码,循环中使用GetOne...

织梦dedecms wap手机门户站点首页不更新的解决方法

织梦dedecms wap手机门户站点首页不更新的解决方法在用织梦dedecms建立wap手机站点的过程中发现,首页一直没有改变,明明把首页模板修改过了的啊不应该不变啊带着这个疑问,开始研究起来。经过...

织梦cms转移迁移wordpress、讯睿CMS、pbootcms、云优CMS、易优CMS(eyoucms)等

织梦cms如何转移迁移到其它免费开源cms或授权价格低的CMS系统呢?其实,织梦cms转移迁移并不是十分容易,因为不仅要做数据库的迁移工作,还要保证数据结构相同。同时dedecms原有url尽量保持不...