1、找到"根目录\include\arc.listview.class.php"文件。

2、修改代码:在文件第727行处添加按weight排序判断代码(红色部分为新添加代码)。

//排序方式
$ordersql = '';
        if($orderby=="senddate" || $orderby=="id") {
            $ordersql=" ORDER BY arc.id $orderWay";
        }
        else if($orderby=="hot" || $orderby=="click") {
            $ordersql = " ORDER BY arc.click $orderWay";
        }
        else if($orderby=="lastpost") {
            $ordersql = "  ORDER BY arc.lastpost $orderWay";
        }
       else if($orderby=="weight") {
            $ordersql = "  ORDER BY arc.weight $orderWay";
        }
        else {
            $ordersql=" ORDER BY arc.sortrank $orderWay";
        }

3、再在第778行处找到此段代码

  //如果不用默认的sortrank或id排序,使用联合查询(数据量大时非常缓慢)
     if(preg_match('/hot|click|lastpost|weight/', $orderby))

  并添加红色部分内容。

4、标签调用:

  {dede:list orderby='weight' orderway='asc'}

  这样{dede:list}标签就支持了按权重排序的调用,并且动静态状态下测试均成功!

DedeCMS让{dede:list}标签支持weight权重排序的更多相关文章

  1. Dedecms中{dede:type}标签支持调用父级栏目名称

    需求: 我们用{dede:type}标签调用栏目相关内容时,同时需要调用该栏目的父级栏目的名称. {dede:type}标签的代码做了一下开发,支持这个调用了. 开发方法: 1.打开include/t ...

  2. DEDECMS5.7 首页和栏目页调用文章按权重排序

    dedecms 5.7版本已增加按权重排序功能: [arclist]标签增加按权重排序,在后台管理DEDE里找到以下目录\include\taglib中的arclist.lib.php文件并打开 大约 ...

  3. dedecms {dede:php}标签用法介绍

    最简单的输入如 代码如下 复制代码 {dede:php} $numA = 1; $numB = 2; echo $numA + $numB; {/dede:php} 从上面语句可以看出dede:php ...

  4. dedecms 按权重排序不准或BUG的处理方法

    dede:list 的方法 1.找到"根目录\include\arc.listview.class.php"文件. 2.修改代码:在文件第727行处添加按weight排序判断代码( ...

  5. dede:list及dede:arclist 按权重排序的方法

    有时我们需要做文章排名,比如指定第一名到第三名在前面,这样就用到这个权重排序方法.稍改下就可以完美支持.. dede:list 的方法 1 找到"根目录\include\arc.listvi ...

  6. dede按照权重排序dede:list和得的:arclist

    dede:list 的方法 1.找到"根目录\include\arc.listview.class.php"文件. 2.修改代码:在文件第727行处添加按weight排序判断代码( ...

  7. DEDECMS中,arclist标签

    文档列表  dede:arclist 标签: {dede:arclist flag='h' typeid='' row='' col='' titlelen='' infolen='' imgwidt ...

  8. {dede:sql}标签的用法

    sql标签可以称得上是个万能标签了,查询数据库将其输出,这里介绍一些关于这个标签的用法: 1.用来输出统计内容,这个是不错的,举个例子,我们来统计下总共发了多少的文章,思路就是输出dede_addon ...

  9. dedecms 文章根据 权重排序

    原文链接 一: dede:list   标签 找到 /include/arc.listview.class.php if($orderby=="senddate" || $orde ...

随机推荐

  1. The Pilots Brothers' refrigerator(dfs)

    The Pilots Brothers' refrigerator Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 19718 ...

  2. CSS包含块containing block详解

    “包含块(containing block)”,W3c中一个很重要的概念,今天带大家一起来好好研究下. 初步理解 在 CSS2.1 中,很多框的定位和尺寸的计算,都取决于一个矩形的边界,这个矩形,被称 ...

  3. BNU 2418 Ultra-QuickSort (线段树求逆序对)

    题目链接:http://acm.bnu.edu.cn/bnuoj/problem_show.php?pid=2418 解题报告:就是给你n个数,然后让你求这个数列的逆序对是多少?题目中n的范围是n & ...

  4. [BZOJ1477]青蛙的约会

    [BZOJ1477]青蛙的约会 试题描述 两只青蛙在网上相识了,它们聊得很开心,于是觉得很有必要见一面.它们很高兴地发现它们住在同一条纬度线上,于是它们约定各自朝西跳,直到碰面为止.可是它们出发之前忘 ...

  5. MotionEvent常见值

    常见的动作常量: public static final int ACTION_DOWN        = 0;单点触摸动作 public static final int ACTION_UP     ...

  6. Python 命令详解

    1. 新建一个 django-project django-admin.py startproject project-name 一个 project 一般为一个项目 2. 新建 app python ...

  7. 详解mysql int类型的长度值问题

    我的朋友海滨问我mysql在建表的时候int类型后的长度代表什么? 是该列允许存储值的最大宽度吗? 为什么我设置成int(1), 也一样能存10,100,1000呢. 当时我虽然知道int(1),这个 ...

  8. Group Shifted Strings

    Given a string, we can "shift" each of its letter to its successive letter, for example: & ...

  9. 3Sum Closest & 3Sum Smaller

    Given an array S of n integers, find three integers in S such that the sum is closest to a given num ...

  10. glGetFloatv (GL_MODELVIEW_MATRIX, mat)

    这个函数的作用是取出GL_MODELVIEW_MATRIX,然后存储在mat这个矩阵中,用于逆变换等.