Users running a non-download version of Vanilla (pulled from github), on branch release/2019.016 or master from the last 2 weeks should upgrade to release/2019.017 or latest master for security reasons. Downloaded official open sources releases are not affected.
Please upgrade here. These earlier versions are no longer being updated and have security issues.

How do I get the link to the last post in helper_functions.php?

edited April 2011 in Vanilla 2.0 - 2.8
I'm trying to add a link to the last post on the "Most Recent" text in the main discussion view. By default there's only a link to the profile of the person who posted the last post but nothing to actually go to that post.

After some digging through the files, I figured out that in order to get to that place in the code, I have to duplicate the helper_functions.php, copy it into themes/THEMENAME/views/helper_functions.php and then edit this line:

echo ''.sprintf(T('Most recent by %1$s'), UserAnchor($Last)).'';

Is the link information for the last post already stored somewhere? Does anyone know how to change that line in order to link "Most Recent" to the last post of that discussion?

thanks in advance

Comments

  • edited April 2011
    echo ''.Anchor('Most Recent', '/discussion/comment/'.$Discussion->LastCommentID.'#Comment_'.$Discussion->LastCommentID).' '.sprintf(T(' by %1$s'), UserAnchor($Last)).'';

    This is where I am so far... But this doesn't seem to work for all discussions (especially closed ones or ones without comments)

    EDIT: the problem with discussions without comments only applies to the ones imported from phpbb
Sign In or Register to comment.