Info
- 13 posts
- 9 voices
- Started 3 years ago by Anonymous
- Latest reply from Ohna
- This topic is not resolved
Show (gr)avatar on frontpage
-
- Posted 3 years ago #
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 50x50 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 50x50 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
-
- Posted 3 years ago #
sorry to *bump* but does any one know how to do this and if it is possible?
-
- Posted 3 years ago #
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
-
- Posted 3 years ago #
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.
-
- Posted 3 years ago #
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. -
- Posted 3 years ago #
I have done it look :-
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.
-
- Posted 3 years ago #
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.
-
- Posted 3 years ago #
_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.
-
- Posted 3 years ago #
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!
-
- Posted 3 years ago #
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"; ?> -
- Posted 3 years ago #
// 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 ); } } -
- Posted 2 years ago #
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?
-
- Posted 2 years ago #
Hi,
You don't need any plugin for doing this, check this topic http://bbpress.org/forums/topic/custom-avatar-function-broken-in-10-rc2 -
You must log in to post.