Recent Topics
Started by on Jan 03, 2009 – Contents updated: Jan 03, 2009

1 Jan 03, 2009 12:20    

Hi @lltogether,

you wanna use gravatars on your site but cannot use the [url=]avatar_plugin[/url]?
[url=]I´ve had the same problem[/url] but now there´s a solution - simply edit your stylesheet und!

[url=]¥åßßå[/url] helped me out and here is how:

Shortly in english:
Append following code to your stylesheet

/* Gravatar style */
img.show_gravatar {
    border:1px solid #CCCCCC;

and edit like that (starting at line 80, after <?php $Comment->rating();)

<?php $Comment->rating();
        if( !empty( $Comment->author_User ) )
            $email = $Comment->author_User->get( 'email' );
            $email = $Comment->author_email;
    $grav_url = "".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() ?>

Be sure to copy to your skins subdir _before_ editing the file!

Have fun!
And once again many thx to ¥åßßå!!!


3 Oct 11, 2009 10:18


Your tip really useful. I made the necessary corrections in my php and css files and now my avatars were working fine. Thanks a bunch for such a nice and useful information.

I slightly increased the width and height of the image by 10 pixels and added a margin of 3px to the image so that it looks pretty cool in all the posts.

Thanks again for the trick!
-Arunprasad.R :D

4 Dec 07, 2009 00:03

I use this hack on b2evolution 2.4.7
It shows gravatar for non-logged user but not for logged-in users.

Do you have any idea ?

7 Dec 08, 2009 18:05

For what it's worth: gravatar support is built in in b2evo v4/CVS. That was contributed by sam2kb if I'm not mistaken.

8 Dec 11, 2009 21:11

I adapted the hack for b2evo 2.4.7 skins glossyblue

Edit the file

Add around line 165

                <!-- ========== START of a COMMENT/TB/PB ========== -->

                <li id="comment-<?php $Comment->ID(); ?>" class="<?php echo $oddcomment; ?>"><?php $Comment->anchor() ?>

                        <? // slamp_091206_begin_gravatar
                                if( $Comment->get_author_User() )
                                { // This comment is from a registered user:
                                        if( empty($Comment->author_User->email) )
                                        { // We have no email for this Author :(
                                                $grav_email = $Comment->author_email;
                                                $grav_title = "Your avatar on";
                                                $grav_email = $Comment->author_User->get('email');
                                                $grav_title = "Avatar of " . $Comment->author_User->get('preferredname');
                                { // This comment is from a visitor:
                                        $grav_email = $Comment->author_email;
                                        $grav_title = "Your avatar on";
                                $grav_url = "".md5($grav_email)."&d=identicon"; 
                        <div style="float:right"><img class="show_gravatar" src=<?php echo $grav_url; ?> width="40" height="40" alt="gravatar" title="<?php echo $grav_title; ?>" /></div>
                        <!--  slamp_091206_end_gravatar -->

                                switch( $Comment->get( 'type' ) ) 

Form is loading...

Run your own website! – This forum is powered by b2evolution CMS, a complete engine for your website.