Keyword

Allow more avatar syncing

  • trumpeter
  • trumpeter's Avatar Topic Author
  • Offline
  • New Member
More
14 years 7 months ago #71930 by trumpeter
Allow more avatar syncing was created by trumpeter
E.g. with Jomsocial and phpbb3 and other forum/social networking components.

My site has a phpbb3 forum. I would like to integrate avatars from the forum with K2.

The code appears to be in utilities.php if anyone who is good with Php can help....


// Get user avatar
function getAvatar($userID, $email = NULL, $width = 50) {

$params = &JComponentHelper::getParams('com_k2');

if ($userID == 'alias')
$avatar = JURI::root().'components/com_k2/images/placeholder/user.png';

else if ($userID == 0) {
if ($params->get('gravatar') && !is_null($email)) {
$avatar = 'www.gravatar.com/avatar/'.md5($email).'?s='.$width.'&default='.urlencode(JURI::root().'components/com_k2/images/placeholder/user.png');
} else {
$avatar = JURI::root().'components/com_k2/images/placeholder/user.png';
}
} else if (is_numeric($userID) && $userID > 0) {

$db = &JFactory::getDBO();
$query = "SELECT image FROM #__k2_users WHERE userID={$userID}";
$db->setQuery($query);
$avatar = $db->loadResult();
if ( empty($avatar)) {
if ($params->get('gravatar') && !is_null($email)) {
$avatar = 'www.gravatar.com/avatar/'.md5($email).'?s='.$width.'&default='.urlencode(JURI::root().'components/com_k2/images/placeholder/user.png');
} else {
$avatar = JURI::root().'components/com_k2/images/placeholder/user.png';
}
}
else {
$avatar = JURI::root().'media/k2/users/'.$avatar;
}

}

return $avatar;
}

Please Log in or Create an account to join the conversation.

More
14 years 3 months ago #71931 by 4bweb
Replied by 4bweb on topic Allow more avatar syncing
I'm interesting in this integration too, but I am not able to do. If anybody can help us it will be good for many people.

Ciao, Ale

Please Log in or Create an account to join the conversation.


Powered by Kunena Forum