1 joshua Jan 02, 2009 15:55
3 joshua Jan 02, 2009 17:52
Thanks for your answer - but this
<?php
$email = $Comment->get_author_email();
?>
gives back a complete link including mailto:
So it don´t work, I already tried this.
Cheers,
Joshua
EDIT:
That´s how I modified _item_comment.inc.php
$grav_url = "http://www.gravatar.com/avatar.php?gravatar_id=".md5($Comment->author_email); ?>
<div style="float:left"><img class="show_gravatar" src=<?echo $grav_url;?> width="60" height="60" /></div>
And I had to append some code to the css-file:
/* Gravatar style */
img.show_gravatar {
margin:7px;
padding:1px;
border:1px solid #CCCCCC;
background-color:white;
}
4 yabba Jan 03, 2009 11:04
it's never the easy answer :P
<?php
if( $Comment->author_ID )
{
$Comment->get_author_User();
$email = $Comment->author_User->get( 'email' );
}
else
{
$email = $Comment->author_email;
}
?>
¥
5 joshua Jan 03, 2009 11:19
Once again thanks for your answer - but it don´t work either. :-(
For registered users it gives back NULL for $email whereas as non-registered users mail-address is shown correctly.
I guess $Comment_>author_ID is NULL in _item_comment.inc.php...
Already tried to substr ( $Comment->author_email(), 7) but it also gives back NULL.
Confused... :-\
Thx again.
Cheers,
Joshua
6 yabba Jan 03, 2009 11:27
Next attempt ;)
if( !empty( $Comment->author_User ) )
{
$email = $Comment->author_User->get( 'email' );
}
else
{
$email = $Comment->author_email;
}
¥
7 joshua Jan 03, 2009 11:34
Perfect!
This one
if( !empty( $Comment->author_User ) )
{
$email = $Comment->author_User->get( 'email' );
}
else
{
$email = $Comment->author_email;
}
works really fine!
Gravatars are now displayed for all -registered and non-registered- users, below ist how the _item_comment.inc.php looks now:
<?php $Comment->rating();
if( !empty( $Comment->author_User ) )
{
$email = $Comment->author_User->get( 'email' );
}
else
{
$email = $Comment->author_email;
}
$grav_url = "http://www.gravatar.com/avatar.php?gravatar_id=".md5($email); ?>
<div style="float:left"><img class="show_gravatar" src=<?echo $grav_url;?> width="60" height="60" /></div>
<div class="bCommentText">
<?php $Comment->content() ?>
</div>
Thanks so much ¥åßßå!!!
Cheers,
Joshua
off the top of my head :
¥