Favicon and Gravatar in MT4

Two of my favourite Movable Type plugins from versions prior to MT4 are Favicon and Gravatar. Both these plugins work fine in MT4 and it’s only a matter of knowing where to put them in the template modules.

Favicon is a plugin for Movable Type that adds favicons to comments and trackbacks.

Favicon for comments and trackbacks

Download and install the plugin as per the instructions on the download page. Follow the directions there for installing into MT versions prior to 4.0. The following instructions only apply to Movable Type 4.

Go to the Movable Type dashboard in your browser, Design > Templates > and click on Template Modules. Open the Comment Detail module.

Place the following code right before the <$MTCommentAuthorLink default_name="Anonymous" show_email="0"$> tag and save the changes.

<MTFaviconCommentIfAvailable>
<$MTFaviconComment full="1"$>
</MTFaviconCommentIfAvailable>

Open the Trackbacks Module and copy the following code to the footer section, placing it just before the words “Tracked on….”. Save your changes.

<MTFaviconTrackbackIfAvailable>
<$MTFaviconTrackback full="1"$>
</MTFaviconTrackbackIfAvailable>

Rebuild your entry pages to see the favicons in action.

GravatarA gravatar is a globally recognized avatar, that can be a picture of yourself or anything you like that is linked to an email address. When you leave a comment on a site that has gravatars enabled, a picture appears next to your comment. Three different versions are available for Movable Type, depending on how your blog is set up or how you want to install it. I have the MovableType CommentBodyPlusGravatar Plugin installed. When used inside the MTComments tag as a replacement for MTCommentBody, outputs the comment body and inserts the gravatar image code inside the opening <p> tag. This is important if you want to use CSS to float the image so that text will wrap around it.

Download and install the plugin, and follow the instructions for the version you’ve chosen. Open the Comment Detail module and insert the tag inside the comment content section. Here’s an example of how mine looks.


        <div class="comment-content">
            <div class="comment-content-inner">
                    <$MTCommentBodyPlusGravatar class="floatimgright" size="40" rating="G" default="http://yoursite.com/blog/images/gravatar.gif"$>
                    <br style="clear: both" />
            </div>
        </div>

Use <br style="clear: both" /> to push the next comment down so they don’t pile up on top of each other or overlap. Don’t forget to rebuild your site to see the changes.

1 TrackBack

Plaatje van reageerder Weer wat van mijnn lijstje af. Mooi! En weer veel geleerd. Ik wilde bij de reacties een klein plaatje hebben van degene die reaggerde als dat voorhanden is. Zo heb ik nu gravatar met een userpic gecombineer. De blog zoekt dus eer... Read More

13 Comments

Why is that when I do it and I follow your instructions, it messes up and the sidebars are gone, and the footer is screwed up?


Toni

You need to add a class to your stylesheet called floatimgright

.floatimgright {
float:right;
margin-top:10px;
margin-left:10px;
margin-bottom:10px;
border: 1px solid #ddddd9;
padding: 3px;
}

Adding the style might help.

Disregard my last reply... I finally found out how to do it! But the comment box (the speech bubble) seems to be a little cut off on the sides. Is there a way to fix that?


Toni

How about a link to your site? If I can see what the problem is I might be able to fix it for you.

I've posted the link in the URL field. I took off the Gravatar code, so I'll just have to rebuild the site and you'll be able to see it. Thanks for your time Toni!


Toni

Sorry Michael, The code for adding a gravatar was wrong. I had the br following the div when it should have been before. I wrote this post before updating to the Mid-Century template set, but the correct code is there now. I hope you get it working.

Gravatar 1.4 doesn‘t work on my VPS.

My server does not have these modules installed:

Archive::Zip GD; Archive::Tar; IO::Uncompress::Gunzip; Digest::SHA1; IO::Compress::Gzip; Image::Magick; XML::Atom

-_-||

I don't know what should I do.Can you help me?

Here is my email address: lnzhanglei(at)gmail.com


Toni

You need to contact your server and ask them to install the modules. Otherwise, I suggest you change servers. You don't have a lot of options.

Thank you for your suggestion, I will try.


Thanks for this great tip! I will implement it in my new bloglayout. I tested it on my test blog and it works great. I have combined it with the commentuserpic tag of MT.


Hello Toni,

as you can see the style of the two pictures are different.... Did you do that on purpose or... I also implemented this but would like to have them both styled the same way. Do you know how to do that?


Ha now I see that the style is ok. How did you do that?


Toni

Hi Hans,

I finally figured it out and have left a comment on your site. The code was missing the mtCommentBody code for the first part of the statement. Working great now. I've been thinking about doing it for a while and decided to give your code a go, it looked much easier than the userpic codes I've seen. Thanks.

The css for floatimgright now looks like:

.floatimgright, .avatar { float:right; margin-top:10px; margin-left:10px; margin-bottom:10px; border: 1px solid #ddddd9; padding: 3px; }

Leave a comment



Recent Entries

  • Send Entries Using HTML Formatted Email

    There used to be a plugin for earlier versions of Movable Type called "MT-Mail-Entry":http://www.nonplus.net/software/mt/MT-Mail-Entry.htm that allowed you to send friends a HTML-formatted email that included...

  • All Comments Not Getting Published

    I had a problem viewing some of the comments on one of my posts. I thought it must be a comment limit somewhere in the...

  • MT 4.23 Update Released

    Movable Type has released a security upgrade that fixes XSS vulnerabilities, and recommends updating to 4.23 as a mandatory. The vulnerability hasn't been exploited yet,...

  • Updated Joost Action Streams Plugin

    The plugin for [Joost Action Streams](http://mt4.juneeonline.com/babble-on/archives/2008/10/joost-action-streams-plugin.php) has been updated to include favourites. If you've previously installed this plugin I recommend deleting Joost from "Other Profiles"...

  • Adding the ShareThis Button to Mid-Century

    There's a tutorial on Rob Kenny's The Composing Stick with instructions for adding AddThis or ShareThis buttons to your posts. After receiving a request today,...

OpenID accepted here Learn more about OpenID