Info
- 10 posts
- 4 voices
- Started 2 years ago by grassrootspa
- Latest reply from anandasama
- This topic is resolved
Hyperlink "Last Poster" from Latest Discussions to THEIR Profile Page
-
- Posted 2 years ago #
Hey fellow bbPress enthusiasts,
I have just spent forever playing with PHP trying to get the name generated by "Last Poster" in Latest Discussions on Forum or Front-Page to link to THAT user's bbPress profile.
My apologies if I am missing an easy "<a href=" command to surround the php in:
<td class="num"><?php topic_last_poster(); ?></td>Nothing seems to work.
Many thanks as my brain has been fried working on this.
-
- Posted 2 years ago #
Maybe this will work:
<a href='<?php bb_uri(); ?>/profile/<?php topic_last_poster(); ?>"><?php topic_last_poster(); ?></a>Not 100% sure it would work since <?php topic_last_poster(); ?> grabs the display name, not the user name I think. Well there's a start.
-
- Posted 2 years ago #
Hmm, this doesn't seem to work. Anyone else have any ideas?
-
- Posted 2 years ago #
function gs_get_topic_last_poster_profile_link() { global $topic; if ($topic) return sprintf('<a href="%s">%s</a>', get_user_profile_link($topic->topic_last_poster), get_topic_last_poster($topic->topic_id)); return false; } -
- Posted 2 years ago #
Thanks for your help, Detective. How would I implement your code with:
<td class="num"><?php topic_last_poster(); ?></td>Which is in Forum.php and Front-Page.php
-
- Posted 2 years ago #
<td class="num"> <?php function gs_get_topic_last_poster_profile_link() { global $topic; if ($topic) return sprintf('<a href="%s">%s</a>', get_user_profile_link($topic->topic_last_poster), get_topic_last_poster($topic->topic_id)); return false; } ?> </td> -
- Posted 2 years ago #
Not sure if its just me but there creates an error.
-
- Posted 2 years ago #
I posted this elsewhere but this works for me on the frontpage:
<a href="<?php user_profile_link($topic->topic_last_poster) ?>" ><?php topic_last_poster(); ?></a> -
- Posted 2 years ago #
anandasama, you are my hero! Thanks...this one works!!!
-
- Posted 2 years ago #
nice to be able to help. Got any other question (like thread maker profile link) then I know the code for that too.
You should flag this topic as resolved.
-
You must log in to post.