sorry to *bump* but does any one know how to do this and if it is possible?
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
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.
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.
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=”.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!
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"; ?>
// 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 );
}
}
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?