Buy Now
Sign in

Gravatar

thiagovagostelo , April 12 2009, 20:34
T
thiagovagostelo 3
April 12 2009, 20:34 #29602
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
T
thiagovagostelo 3
April 13 2009, 04:20 #29604
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 <<]]
admin 32
April 15 2009, 05:47 #29827
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
M
Maxvn 15
April 25 2009, 05:14 #30769
thank so much

I got it