注册 | 登录 |
地方论坛门户及新闻和人才网址大全

Discuz调用用户勋章方法

时间:2021-07-21人气:-


  1. $user_medal = C::t('common_member_medal')->fetch_all_by_uid($_G['uid']);
  2. foreach($user_medal as $k=>$value){
  3. $us_medal = reset(C::t('forum_medal')->fetch_all_by_id($value['medalid']));
  4. $user_medals[$k] = $us_medal;
  5. $user_medals[$k]['image'] = 'static/image/common/'.$us_medal['image'];
  6. }
复制代码


模板循环代码:
  1. <!--{loop $user_medals $v}-->
  2. $v['....']
  3. <!--{/loop}-->
复制代码

字典解释:


medalidsmallint(6) unsignedNO是勋章idnamevarchar(50)NO勋章名称availabletinyint(1)0NO是否启用imagevarchar(255)NO勋章图片typetinyint(1)0NO勋章类型displayordertinyint(3)0NO勋章显示顺序descriptionvarchar(255)NO勋章描述expirationsmallint(6) unsigned0NO勋章有效期permissionmediumtextNO勋章获得条件表达式credittinyint(1) unsigned0NO勋章购买使用积分pricemediumint(8) unsigned0NO勋章价格

上篇:Discuz common.js 内置(AJAX)函数帮助文...

下篇:discuz帖子截取简介str_replace函数和mess...