News:

SMF 2.1.4 has been released! Take it for a spin! Read more.

Main Menu

SSI Avatar Integration

Started by Oathkeeper, December 05, 2010, 05:03:43 PM

Previous topic - Next topic

Oathkeeper

I'm sure someone has already asked this but I've yet to find a solution.

Here is the website in question: http://obsidianvector.com/rebirth/staff.php [nofollow]

I'm trying to call the avatars of those specific staff members any way I can without causing too much lag (I've heard many ways can cause alot of queries, which I really don't want unless it's necessary).

So yea, I'm wanting to replace the stock images below the staff members names with a link to their avatar, and when they change it I want it to automatically change to accommodate.


IchBin™

SMF2 already provides a way to grab all the information for a user that you should need, including the avatar. You can use the ssi_fetchMember() funtion to get this. All you should have to do is provide the list of member ID's that you need to grab the info for. Something like this:

$members = array(1,5,7);

ssi_fetchMember($members);


If you need to custom format the output you'll have to do something like this:

$membersID = array(1,5,7);

$members = ssi_fetchMember($membersID, 'array');

//echo '<pre>', print_r($members),'</pre>';

foreach($members as $user) {
    // Customize output here
    echo '<h3>' , $user['username'] , '</h3>
    <p>' , $user['avatar']['image'] , '</p>';

}


If you want more information from the user just uncomment the //echo '<pre>', print_r($members),'</pre>'; line that I commented out. It will show you what is available from the user. Hope that helps.
IchBin™        TinyPortal

Oathkeeper


Advertisement: