Hello, we had problem with showing avatars in Jcomments from Agora Forum.
No we fix it.
---SOLUTION---
1. Download new version of Avatar plugin [http://www.joomlatune.com/jcomments-downloads.html]
2. Enable plugin, enable plugins in Jcomments settings.
3. In jcomments.avatar.php replace code for
plgJCommentsAvatars function (should be around 223 line) with following:
case 'agora':
if (count($users)) {
$db->setQuery('SELECT id, jos_id FROM #__agora_users WHERE jos_id in (' . implode(',', $users) . ')');
$avatars = $db->loadObjectList('jos_id');
unset($users);
} else {
$avatars = array();
}
if ($avatar_link) {
$db->setQuery('SELECT id FROM #__menu WHERE link="index.php?option=com_agora"');
$_Itemid = $db->loadResult();
$agoraProfileLink = "index.php?option=com_agora&Itemid=" . $_Itemid . '&task=profile&id=';
}
$agoraCfgFile = $mainframe->getCfg('absolute_path') . DS . 'components' . DS . 'com_agora' . DS . 'cache' . DS . 'cache_config.php';
$avatarsPath = $mainframe->getCfg('absolute_path') . DS . 'components' . DS . 'com_agora' . DS . 'img' . DS . 'pre_avatars';
if (is_file($agoraCfgFile)) {
include_once($agoraCfgFile);
$avatarsPath = $agora_config['o_avatars_dir'];
}
$avatarsPath = $mainframe->getCfg('absolute_path') . DS . 'components' . DS . 'com_agora' . DS . 'img' . DS . 'pre_avatars';
for ($i=0,$n=count($comments); $i < $n; $i++) {
$userid = $comments[$i]->userid;
// profile link
$comments[$i]->profileLink = (intval($userid) && isset($agoraProfileLink)) ? JoomlaTuneRoute::_($agoraProfileLink . $avatars[$userid]->id) : '';
if (isset($avatars[$userid]) && $avatarsPath != '') {
$avatar_gif = $avatarsPath . '/' . $avatars[$userid]->id . '.gif';
$avatar_jpg = $avatarsPath . '/' . $avatars[$userid]->id . '.jpg';
$avatar_png = $avatarsPath . '/' . $avatars[$userid]->id . '.png';
if (file_exists($avatar_gif)) {
$avatarFile = DS . 'components' . DS . 'com_agora' . DS . 'img' . DS . 'pre_avatars'. '/' . $avatars[$userid]->id . '.gif';
} else if (file_exists($avatar_jpg)) {
$avatarFile = DS . 'components' . DS . 'com_agora' . DS . 'img' . DS . 'pre_avatars'. '/' . $avatars[$userid]->id . '.jpg';
} else if (file_exists($avatar_png)) {
$avatarFile = DS . 'components' . DS . 'com_agora' . DS . 'img' . DS . 'pre_avatars'. '/' . $avatars[$userid]->id . '.png';
} else {
$avatarFile = '';
}
if ($avatarFile != '') {
$comments[$i]->avatar = plgJCommentsAvatarImg($mainframe->getCfg('live_site') . '/' . $avatarFile);
} else {
$comments[$i]->avatar = '';
}
} else {
$comments[$i]->avatar = '';
}
}
unset($avatars);
break;
4. After this, make sure that you have
'var $live_site' filled up correctly in you configuration.php file.
5. Should works now
