Forum
Welcome, Guest
Please Login to access forum.
k2 avatar (1 viewing) 
Go to bottom
TOPIC: k2 avatar
#4097
TOTAL MEDIA PC
Junior Boarder
Posts: 21
User Offline
k2 avatar Karma: 0  
Hi.

I'm wondering if is possible to integrate k2 avatars into jchatsocial.
I really don't want to use any 3rd party social components like cb.

Maybe I could modify the code of existing integration to get k2 avatar?

Thank you in advance.
 
Logged Logged  
  The administrator has disabled public write access.
#4098
John Dagelmore
Admin
Posts: 3722
User Online Now
Re:k2 avatar Karma: 79  
Hi,

well i even didn't know that k2 had some avatars management.
So i have no idea how it works, but probably it's possible to develop the integration.

If you are a Joomla PHP coder you should work on the function getAvatar
included in the file of JChat at this path:

root/administrator/components/com_jchat/framework/helpers/users.php

Good luck!

John
 
Logged Logged  
  The administrator has disabled public write access.
#4099
TOTAL MEDIA PC
Junior Boarder
Posts: 21
User Offline
Re:k2 avatar Karma: 0  
Thanks!

I made it work as default.

It would be nice to have it as an option in backend as well and you may include it in next version so that I don't have to make this change every time I upgrade.

I can give you the query.

Thanks.
 
Logged Logged  
  The administrator has disabled public write access.
#4100
John Dagelmore
Admin
Posts: 3722
User Online Now
Re:k2 avatar Karma: 79  
Thank you mate!

Please post here the code and i will include it in the next release.

John
 
Logged Logged  
  The administrator has disabled public write access.
#4101
TOTAL MEDIA PC
Junior Boarder
Posts: 21
User Offline
Re:k2 avatar Karma: 0  
Code:

// PRIORITY 1 - K2 Avatar if($userId) { $DBO = JFactory::getDBO(); $sql = "SELECT CONCAT('" . $baseURL . "media/k2/users/', image)" . "\n FROM #__k2_users AS cu" . "\n WHERE cu.userID = " . $DBO->quote($userId) . "\n AND cu.image != ''"; $DBO->setQuery($sql); if($userAvatar = $DBO->loadResult()) { $avatarCache[$sessionID] = $userAvatar; return $userAvatar; } }
 
Logged Logged  
  The administrator has disabled public write access.
Go to top