Advertisement:

Author Topic: Getting Avatar From Database  (Read 1398 times)

Offline Smasher

  • Jr. Member
  • **
  • Posts: 118
  • Gender: Male
Getting Avatar From Database
« on: November 25, 2009, 02:57:00 AM »
in my php file I am using the following database query to define $context['game']['members'] but I can not figure out how I am supposed to pull the avatar in....
 
Code: [Select]

$dbresult = $smcFunc['db_query']('', "
SELECT
id_member, member_name
FROM {db_prefix}members ORDER BY member_name ASC");
$context['game_members'] = array();
while($row = $smcFunc['db_fetch_assoc']($dbresult))
{
$context['game_members'][] = $row;
}
$smcFunc['db_free_result']($dbresult);


When I say the avatar I am specifically talking about an avatar that would normally be accessed by $context['avatar']['image']
 
Thank you
Site in Development

Powered by SMF 2.0.4
     - EzPortal 1.0
     - SA Facebook Integration

Offline tyty1234

  • SMF Hero
  • ******
  • Posts: 2,132
  • Gender: Male
  • <?php give_support(); ?>
    • tyty1234's SMF Site
Re: Getting Avatar From Database
« Reply #1 on: November 25, 2009, 04:58:48 AM »
You can easily get their avatar by loading up their member data using the loadMemberData function.

Try reading this post.
My Activity: Inactive
My Links: tyty1234's SMF Site | SMF Package Parser | SMF Helper | My Mods [5]
Subscribe to my SMF blog for updates
PMs for support will not be accepted, unless requested otherwise.

Offline H

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 21,662
  • Gender: Male
Re: Getting Avatar From Database
« Reply #2 on: December 06, 2009, 04:38:52 PM »
Smasher, do you require any further assistance? :)
-H
Former Support Team Lead
                              I recommend:
Namecheap (domains)
Fastmail (e-mail)
Linode (VPS)