找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索
查看: 113|回复: 0

[cms教程] 解决dede的loop中无法使用limit的方案+文章前数字序号

[复制链接]

该用户从未签到

发表于 2020-5-14 09:20:13 | 显示全部楼层 |阅读模式

您需要 登录 才可以下载或查看,没有账号?立即注册

×
例如我要调用织梦dedecms网站“积分或金钱”排名前14的会员:
         
        {dede:loop table=’dede_member’ sort=’money’   num=’0′ if=”}
               [*,
                 [field:autoindex runphp='yes',$aaa=$GLOBALS['autoindex',++;@me=$aaa-10;[/field:autoindex,
                 [url=,[field:uname/,[/url]
                 [field:scores/, – [field:money/, RMB
               
        {/dede:loop}
        {dede:loop table=’dede_member’ sort=’money’   num=’3′ if=”}
               [*,
                 [field:autoindex runphp='yes',$aaa=$GLOBALS['autoindex',++;@me=$aaa-10;[/field:autoindex,
                 [url=,[field:uname/,[/url]
                 [field:scores/, – [field:money/, RMB
               
        {/dede:loop}
         
        代码中的:num参数修改如下
        找到文件loop.lib.php,找到 if($if!=”) $ifcase = $if; ,这一句,在其后增加
            //////www.ruohai.net
            if($num!=”) $num = $num;
            //////www.ruohai.net
        接着,将     $dsql->SetQuery("Select * From $tablename $ifcase $sort limit 0]$row");
        改为
        $dsql->SetQuery("Select * From $tablename $ifcase $sort limit $num,$row");
        很简单的修改 。
回复

使用道具 举报

网站地图|页面地图|文字地图|Archiver|手机版|小黑屋|找资源 |网站地图

GMT+8, 2024-10-7 12:25

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表