Forums

Join
bbPress Support ForumsTroubleshootingHyperlink "Last Poster" from Latest Discussions to THEIR Profile Page

Info

Hyperlink "Last Poster" from Latest Discussions to THEIR Profile Page

  1. 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.

  2. 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.

  3. Hmm, this doesn't seem to work. Anyone else have any ideas?

  4. 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;
    }
  5. 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

  6. <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>
  7. Not sure if its just me but there creates an error.

  8. 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>
  9. anandasama, you are my hero! Thanks...this one works!!!

  10. 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.

  11. You must log in to post.