方维分享系统全站调用用户组名称、图标、关注按钮和关注数、分享数、宝贝数、粉丝数、活动数、主题数、活动数;
调用用户组名称、用户组图标解决方法:
/services/module/user/tip.php
55行加
//add by wangtongphp 获取用户组的信息 if($user['gid']){ $user['u_group'] = FDB::fetchFirst("select * from ".FDB::table('user_group')." where gid = ".$user['gid']); }
tip.htm调用
用户组名称:{$user['u_group']['name']}; {if $user['u_group']['icon']} 用户组图标:<img src="./public/icons/{$user['u_group']['icon']}"/> {/if}
**********************++++++++++++++++++++++++++++++++**************************
我一般都是用firebug的Event Listeners的功能来看DOM的触发事件,但是刚刚却没有检查到
<a class="GUID icard n gc" uid="1" title="wangtongphp" href="/xiebei/u.php?action=index&uid=1" target="_blank">wangtongphp</a>
这个的mouseover操作,只能去手动找,找到了以下的ajax
$(".GUID").live('mouseover',function(){ if(FANWE.GUID_DEFAULT_HTML == null) FANWE.GUID_DEFAULT_HTML = $("#USER_INFO_TIP").html(); clearTimeout(FANWE.GUID_TIME_OUT); ClearUserTipAjax(); var uid = parseInt(this.getAttribute('uid')); if(uid < 1) return; UserTipShow(this,FANWE.GUID_DEFAULT_HTML); var query = new Object(); query.uid = uid; var thisobj = this; FANWE.User_Tip_Ajax = $.ajax({ url: SITE_PATH+"services/service.php?m=user&a=tip", type: "POST", data:query, cache:false, dataType: "html", success:function(html){ if(html != '') { UserTipShow(thisobj,html); } else $("#USER_INFO_TIP").hide(); ClearUserTipAjax(); }, error:function(){ $("#USER_INFO_TIP").hide(); ClearUserTipAjax(); } }); }).live('mouseout',function(){ var fun = function(){ $("#USER_INFO_TIP").hide(); }; FANWE.GUID_TIME_OUT = setTimeout(fun,500); ClearUserTipAjax(); });
我就孙藤摸瓜找到了tip.php;
然后找到了tip.htm,在里面打印$user;出现下面的结果:
array(66) { ["uid"]=> string(1) "1" ["gid"]=> string(1) "7" ["email"]=> string(17) "1006440989@qq.com" ["user_name"]=> string(11) "wangtongphp" ["password"]=> string(32) "f59jsfidx98j8423hru3rd0e" ["money"]=> string(4) "0.00" ["credits"]=> string(2) "44" ["reg_time"]=> string(10) "1367603232" ["status"]=> string(1) "1" ["email_status"]=> string(1) "0" ["avatar"]=> string(1) "0" ["is_daren"]=> string(1) "0" ["ucenter_id"]=> string(1) "0" ["invite_id"]=> string(1) "0" ["is_buyer"]=> string(1) "0" ["buyer_level"]=> string(1) "0" ["seller_level"]=> string(1) "0" ["server_code"]=> string(0) "" ["active_sn"]=> string(0) "" ["follows"]=> string(1) "0" ["fans"]=> string(1) "0" ["collects"]=> string(1) "0" ["favs"]=> string(1) "0" ["threads"]=> string(1) "1" ["photos"]=> string(1) "3" ["goods"]=> string(1) "1" ["shares"]=> string(1) "5" ["forums"]=> string(1) "1" ["forum_posts"]=> string(1) "0" ["albums"]=> string(1) "0" ["referrals"]=> string(1) "0" ["looks"]=> string(1) "0" ["dapei"]=> string(1) "0" ["groups"]=> string(1) "1" ["events"]=> string(1) "0" ["activity"]=> string(1) "1" ["activity_post"]=> string(1) "0" ["vote"]=> string(1) "0" ["vote_post"]=> string(1) "0" ["trial"]=> string(1) "0" ["trial_post"]=> string(1) "0" ["reg_ip"]=> string(9) "127.0.0.1" ["last_ip"]=> string(9) "127.0.0.1" ["last_time"]=> string(10) "1367603232" ["last_activity"]=> string(10) "1367603232" ["active_hash"]=> string(0) "" ["reset_hash"]=> string(0) "" ["edit_name_count"]=> string(1) "0" ["black_users"]=> NULL ["medals"]=> array(1) { [0]=> array(16) { ["mid"]=> string(1) "1" ["name"]=> string(12) "新人勋章" ["image"]=> string(14) "shequjumin.png" ["give_type"]=> string(1) "0" ["expiration"]=> string(1) "0" ["conditions"]=> string(14) "continue_login" ["keywords"]=> NULL ["confine"]=> string(1) "1" ["allow_group"]=> string(0) "" ["desc"]=> string(33) "分享你的第一个宝贝吧。" ["sort"]=> string(3) "100" ["status"]=> string(1) "1" ["is_fix"]=> string(1) "0" ["big_img"]=> string(33) "/xiebei/public/medal/big/shequjumin.png" ["small_img"]=> string(35) "/xiebei/public/medal/small/shequjumin.png" ["url"]=> string(30) "/xiebei/medal.php?action=index" } } ["last_share"]=> string(2) "11" ["nick_name"]=> string(0) "" ["gender"]=> string(1) "0" ["birth_year"]=> string(1) "0" ["birth_month"]=> string(1) "0" ["birth_day"]=> string(1) "0" ["reside_province"]=> string(1) "1" ["reside_city"]=> string(2) "36" ["school"]=> string(0) "" ["workplace"]=> string(0) "" ["occupation"]=> string(1) "0" ["weibo"]=> string(31) "http://wangtongphp.cnblogs.com/" ["hobby"]=> string(0) "" ["introduce"]=> string(21) "我是一只小小鸟" ["url"]=> string(32) "/xiebei/u.php?action=index&uid=1" ["city"]=> string(18) "北京 东城" }
我们只要从结果中找到我们需要的变量去调用他即可
比如我在tip.htm 的第六行加了下面一句,更新缓存之后,前台就会调用了
<p>关注数:{$user['follows']};小组数:{$user['groups']};话题数:{$user['events']};活动数:{$user['activity']};分享数:{$user['shares']};图格数:{$user['albums']},用户组图标:<!--{getuser $user['uid'] 1 '' 'icard n'}--></p>