Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.

Generating link to last page of discussion

50sQuiff50sQuiff ✭✭
edited October 2012 in Vanilla 2.0 - 2.8

I'm trying to get the "Most recent by" text in the Discussions list to actually link to the most recent post of the thread. The code in question is in /applications/vanilla/views/discussions/helper_functions.php:

if ($Discussion->LastCommentID != '') { echo '<span class="LastCommentBy">'.sprintf(T('Last post by %1$s'), UserAnchor($Last)).'</span>'; echo '<span class="LastCommentDate">'.Gdn_Format::Date($Discussion->LastDate).'</span>'; }

Earlier in the function the target URL for the discussion title is generated:

$DiscussionUrl = '/discussion/'.$Discussion->DiscussionID.'/'.Gdn_Format::Url($Discussion->Name).($Discussion->CountCommentWatch > 0 && C('Vanilla.Comments.AutoOffset') && $Session->UserID > 0 ? '/#Item_'.$Discussion->CountCommentWatch : '');

Can someone help me generate a link to the last post in the same fashion, then apply it to LastCommentBy?



  • Options

    echo '<span class="LastCommentBy">' . Anchor("Most Recent by ", $DiscussionUrl, 'Recently') . sprintf(T('%1$s'), UserAnchor($Last)).'</span>';

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

  • Options

    Thanks peregrine

Sign In or Register to comment.