Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length

JoomlaTune Support Forum    JComments component    Bug-reports    Topic: Not showing agora avatars
Pages: [1]   Go Down
  Print  
Author Topic: Not showing agora avatars  (Read 2420 times)
0 Members and 2 Guests are viewing this topic.
stefansrb
Newbie
*

Karma: 0
Offline Offline

Posts: 7


Email
« on: October 23, 2010, 18:07:37 »

Hi. I installed plugin, enabled it, set agora forum integration, set permissions for gravatar, set support for plugins in jcomments settings to yes, but still no avatar is shown... any ideas please Huh
Thanks in advance.
Logged
smart
Administrator
Hero Member
*****

Karma: 160
Offline Offline

Gender: Male
Posts: 2559



WWW
« Reply #1 on: October 23, 2010, 23:06:08 »

Could you specify versions of JComments Avatar and Agora?
Logged

If you use JComments, please post a rating and a review at the Joomla! Extensions Directory
stefansrb
Newbie
*

Karma: 0
Offline Offline

Posts: 7


Email
« Reply #2 on: October 24, 2010, 05:58:41 »

Sure:
 - Agora 3.0.137
 - JComments avatar plugin 3.1 (the one in download section, not quite sure version number)
 - JComments 2.2.0.2
 - Joomla 1.5.21
Logged
~cXc~
Newbie
*

Karma: 0
Offline Offline

Posts: 5



« Reply #3 on: October 28, 2010, 06:13:09 »

This post helped me a lot, http://www.joomlatune.com/forum/index.php/topic,1241.0.html but I had to use slightly different code for the links instead of using DS (lines 37, 39 and 41 below) I had to change to / ...
Code:
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 = '/components/com_agora/img/pre_avatars'. '/' . $avatars[$userid]->id . '.gif';
   } else if (file_exists($avatar_jpg)) {
   $avatarFile = '/components/com_agora/img/pre_avatars'. '/' . $avatars[$userid]->id . '.jpg';
   } else if (file_exists($avatar_png)) {
   $avatarFile = '/components/com_agora/img/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;
... is what I am using at the moment and all seems to be working so try the fix in the other post first if it doesn't work try mine Wink
« Last Edit: October 28, 2010, 06:15:55 by ~cXc~ » Logged
Pages: [1]   Go Up
  Print  
JoomlaTune Support Forum    JComments component    Bug-reports    Topic: Not showing agora avatars
 
Jump to: