Support

Akeeba Ticket System

#24921 Overriding plugin Gravatar to CB Avatar. And a Language question.

Posted in ‘Akeeba Ticket System for Joomla! 4 & 5’
This is a public ticket

Everybody will be able to see its contents. Do not include usernames, passwords or any other sensitive information.

Environment Information

Joomla! version
n/a
PHP version
n/a
Akeeba Ticket System version
n/a

Latest post by on Thursday, 12 May 2016 17:20 CDT

user90123
 Hi Nicholas,

Thank you for your prompt replies and patience with me during my "presales" stages. Since I've purchased my subscription now, I am creating a ticket to continue part of our discussion.

From our Presales exchange:
Me: One thing, though. My site uses Community Builder. My user's avatars come from that. Is there an ATS plugin to pull avatars from CB?

Nicholas: There is no such plugin but you should be able to easily create one using the simple code of the Gravatar plugin shipped with ATS.
You were quite correct in that the code was easy to modify. Here is the modification I made to the gravatar.php that is part of the Gravatar plugin.

Just before the return $url; statement, I inserted the following code:
/* Begin modification to replace gravatar with CB avatar - Zy Danielson */
	$userid = $user->id;
	$database = JFactory::getDBO();
	$database-> setQuery("SELECT avatar FROM #__comprofiler WHERE user_id = $userid AND avatarapproved = '1'");
	$avatar = $database->loadResult();
	$url = 'http://MY_DOMAIN/images/comprofiler/'.$avatar;
/* End modification to replace gravatar with CB avatar */

In case anyone else out there is using Community Builder and wants CB Avatar integration with ATS, just replace MY_DOMAIN in the code above with your domain name.

Here's my question. Since I'm far from a Joomla! pro at this point, I have replaced your gravatar.php in the gravatar plugin with my modified version. I know future updates might overwrite this file again, and I can always re-upload my modification if it does, but I'm wondering if there is a better way to do this. Any advice?

My other question: As you may recall, I have made some overrides using Joomla!'s Language manager. Are the language files for Pro different from what I installed with Core? If so, and I install them, I assume the overrides I've made should still hold for the new Language files, correct?

Thank you. I'm very excited to join your list of professional subscribers for ATS.

Best Regards,
Zy

tampe125
Akeeba Staff
Hello,

regarding your language question, Pro and Core versions share the same language files, so your overrides will be fine with every version.

Your plugin is 90% correct, your missing the final point: instead of modifying the current plugin, you should copy it and create a new plugin. You should give it a different name, zip all the files you found in the plugin folder and then install it inside Joomla.
In this way you just created a new plugin and it won't be replaced in the next update.
Remember to publish it after you installed it!

Davide Tampellini

Developer and Support Staff

🇮🇹Italian: native 🇬🇧English: good • 🕐 My time zone is Europe / Rome (UTC +1)
Please keep in mind my timezone and cultural differences when reading my replies. Thank you!

System Task
system
This ticket has been automatically closed. All tickets which have been inactive for a long time are automatically closed. If you believe that this ticket was closed in error, please contact us.

Support Information

Working hours: We are open Monday to Friday, 9am to 7pm Cyprus timezone (EET / EEST). Support is provided by the same developers writing the software, all of which live in Europe. You can still file tickets outside of our working hours, but we cannot respond to them until we're back at the office.

Support policy: We would like to kindly inform you that when using our support you have already agreed to the Support Policy which is part of our Terms of Service. Thank you for your understanding and for helping us help you!