例如我要调用织梦dedecms网站“积分或金钱”排名前14的会员:
{dede:loop table=’dede_member’ sort=’money’ num=’0′ if=”}
<li>
<span class="ytop">[field:autoindex runphp='yes']$aaa=$GLOBALS['autoindex']++;@me=$aaa-10;[/field:autoindex]</span>
<span class="uname"><a href="/member/index.php?uid=[field:userid/]" target=’_blank’>[field:uname/]</a></span>
<span class="mdetail">[field:scores/] – [field:money/] RMB</span>
</li>
{/dede:loop}
{dede:loop table=’dede_member’ sort=’money’ num=’3′ if=”}
<li>
<span class="ntop">[field:autoindex runphp='yes']$aaa=$GLOBALS['autoindex']++;@me=$aaa-10;[/field:autoindex]</span>
<span class="uname"><a href="/member/index.php?uid=[field:userid/]" target=’_blank’>[field:uname/]</a></span>
<span class="mdetail">[field:scores/] – [field:money/] RMB</span>
</li>
{/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");
很简单的修改 。
(责任编辑:最模板) |