广告位招租 qq245909083

discuz 调用认证图标教程

分享时间:2018-09-11 1062 热度℃
今天自己用到,所以找了下出现过用户认证图标的模板,home/space_card.htm,看了下关于认证图标的代码:
<!--{if $_G['setting']['verify']['enabled']}-->
<!--{loop $_G['setting']['verify'] $vid $verify}-->
&#160; &#160;&#160; &#160;&#160;&#160;<!--{if $verify['available'] && $verify['showicon']}-->
&#160; &#160;&#160; &#160;&#160; &#160;&#160; &#160;&#160; &#160; <!--{if $space['verify'.$vid] == 1}-->
&#160; &#160;&#160; &#160;&#160; &#160;&#160; &#160;&#160; &#160;&#160; &#160;&#160; &#160;&#160; &#160;<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>
&#160; &#160;&#160; &#160;&#160; &#160;&#160; &#160;&#160; &#160; <!--{elseif !empty($verify['unverifyicon'])}-->
&#160; &#160;&#160; &#160;&#160; &#160;&#160; &#160;&#160; &#160;&#160; &#160;&#160; &#160;&#160; &#160;<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>
&#160; &#160;&#160; &#160;&#160; &#160;&#160; &#160;&#160; &#160; <!--{/if}-->
&#160; &#160;&#160; &#160;&#160;&#160;<!--{/if}-->
<!--{/loop}-->
<!--{/if}-->
复制代码
重点在于<!--{if $space['verify'.$vid] == 1}-->,里面的$space['verify'.$vid]是认证类型1-7,$space是空间里是变量不能在别处用,所以需要自己查下表pre_common_member_verify,

改后代码:
<!--{if $_G['setting']['verify']['enabled']}-->
&#160; &#160;&#160; &#160;&#160;&#160;<!--{loop $_G['setting']['verify'] $vid $verify}-->
&#160; &#160;&#160; &#160;&#160; &#160;&#160; &#160;&#160; &#160; <!--{if $verify['available'] && $verify['showicon']}-->
&#160; &#160;&#160; &#160;&#160; &#160;&#160; &#160;&#160; &#160; <!--{eval $cmv=DB::fetch_all("select * from ".DB::table("common_member_verify")." where `uid`='用户UID'")}-->
&#160; &#160;&#160; &#160;&#160; &#160;&#160; &#160;&#160; &#160;&#160; &#160;&#160; &#160;&#160; &#160;<!--{if $cmv[0]['verify'.$vid] == 1}-->
&#160; &#160;&#160; &#160;&#160; &#160;&#160; &#160;&#160; &#160;&#160; &#160;&#160; &#160;&#160; &#160;&#160; &#160;&#160; &#160;&#160;&#160;<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>
&#160; &#160;&#160; &#160;&#160; &#160;&#160; &#160;&#160; &#160;&#160; &#160;&#160; &#160;&#160; &#160;<!--{elseif !empty($verify['unverifyicon'])}-->
&#160; &#160;&#160; &#160;&#160; &#160;&#160; &#160;&#160; &#160;&#160; &#160;&#160; &#160;&#160; &#160;&#160; &#160;&#160; &#160;&#160;&#160;<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>
&#160; &#160;&#160; &#160;&#160; &#160;&#160; &#160;&#160; &#160;&#160; &#160;&#160; &#160;&#160; &#160;<!--{/if}-->
&#160; &#160;&#160; &#160;&#160; &#160;&#160; &#160;&#160; &#160; <!--{/if}-->
&#160; &#160;&#160; &#160;&#160;&#160;<!--{/loop}-->
<!--{/if}-->
复制代码
注意把“用户UID”换成变量。
文章标题:discuz 调用认证图标教程

本文地址:http://www.aizhanku.com/t37762

本文标签:
返回顶部