Simple Machines Community Forum

Customizing SMF => SMF Coding Discussion => Topic started by: Smasher on November 25, 2009, 02:57:00 AM

Title: Getting Avatar From Database
Post by: Smasher 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....



$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
Title: Re: Getting Avatar From Database
Post by: tyty1234 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 (http://www.simplemachines.org/community/index.php?topic=341572.msg2302776#msg2302776).
Title: Re: Getting Avatar From Database
Post by: H on December 06, 2009, 04:38:52 PM
Smasher, do you require any further assistance? :)