WordPress.org

Ready to get started?Download WordPress

Forums

Using Gravatars in Recent Posts (18 posts)

  1. 7seconden
    Member
    Posted 9 years ago #

    I'm using the Recent Comments Plugin (Plugin URI: http://blog.jodies.de/archiv/2004/11/13/recent-comments/) and I'd like to integrate gravatars that link to the commenters website (if any). Is this possible ? Can anybody help ?

  2. Kafkaesqui

    Posted 9 years ago #

  3. 7seconden
    Member
    Posted 9 years ago #

    I guess my question wasn't clear enough: I'd like to integrate gravatars in the recent-comments-plugin.

  4. Cypher
    Member
    Posted 9 years ago #

    If you have the "gravatar" plugin installed you should be able to use the gravatar tag from within the recent-comments plugin.

    Regards

  5. 7seconden
    Member
    Posted 9 years ago #

    Cypher,
    I'm not quite sure how. Do you know how to do this ?

  6. Cypher
    Member
    Posted 9 years ago #

    7seconden,
    In your recent-comments plugin, you should have the variable $comment within the FOREACH loop. At that point in time, you should als have access ot the commenter's email access by way of $comment->comment_author_email.

    You can then take that call Gravatar's website directly with:

    $out = "http://www.gravatar.com/avatar.php?gravatar_id=".md5($comment->comment_author_email);
    echo $out;

    This should get you the gravatar. Give it a shot and lemme know if you need any help debugging it.

    Regards

  7. 7seconden
    Member
    Posted 9 years ago #

    Cypher,

    First of all, I'd like to say I'm a PHP-newbie, and therefor not quite sure were to put the code you suggested. Second of all, I'd like to influence the size of the gravatar (10x10) . If that's not possible, the suggested solution isn't worth implementing.

  8. chiensavant
    Member
    Posted 9 years ago #

    @7seconden : you could at least READ the links that Cypher provided. Your second question is specifically covered : http://www.gravatar.com/implement.php#section_2_2

    Usage: gravatar has the following syntax:

    <?php gravatar({rating{, size{, default{, border}}}}) ?>

    All of the parameters are optional. For example, the following will create a gravatar URL that allows all rating levels, is 80×80 pixels, uses no default image, and has no border:

    As for your first question, Cypher did answer to it in his last message. What is it that you don't understand ? The procedure is quite clear, but let me make it even clearer :

    1. Open your recent-comment.php file. I'm not sure this file exists, it's author website is down so I don't have access to the file. Anyway, open every file you lately uploaded to your server to activate the recent-comment function, until you...
    2. Locate this function : $comment->comment_author_email, then...
    3. Proceed pretty much the same way you did with wp-comment.php (that works already well on your website).

    And then that should work.

  9. Penda
    Member
    Posted 9 years ago #

    This is the thing - the procedure is not clear.

    Pointing people to the Gravatar Website for instructions is pointless, since it doesn't tell us WHERE to put the code.

    Specific instructions on where to put the code and in what files shouldn't be that difficult to find, and yet - here I am.

    I don't know what the "Comment Loop" is or where to find it, but that's okay - I'll just figure it out and when I do, I'll post clearer instructions so new people don't have the same hard time I did.

    Thanks anyway.

  10. 7seconden
    Member
    Posted 9 years ago #

    @Penda: I hope you can figure it out. I've allready bookmarked this topic.

  11. damon
    Member
    Posted 9 years ago #

    I started this but gave up, my php skills are lacking. But this works somewhat, maybe someone could clean the code up and fix it. It's the myhacks.php version of recent comments and some code christjdavis gave me combined.

    I'm not sure how to limit the amount of text shown for each comment, but other than that I think it woks. Add it to myhacks.php

    http://scottdot.org/recent_comments_gravatar.txt

  12. Jinsan
    Member
    Posted 9 years ago #

    I've only recently regged with a gravatar and though I haven't implemented it into my site, the clarity of the instructions are pretty lacking. I've seen many people post the link to the instructions of how to install it - however, it lacks instructions on WHERE to install it.

    There have been several posts like this, and I think it's something that perhaps requires a touch more explaination and less berating.

    the instructions are:

    A plugin is available for WordPress 1.2 installations. The plugin makes available a tag called gravatar that, when used inside the Comment Loop, outputs the correct gravatar URL based on the commenters email address.

    Well, now call me stupid but if a user with no understanding of the comment loop is given that he can only assume it's within the comments.php file - where exactly? Who knows? Clear instructions are better than several posts asking the same question, and several replies sending them back to the link on the gravatar site. That would be called the reply loop would it?

    This is the Textpattern instruction:

    Installation: Find and open the file at <TextPattern Install Dir>/publish/comment.php. Scroll down to line 126. You want to enter the line below that is in bold

    Now THAT is clear - it tells you where to past the info SPECIFICALLY. The only time questions would arise is if they get an error due to some other factor, in which you couldn't blame the instructions. With WP it's a different matter, and quite the opposite.

  13. damon
    Member
    Posted 9 years ago #

    This is more of a how to add gravatar to "Recent comments" plugin, that usually shows in the sidebar of the main page, listing maybe 5 of the newest comments.

  14. 7seconden
    Member
    Posted 9 years ago #

    @ Damon: Correct! The original question was how to implement gravatars in the recent comments plugin. Not how to install it! I want this plugin to use the gravatar functions. Can anybody help?

  15. damon
    Member
    Posted 9 years ago #

    7seconden a couple posts above i posted a link to myhacks.php that adds gravatars to recent comments.ust drop it into your blog root and make sure "use myhacks" is enabled in your admin, then add the include to your sidebar or wherever you want them to appear.

    thng is, it needs work. thats why i posted it, i cant do anymoe with it.

    btw, the top of this is adding gravatars to recent posts, not recent comments :p

  16. 7milesdown
    Member
    Posted 9 years ago #

    I've seen this working great at

    http://www.chrisjdavis.org/

    on the sidebar. Maybe he can shed some light on this. I would like this feature as well.

  17. shawng77
    Member
    Posted 9 years ago #

    7milesdown: The reason you are seeing that working at Chris J. Davis' site is because he wrote that plug-in himself for his site. He may be doing a version to release to the public, but there is no official word on this.

  18. LaBella
    Member
    Posted 8 years ago #

    this is exactly what I'm looking for too!
    It's used at http://girlspoke.com/

    I would like to set up my comments like this too but I don't know how either.

    :-(

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.