Last Comment In DiscussionExcerpt2

NOTE: BACKUP FIRST BEFORE YOU EDIT or OVERWRITE FILES!

1. go to /applications/vanilla/models/class.discussionmodel.php

inside the method public function DiscussionSummaryQuery($AdditionalFields = array()) {
Add the bold one

// Buid main query
   $this->SQL
      ->Select('d.InsertUserID', '', 'FirstUserID')
      ->Select('lc.Body','','LastUserComment')
...
add also 
      ->Join('User lcu', 'd.LastCommentUserID = lcu.UserID', 'left') // Last comment user
      ->Join('Comment lc', 'd.LastCommentID = lc.CommentID', 'left') 

2. Download my version of DiscussionExcerpt here it’s a modified version to display the Last instead of the First post

DiscussionExcerpt2-adrian

3. Extract it in the plugin folder

4. Adding design

you can change the css class name

<div class="bubble speech">

inside the plugin/DiscussionExcerpt2/default.php

then add the css rule in your theme’s main css,

In my case im using the default theme and the css is located at /applications/dashboard/design/styles.css

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.