网站前台调用会员列表,想显示会员等级名称,但是用[field:rank/]显示的是数字,解决方法如下
dede:memberlist 标签写法
{dede:memberlist row=6 signlen=30}
<li>
<a href=https://www.91084.com/"[field:spaceurl/]" target="_blank"><img src=https://www.91084.com/"[field:face/]" alt='[field:spacename/]' width="52" height="52" />[field:uname/]</a>
<p>会员等级:[field:rankname/]</p>
</li>
{/dede:memberlist}
注意,[field:rank/] 已经变成 [field:rankname/]
还需要修改 /include/taglib/memberlist.lib.php 找到
,ms.sign
改成
ms.sign,ar.membername as rankname
继续找到
LEFT JOIN `dede_member_space` ms ON ms.mid = mb.mid
改成
LEFT JOIN `dede_member_space` ms ON ms.mid = mb.mid LEFT JOIN `dede_arcrank` ar ON ar.rank = mb.rank