dedecms 首页arclist按照'weight'排序

softyun3年前cms教程114


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

相关文章

dede搜索结果页支持article、sql、channelartlist 等标签

dede搜索结果页支持article、sql、channelartlist 等标签打开文件:include/arc.searchview.class.php 找到:<span style="fo...

dedecms如何转pbootcms教程?织梦无损路径不变转换Pbootcms方法

dedecms如何转pbootcms教程?随着织梦dedecms的开始收费,很多朋友都在找免费的开源cms以便更换,今天这里就来为大家dedecms如何转pbootcms教程,织梦数据无损栏目路径不变...

织梦导航不显示外部链接栏目,修改channelartlist标签方法

织梦导航不显示外部链接栏目,修改channelartlist标签方法在文件 include/taglib/channelartlist.lib.php第67行左右, 查找:<span style...

一键将dedecms迁移到WordPress(dedecms转WordPress)

dedecms收费并已经完成AI取证的新闻,授权费用5800元。和米拓cms一样的情况,先获取巨大用户,再发律师函索赔,所谓的开源、免费只是针对个人网站。admin5的网站交易群里,直接有人说dede...

织梦收费怎么办?织梦cms授权收费有三种解决方法

织梦收费怎么办?织梦dedecms开始收费了,面对有建站业务的人群,还是引起了很大的反响的!织梦cms对所有商用的个人、企业,统一收取5800元的商业授权费。织梦CMS是国内使用量非常大的免费开源程序...

两种可以实现DEDECMS栏目统计功能的方法

两种可以实现DEDECMS栏目统计功能的方法我知道织梦DEDECMS的后台,可以统计出网站的文章数量信息,但是不能显示每个栏目的文章统计信息,以下是两种可以实现栏目文章统计信息的方法,提供给大家学习研...