zoukankan      html  css  js  c++  java
  • 方维分享系统二次开发,tip.htm,修改调用的当前用户的信息

    方维分享系统全站调用用户组名称、图标、关注按钮和关注数、分享数、宝贝数、粉丝数、活动数、主题数、活动数;

     

    调用用户组名称、用户组图标解决方法:

    /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&amp;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"]=&gt;
      string(1) "1"
      ["gid"]=&gt;
      string(1) "7"
      ["email"]=&gt;
      string(17) "1006440989@qq.com"
      ["user_name"]=&gt;
      string(11) "wangtongphp"
      ["password"]=&gt;
      string(32) "f59jsfidx98j8423hru3rd0e"
      ["money"]=&gt;
      string(4) "0.00"
      ["credits"]=&gt;
      string(2) "44"
      ["reg_time"]=&gt;
      string(10) "1367603232"
      ["status"]=&gt;
      string(1) "1"
      ["email_status"]=&gt;
      string(1) "0"
      ["avatar"]=&gt;
      string(1) "0"
      ["is_daren"]=&gt;
      string(1) "0"
      ["ucenter_id"]=&gt;
      string(1) "0"
      ["invite_id"]=&gt;
      string(1) "0"
      ["is_buyer"]=&gt;
      string(1) "0"
      ["buyer_level"]=&gt;
      string(1) "0"
      ["seller_level"]=&gt;
      string(1) "0"
      ["server_code"]=&gt;
      string(0) ""
      ["active_sn"]=&gt;
      string(0) ""
      ["follows"]=&gt;
      string(1) "0"
      ["fans"]=&gt;
      string(1) "0"
      ["collects"]=&gt;
      string(1) "0"
      ["favs"]=&gt;
      string(1) "0"
      ["threads"]=&gt;
      string(1) "1"
      ["photos"]=&gt;
      string(1) "3"
      ["goods"]=&gt;
      string(1) "1"
      ["shares"]=&gt;
      string(1) "5"
      ["forums"]=&gt;
      string(1) "1"
      ["forum_posts"]=&gt;
      string(1) "0"
      ["albums"]=&gt;
      string(1) "0"
      ["referrals"]=&gt;
      string(1) "0"
      ["looks"]=&gt;
      string(1) "0"
      ["dapei"]=&gt;
      string(1) "0"
      ["groups"]=&gt;
      string(1) "1"
      ["events"]=&gt;
      string(1) "0"
      ["activity"]=&gt;
      string(1) "1"
      ["activity_post"]=&gt;
      string(1) "0"
      ["vote"]=&gt;
      string(1) "0"
      ["vote_post"]=&gt;
      string(1) "0"
      ["trial"]=&gt;
      string(1) "0"
      ["trial_post"]=&gt;
      string(1) "0"
      ["reg_ip"]=&gt;
      string(9) "127.0.0.1"
      ["last_ip"]=&gt;
      string(9) "127.0.0.1"
      ["last_time"]=&gt;
      string(10) "1367603232"
      ["last_activity"]=&gt;
      string(10) "1367603232"
      ["active_hash"]=&gt;
      string(0) ""
      ["reset_hash"]=&gt;
      string(0) ""
      ["edit_name_count"]=&gt;
      string(1) "0"
      ["black_users"]=&gt;
      NULL
      ["medals"]=&gt;
      array(1) {
        [0]=&gt;
        array(16) {
          ["mid"]=&gt;
          string(1) "1"
          ["name"]=&gt;
          string(12) "新人勋章"
          ["image"]=&gt;
          string(14) "shequjumin.png"
          ["give_type"]=&gt;
          string(1) "0"
          ["expiration"]=&gt;
          string(1) "0"
          ["conditions"]=&gt;
          string(14) "continue_login"
          ["keywords"]=&gt;
          NULL
          ["confine"]=&gt;
          string(1) "1"
          ["allow_group"]=&gt;
          string(0) ""
          ["desc"]=&gt;
          string(33) "分享你的第一个宝贝吧。"
          ["sort"]=&gt;
          string(3) "100"
          ["status"]=&gt;
          string(1) "1"
          ["is_fix"]=&gt;
          string(1) "0"
          ["big_img"]=&gt;
          string(33) "/xiebei/public/medal/big/shequjumin.png"
          ["small_img"]=&gt;
          string(35) "/xiebei/public/medal/small/shequjumin.png"
          ["url"]=&gt;
          string(30) "/xiebei/medal.php?action=index"
        }
      }
      ["last_share"]=&gt;
      string(2) "11"
      ["nick_name"]=&gt;
      string(0) ""
      ["gender"]=&gt;
      string(1) "0"
      ["birth_year"]=&gt;
      string(1) "0"
      ["birth_month"]=&gt;
      string(1) "0"
      ["birth_day"]=&gt;
      string(1) "0"
      ["reside_province"]=&gt;
      string(1) "1"
      ["reside_city"]=&gt;
      string(2) "36"
      ["school"]=&gt;
      string(0) ""
      ["workplace"]=&gt;
      string(0) ""
      ["occupation"]=&gt;
      string(1) "0"
      ["weibo"]=&gt;
      string(31) "http://wangtongphp.cnblogs.com/"
      ["hobby"]=&gt;
      string(0) ""
      ["introduce"]=&gt;
      string(21) "我是一只小小鸟"
      ["url"]=&gt;
      string(32) "/xiebei/u.php?action=index&amp;uid=1"
      ["city"]=&gt;
      string(18) "北京&nbsp;东城"
    }

    我们只要从结果中找到我们需要的变量去调用他即可

    比如我在tip.htm 的第六行加了下面一句,更新缓存之后,前台就会调用了

    <p>关注数:{$user['follows']};小组数:{$user['groups']};话题数:{$user['events']};活动数:{$user['activity']};分享数:{$user['shares']};图格数:{$user['albums']},用户组图标:<!--{getuser $user['uid'] 1 '' 'icard n'}--></p>
  • 相关阅读:
    RBAC权限管理模型 产品经理 设计
    Redisson 分布式锁
    Jenkins下载历史Build版本的归档文件
    Java JPA @Transient 在Hibernate中应用
    Solving the Top ERP and CRM Metadata Challenges with erwin & Silwood
    MySQL 字符串 分割 多列
    MySQL CONCAT opposite
    Web并发页面访问量统计实现
    UNIX网络编程读书笔记:基本UDP套接口编程
    UNIX网络编程调试工具:tcpdump、netstat和lsof
  • 原文地址:https://www.cnblogs.com/wangtongphp/p/3061912.html
Copyright © 2011-2022 走看看