Forums

Gravatar

thiagovagostelo 12 Apr, 2009
Hi,

I'm Trying to put Gravatar in my ChronoComments. I use this code in comment-item.html.php

<?php
$email = "{comment_email}";
$email = strtolower($email);
$size = 80;
$default = "http://tboa.com.br/teste/components/com_chronocomments/images/avatar1.png";
$grav_url = "http://www.gravatar.com/avatar.php?gravatar_id=".md5($email)."&default=".urlencode($default)."&size=".$size; ?>
<div id="ver"><?php print $email;?></div>
<img src="<?php echo $grav_url; ?>" alt="avatar" class="avatar"/>


This print to me the email from comment but the gravatar don't work. If I change "{comment_email}" for my email the gravatar work perfect, so, you have any idea whats goin on? I can pick the email from comment if php and not if {comment_email}?

Ty

Thiago Vagostelo
thiagovagostelo 13 Apr, 2009
Hi!

After hours trying I find a answer =D

If anyone want gravatar in your comment system you have to do this:

In /components/com_chronocomments/chronocomments.php find:
'avatar' => $avatar ? $avatar : JURI::Base().'components/com_chronocomments/images/avatar1.png',
and replace it with:
'avatar' => 'http://www.gravatar.com/avatar.php?gravatar_id='.md5( strtolower($commentx->email) ).'&default=http://yoursite.com/components/com_chronocomments/images/avatar1.png&size=80',
,

three times in this file. Save and up!

In /plugins/content/ChronoComments.php

Find:
'avatar' => $avatar ? $avatar : JURI::Base().'components/com_chronocomments/images/avatar2.png',
and replace it with:
'avatar' => 'http://www.gravatar.com/avatar.php?gravatar_id='.md5( strtolower($commentx->email) ).'&default=http://yoursite.com/components/com_chronocomments/images/avatar1.png&size=80',

twice in this file. Save and up!

Ok, your gravatar is working =P I put 80px x 80px in mine but you can put the size you want =)

Sorry my english, I'm brazilian =P And great component =D

o/

Thiago Vagostelo

[[>> edited for clarity : greyhead <<]]
Max_admin 15 Apr, 2009
Hi Thiago,

obrigado!🙂 this is really helpful, in the last few days I was not active here because of Chronoforms upgrades, I will make this better soon!

Regards
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
Maxvn 25 Apr, 2009
thank so much

I got it
This topic is locked and no more replies can be posted.