今日自己用到,所以找了下呈现过用户认证图标的模板,home/space_card.htm,看了下关于认证图标的代码:
要点在于<!--{if $space['verify'.$vid] == 1}-->,里边的$space['verify'.$vid]是认证类型1-7,$space是空间里是变量不能在别处用,所以需求自己查下表pre_common_member_verify,
改后代码:
留意把“用户UID”换成变量。
<!--{if $_G['setting']['verify']['enabled']}--> <!--{loop $_G['setting']['verify'] $vid $verify}--> <!--{if $verify['available'] && $verify['showicon']}--> <!--{if $space['verify'.$vid] == 1}--> <a href="home.php?mod=spacecp&ac=profile&op=verify&vid=$vid" target="_blank"><!--{if $verify['icon']}--><img src="$verify['icon']" class="vm" alt="$verify[title]" title="$verify[title]" /><!--{else}-->$verify[title]<!--{/if}--></a> <!--{elseif !empty($verify['unverifyicon'])}--> <a href="home.php?mod=spacecp&ac=profile&op=verify&vid=$vid" target="_blank"><!--{if $verify['unverifyicon']}--><img src="$verify['unverifyicon']" class="vm" alt="$verify[title]" title="$verify[title]" /><!--{/if}--></a> <!--{/if}--> <!--{/if}--> <!--{/loop}--> <!--{/if}--> |
要点在于<!--{if $space['verify'.$vid] == 1}-->,里边的$space['verify'.$vid]是认证类型1-7,$space是空间里是变量不能在别处用,所以需求自己查下表pre_common_member_verify,
改后代码:
<!--{if $_G['setting']['verify']['enabled']}--> <!--{loop $_G['setting']['verify'] $vid $verify}--> <!--{if $verify['available'] && $verify['showicon']}--> <!--{eval $cmv=DB::fetch_all("select * from ".DB::table("common_member_verify")." where `uid`='用户UID'")}--> <!--{if $cmv[0]['verify'.$vid] == 1}--> <a href="home.php?mod=spacecp&ac=profile&op=verify&vid=$vid" target="_blank" class="UserLink-badge"><!--{if $verify['icon']}--><img src="$verify['icon']" class="vm" alt="$verify[title]" title="$verify[title]" /><!--{else}-->$verify[title]<!--{/if}--></a> <!--{elseif !empty($verify['unverifyicon'])}--> <a href="home.php?mod=spacecp&ac=profile&op=verify&vid=$vid" target="_blank" class="UserLink-badge"><!--{if $verify['unverifyicon']}--><img src="$verify['unverifyicon']" class="vm" alt="$verify[title]" title="$verify[title]" /><!--{/if}--></a> <!--{/if}--> <!--{/if}--> <!--{/loop}--> <!--{/if}--> |
留意把“用户UID”换成变量。
声明:有的资源均来自网络转载,版权归原作者所有,如有侵犯到您的权益 请联系邮箱:123456@qq.com 我们将配合处理!
原文地址:discuz 调用认证图标教程发布于2023-02-20 12:52:09