Members: 278  •  Posts: 12615  •  Topics: 864  •  Please welcome bosanci28, our newest member.
Please login or register.

Login with username, password and session length
 

News:

Welcome To Graphics Mayhem

collapse

Author Topic: The $memberContext array  (Read 115 times)

0 Members and 1 Guest are viewing this topic.

SoLoGHoST

  • SMF MOD Expert!
  • SoLoGHoSt
  • Connoisseur
  • Offline
  • Posts: 2143
  • OS:
  • Windows Vista/Server 2008
  • Browser:
  • MS Internet Explorer 8.0
The $memberContext array
« on: July 25, 2009, 11:24:22 AM »
    You can get tons of info from the $memberContext array just by supplying the id value of the user.  Figured I'd make this available to you all in hopes that you may find this useful for your needs at your forum(s).

    Please note, you must define: 
    Code: [Select]
    global $memberContext, $user_info, $sourcedir; in the function you are using to call the information from $memberContext.  You will need to require the Load.php file so that you can use the functions required to do this with.  Also, loadMemberData($user_info['id']) and loadMemberContext($user_info['id']) functions should be used just prior to calling the $memberContext information.  The following is an example:
    Code: [Select]
    require_once($sourcedir . '/Load.php');
    loadMemberData($user_info['id']);
    loadMemberContext($user_info['id']);

    Now you can call any of these to get the specific information from that user.  The following is a complete list of information you can get...
    Code: [Select]
    $memberContext[$user_info['id']]['username'] = gets users membername
    $memberContext[$user_info['id']]['name'] = gets users real name
    $memberContext[$user_info['id']]['id'] = gets users id, but better to just use $user_info['id'] instead
    $memberContext[$user_info['id']]['is_buddy'] = returns whether or not user is buddy
    $memberContext[$user_info['id']]['is_reverse_buddy'] = reverses the buddy list
    $memberContext[$user_info['id']]['buddies'] = gets all buddies from that user
    $memberContext[$user_info['id']]['title'] = gets the users title
    $memberContext[$user_info['id']]['href'] = returns a link to that users profile only
    $memberContext[$user_info['id']]['link'] = returns users name as a link to their profile
    $memberContext[$user_info['id']]['email'] = gives you the users email address
    $memberContext[$user_info['id']]['show_email'] = determines whether to show or hide that users email address
    $memberContext[$user_info['id']]['registered'] = determines if a user is registered, if so, will return time and date when they registered, otherwise, Not Applicable text.
    $memberContext[$user_info['id']]['registered_timestamp'] = returns date and time user registered
    $memberContext[$user_info['id']]['blurb'] = returns the text that the user has typed into the Personal text area in their profile
    $memberContext[$user_info['id']]['gender']['name'] = returns text whether user is male or female
    $memberContext[$user_info['id']]['gender']['image'] = returns image representing either male of female of that user.

    $memberContext[$user_info['id']]['website']['title'] = returns text for users website via their profile
    $memberContext[$user_info['id']]['website']['url'] = returns href for users website via their profile

    $memberContext[$user_info['id']]['birth_date'] = returns users Birthday as string
    $memberContext[$user_info['id']]['signature'] = returns users signature via profile
    $memberContext[$user_info['id']]['location'] = returns users location via profile

    $memberContext[$user_info['id']]['icq']['name'] = returns icq name
    $memberContext[$user_info['id']]['icq']['href'] = returns icq href
    $memberContext[$user_info['id']]['icq']['link'] = returns name as a link to href with image for icq.
    $memberContext[$user_info['id']]['icq']['link_text'] = returns name as a link to href without image for icq.

    $memberContext[$user_info['id']]['aim']['name'] = returns aim name
    $memberContext[$user_info['id']]['aim']['href'] = returns aim href
    $memberContext[$user_info['id']]['aim']['link'] = returns name as a link to href with image for aim.
    $memberContext[$user_info['id']]['aim']['link_text'] = returns name as a link to href without image for aim.

    $memberContext[$user_info['id']]['yim']['name'] = returns yim name
    $memberContext[$user_info['id']]['yim']['href'] = returns yim href
    $memberContext[$user_info['id']]['yim']['link'] = returns name as a link to href with image for yim.
    $memberContext[$user_info['id']]['yim']['link_text'] = returns name as a link to href without image for yim.

    $memberContext[$user_info['id']]['msn']['name'] = returns msn name
    $memberContext[$user_info['id']]['msn']['href'] = returns msn href
    $memberContext[$user_info['id']]['msn']['link'] = returns name as a link to href with image for msn.
    $memberContext[$user_info['id']]['msn']['link_text'] = returns name as a link to href without image for msn.

    $memberContext[$user_info['id']]['real_posts'] = returns posts
    $memberContext[$user_info['id']]['posts'] = returns posts a little differently
    $memberContext[$user_info['id']]['avatar']['name'] = returns name of avatar
    $memberContext[$user_info['id']]['avatar']['image'] = returns link of avatar image
    $memberContext[$user_info['id']]['avatar']['href'] = returns name as a link to the avatar image
    $memberContext[$user_info['id']]['avatar']['url'] = returns avatar url

    $memberContext[$user_info['id']]['last_login'] = returns time/date of last login by that user.
    $memberContext[$user_info['id']]['last_login_timestamp'] = returns last login timestamp by that user.
    $memberContext[$user_info['id']]['karma']['good'] = returns karma good
    $memberContext[$user_info['id']]['karma']['bad'] = returns karma bad
    $memberContext[$user_info['id']]['karma']['allow'] = returns whether user is allowed to edit the karma of another user

    $memberContext[$user_info['id']]['ip'] = returns ip,
    $memberContext[$user_info['id']]['ip2'] = returns second formatted ip
    $memberContext[$user_info['id']]['online']['is_online'] = returns whether user is online or not
    $memberContext[$user_info['id']]['online']['text'] = returns online or offline depending on user status
    $memberContext[$user_info['id']]['online']['href'] = returns link to send user a new personal message
    $memberContext[$user_info['id']]['online']['link'] = returns online or offline with a link to a new personal message for that user.
    $memberContext[$user_info['id']]['online']['image_href'] = returns image for online/offline with link.
    $memberContext[$user_info['id']]['online']['label'] = returns "online" or "offline" again in text format depending on users status.

    $memberContext[$user_info['id']]['language'] = returns language user is using in their profile
    $memberContext[$user_info['id']]['is_activated'] = returns whether user is active or not
    $memberContext[$user_info['id']]['is_banned'] = returns whether user is banned or not
    $memberContext[$user_info['id']]['options'] = returns profile options for that user
    $memberContext[$user_info['id']]['is_guest'] = returns whether a user is a guest or not, but like using if (!user_info['id']) better.
    $memberContext[$user_info['id']]['group'] = returns the usergroup that member belongs to.
    $memberContext[$user_info['id']]['group_color'] = returns the color of the usergroup
    $memberContext[$user_info['id']]['group_id'] = returns the id for that usergroup
    $memberContext[$user_info['id']]['post_group'] = returns the post usergroup for that member.
    $memberContext[$user_info['id']]['post_group_color'] = returns the color of the post usergroup for that member.
    $memberContext[$user_info['id']]['group_stars'] = returns image of stars representing that usergroup
    $memberContext[$user_info['id']]['warning'] = not sure about this 1, need to test on this, may give that user a warning, but not sure...
    $memberContext[$user_info['id']]['warning_status'] = returns status of users warnings
    $memberContext[$user_info['id']]['local_time'] = returns the users local time right now.

    I have described each one best I can, but I could be wrong in some instances, as I'm still learning all of SMF's variables and definitions.

    Solomon
    « Last Edit: September 10, 2009, 11:24:12 AM by SoLoGHoST »

    dobie

    • Proficient
    • Offline
    • Posts: 145
    • OS:
    • Windows Vista/Server 2008
    • Browser:
    • MS Internet Explorer 6.0
    Re: The $memberContext array
    « Reply #1 on: August 23, 2009, 11:48:48 PM »
      solo you is the man thanx for this it should help all great stuff

      dobs

      SoLoGHoST

      • SMF MOD Expert!
      • SoLoGHoSt
      • Connoisseur
      • Offline
      • Posts: 2143
      • OS:
      • Windows Vista/Server 2008
      • Browser:
      • MS Internet Explorer 8.0
      Re: The $memberContext array
      « Reply #2 on: August 24, 2009, 12:13:48 AM »
        Sure thing.  You're very welcome :)
         


        Search


        Latest Activity.
        Novembers Graphics Mayhem Wallpaper by Shortie
        [Today at 07:48:08 AM]


        Need some badges... please by Green CoW
        [Today at 04:19:17 AM]


        Icon For Top To Link To Wiki by Shortie
        [Today at 02:42:14 AM]


        Windows 7 Walls by NerdBoy
        [Yesterday at 07:51:35 PM]


        More Distinct For SMF RC2 by the yicker
        [Yesterday at 11:40:32 AM]


        November's Logo Challenge "Up Top" (2009)... by NerdBoy
        [Yesterday at 05:41:46 AM]


        What's the deal with SMF? by NerdBoy
        [Yesterday at 05:40:12 AM]


        Deep Red 2 For SMF RC2 by Shortie
        [Yesterday at 04:22:26 AM]


        help in a photo by SoLoGHoST
        [November 18, 2009, 08:34:10 PM]


        Topic Count in Profiles by live627
        [November 18, 2009, 06:14:20 PM]


        ATI Catalyst™ version 9.11 released by Nukegaming
        [November 18, 2009, 03:44:16 PM]


        themed logo challenge by Shortie
        [November 17, 2009, 02:29:20 PM]



        Page created in 0.09 seconds with 22 queries.