• Im trying to incorporate the gravatar code in other areas of my site and seem to be havin a bit of trouble getting it to show up…. at the moment i’m trying to add it to the get-commenters code by coffee2code and after alot of attempts the closest I can come is getting no php errors but its printing out the last bits of the img src
    bruce" alt="" /> (2)

    when using the gravatar code as such :

    foreach ($commenters as $commenter) {
    echo $before;
    if (!empty($commenter->comment_author_url)) echo '<a title="Visit ' . $commenter->comment_author . ''s site" href="' . $commenter->comment_author_url . '"';
    if ($open_in_new_window) echo ' target="_blank"';
    if (!empty($commenter->comment_author_url)) echo '>';
    echo $commenter->comment_author;
    if (!empty($commenter->comment_author_url)) echo '</a>';
    if (!empty($commenter->comment_author_url)) echo '<img src= "<?php gravatar("G", 50, "http://mysite.com/graphics/grav.gif"); ?>" alt="" />';
    if ('top' == $type) echo ' (' . $commenter->total_comments . ')';
    if (!$omit_last_after) echo $after;
    echo "n";
    }

    anyone spot what Im doin wrong?

Viewing 8 replies - 16 through 23 (of 23 total)
  • Thread Starter lokjah

    (@lokjah)

    yeah 🙂 im doin that…. thanks for all the help man let me try what you just suggested….

    i think ultimately I would like to be able to impliment the gravatar independent from this plugin, just be able to show a gravatar where ever commenter info may be, eg, in a sidebar etc…

    Thread Starter lokjah

    (@lokjah)

    ok removed the if block, but still willy nillyâ„¢ on the grav display…

    Slaps forehead!!

    I just looked at the plugin and it’s using the global variable $comment. This is the reason for your sporadic results. You could rename every occurrence of $commenter in your plugin with $comment and that should do the trick.

    I need to get away from the computer…lines are starting to blur. 😉

    lokjah,
    I emailed you custom version of the plugin that you can use anywhere, by passing the function an email address.

    Thread Starter lokjah

    (@lokjah)

    u rock… do the dew!

    well we are getting somewhere now…. the other commenters gravs are showing correctly in addition to mine, however now we arent getting the default to show up…

    Thread Starter lokjah

    (@lokjah)

    woot.. fixed that….just had the wrong file path this time….

    thanks again dew!

    🙂

    MtDewVirus. Can you post the cleaned up coding here? This goes in the usercomments php right?

Viewing 8 replies - 16 through 23 (of 23 total)

The topic ‘using gravatar code elsewhere’ is closed to new replies.