AI智能回复搜索中,请稍后...
3 回答
//动态插入盒子 $('#aw-ajax-box').html(Hogan.compile(AW_TEMPLATE.userCard).render( { 'verified' : verified, 'verified_enterprise' : verified_enterprise, 'uid': result.uid, 'avatar_file': result.avatar_file, 'user_name': result.user_name, 'reputation': result.reputation, 'agree_count': result.agree_count, 'fans_count': result.fans_count, 'signature': result.signature, 'url' : result.url, 'category_enable' : result.category_enable, 'focus': focus, 'focusTxt': focusTxt }));aw_template.js文件对应着下面改:
'\app\people目录下 ajax.php文件'agree_count' => $user_info['agree_count'],下行增加:'fans_count' => $user_info['fans_count'], '+
H::ajax_json_output(array( 'reputation' => $user_info['reputation'], 'agree_count' => $user_info['agree_count'], 'thanks_count' => $user_info['thanks_count'], 'fans_count' => $user_info['fans_count'], 'type' => 'people', 'uid' => $user_info['uid'], 'user_name' => $user_info['user_name'], 'avatar_file' => get_avatar_url($user_info['uid'], 'mid'), 'signature' => $user_info['signature'], 'focus' => ($user_follow_check ? true : false), 'is_me' => (($this->user_id == $user_info['uid']) ? true : false), 'url' => get_js_url('/people/' . $user_info['url_token']), 'category_enable' => ((get_setting('category_enable') == 'Y') ? 1 : 0), 'verified' => $user_info['verified'] ));
$fensi= $this->model('account')->fensi($user_info['uid']);
在紧接着的下面找到“'verified' => $user_info['verified'],” 回车换行添加一句
'fen' => $fensi,
注:查询单个用户被关注的数量,model里面我自定义了一个函数 fensi。
二:models/account.php 里面 添加fensi函数
在最后一个}前面添加如下代码
public function fensi($uid)
{
$qid = $this->query_row("SELECT count(*) as zong FROM `aws_user_follow` WHERE `friend_uid`='".$uid."'");
return $qid["zong"];
}
三:static/js/aw_template.js 的usercard模板
找到 “'' + _t('赞同') + ': {{agree_count}}“
回车添加
'' + _t('粉丝') + ': {{fen}} '+
即可。
友情提醒:改代码有风险,改之前请复制一个改名备份。。。。。 这家伙很懒,还没有设置简介