Skip to:
Content
Pages
Categories
Search
Top
Bottom

Show (gr)avatar on frontpage


  • 724719
    Inactive

    Hello,

    does anyone know how to show the gravatars of the Latest and Original poster on the front page, if so what/where would be the parameters for there dimensions of the image.

    I just need to show a 50×50 gravatar of the latest poster on the front page next to the username of the latest poster in the “Latest Poster” column of each topic.

    AND

    A 50×50 gravatar of the original poster and the username of the original poster right next to the link of the topic, on each row.

    Note: http://emptees.com/talk – has a similar thing to what i need, they have the author post avatar on there front page.

    Thanks for any help

Viewing 12 replies - 1 through 12 (of 12 total)

  • 724719
    Inactive

    sorry to *bump* but does any one know how to do this and if it is possible?


    724719
    Inactive

    sorry again, but can anyone just tell me if its possible at all, so’s if it isnt i can just tick it off.

    thanks


    chrishajer
    Participant

    @chrishajer

    I would say yes it’s possible. If you have the id of the latest poster, you should be able to get their gravatar. Same with the original poster. I have no idea how to do it, but it sounds possible.


    _ck_
    Participant

    @_ck_

    Of course you can do it, bbPress can do almost anything – as long as you code it ;-)

    Showing the gravatar is the easy part, the code to fetch the latest poster and their email address is the tricky part. How’s your mysql?

    Showing a gravatar for any email address is as simple as:

    <img src="<?php echo "http://www.gravatar.com/avatar.php?gravatar_id=".md5($user->user_email); ?>" >

    The mysql code for the email of the last poster is going to need a left join of the users table against the post table and more than I am willing to do right now. I suppose I could be lazy and use get_latest_posts(1, 1) to fetch the entire info the last post and grab the email address from there.


    724719
    Inactive

    I have done it look :-

    http://www.picbi.com/

    Ok guys, im loving this bbPress more and more. I hacked the bbPress_Latest_Discussion plugin to get them showing up WITH THE GRAVATARS on my wordpress frontpage.

    If anyone needs this email me, ill tell you how i did it, its a bit too long to post it here.

    Long or short, still you should write about it here so:

    1. People won’t spam your mailbox;

    2. People won’t post another topics like this thing will be here ;).

    I could use something like this for my new project.

    _ck_ said:

    Showing a gravatar for any email address is as simple as:

    <img src=”<?php echo “http://www.gravatar.com/avatar.php?gravatar_id=&#8221;.md5($user->user_email); ?>” >

    The mysql code for the email of the last poster is going to need a left join of the users table against the post table and more than I am willing to do right now. I suppose I could be lazy and use get_latest_posts(1, 1) to fetch the entire info the last post and grab the email address from there.

    does anyone knows?, please.

    i would really like to know how to do this for the first and last poster in a thread. i have tried messing about and developing the above suggestions but i can’t get my queries right. can anyone help? the site above is down so i don’t think i will get a response from the user!


    _ck_
    Participant

    @_ck_

    Showing the gravatar for topic starter and last poster would be something like this (untested)

    Topic started by
    <?php echo "<img src='http://www.gravatar.com/avatar.php?gravatar_id=".md5(bb_get_user_email($topic->topic_poster))."'> $topic->topic_poster_name"; ?>
    Last Poster
    <?php echo "<img src='http://www.gravatar.com/avatar.php?gravatar_id=".md5(bb_get_user_email($topic->topic_last_poster))."'> $topic->topic_last_poster_name"; ?>


    Derek Herman
    Member

    @valendesigns

    // Custom Topic Starter Avatars
    function topic_author_avatar( $size = '48', $default = '', $post_id = 0 ) {
    if ( ! bb_get_option('avatars_show') )
    return false;

    $author_id = get_topic_author();
    if ( $link = get_user_link( $author_id ) ) {
    echo '<a href="' . attribute_escape( $link ) . '">' . bb_get_avatar( $author_id, $size, $default ) . '</a>';
    } else {
    echo bb_get_avatar( $author_id, $size, $default );
    }
    }


    grassrootspa
    Member

    @grassrootspa

    I’m a newbie, so please don’t beat me into a pulp ;)

    So the code above works with BBPress RC2, etc?

    Anyone develop any sort of plugin to do this?

    Hi,

    You don’t need any plugin for doing this, check this topic https://bbpress.org/forums/topic/custom-avatar-function-broken-in-10-rc2

Viewing 12 replies - 1 through 12 (of 12 total)
  • You must be logged in to reply to this topic.
Skip to toolbar