织梦dede:memberlist标签增加会员级别名称
网站前台调用会员列表,想显示会员等级名称,但是用[field:rank/]显示的是数字
解决方法如下:
dede:memberlist 标签写法
{dede:memberlist row=6 signlen=30}
<li>
<a href="[field:spaceurl/]" target="_blank"><img src="[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 `58pic_member_space` ms ON ms.mid = mb.mid
改成:
LEFT JOIN `58pic_member_space` ms ON ms.mid = mb.mid LEFT JOIN `58pic_arcrank` ar ON ar.rank = mb.rank
完成。