Generating link to last page of discussion
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?
Regards,
Quiff
Comments
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.
Thanks peregrine