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.
[Solved] how to show the most recent comment?
Aolee
✭✭
is there a way to show the last or most recent comment of user? instead of the First?
Tagged:
0
Best Answer
-
UnderDog MVP
How to change the bubble css too?
@camo you need to figure out some stuff by yourself too man, Aolee did plenty by showing us guides and making plugins. Try something, if fails, try again, if then fails, you can say your tried (code) and tried (code) and then ask for some help.
Of course you're trying these things at your localhost, right? Good! Turn on the debug SQL queries (search on the forum how to do that) and try + try to figure out which SQL query is executed on your local forum to retrieve those excerpts (CTRL-F will get you somewhere in your firefox browser)
Then post that SQL that's executed and only the SQL you think is relevant.
There was an error rendering this rich post.
0
Answers
not sure if you're up to it as well, but as for me i dont want modify the plugin by doing another round of sql call just to fetch the last comment. so might as well fetch it along during the select to conserve server resource.
check how it looks like here => www.pinoyau.info (scroll down to the non-announcement portion)
if you want i can create a guide how i did it.
Thank you for offering to make a guide (we need to improve guides, tutorials etc anyway). Now I think we have to do something back for you, but I'm trying to figure out what's best.
There was an error rendering this rich post.
Whatever you just explained went way over my head though. Nice job!
@camo bubble effect is a css trick, ill create a guide tom for my version of the last user comment.
http://www.goodoldmemories.com/2011/10/last-comment-in-discussionexcerpt2/
i need to upload the my modified version of discussion excerpt so i thought of creating it in my blog site.
ill soon add it here as well so it will be easily searchable by others.
Fatal Error in Gdn_Database.Query();
Unknown column 'lc.Body' in 'field list'
select d.Type as `Type`, d.InsertUserID as `FirstUserID`, lc.Body as `LastUserComment`, d.DateInserted as `FirstDate`, d.CountBookmarks as `CountBookmarks`, d.Body as `Body`, d.Format as `Format`, d.DateLastComment as `LastDate`, d.LastCommentUserID as `LastUserID`, d.*, w.UserID as `WatchUserID`, w.DateLastViewed as `DateLastViewed`, w.Dismissed as `Dismissed`, w.Bookmarked as `Bookmarked`, w.CountComments as `CountCommentWatch`
from GDN_Discussion d
left join GDN_UserDiscussion w on d.DiscussionID = w.DiscussionID and w.UserID = 13
where d.DiscussionID in ('3', '8')
and coalesce(w.Dismissed, '0') = :coalescewDismissed0
order by d.DateLastComment desc
limit 15
276:
277: if (!is_object($PDOStatement)) {
278: trigger_error(ErrorMessage('PDO Statement failed to prepare', $this->ClassName, 'Query', $this->GetPDOErrorMessage($this->Connection()->errorInfo())), E_USER_ERROR);
279: } else if ($PDOStatement->execute($InputParameters) === FALSE) {
280: trigger_error(ErrorMessage($this->GetPDOErrorMessage($PDOStatement->errorInfo()), $this->ClassName, 'Query', $Sql), E_USER_ERROR);
281: }
282: } else {
283: $PDOStatement = $this->Connection()->query($Sql);
284: }
[Sql] 'select d.Type as `Type`, d.InsertUserID as `FirstUserID`, lc.Body as `LastUserComment`, d.DateInserted as `FirstDate`, d.CountBookmarks as `CountBookmarks`, d.Body as `Body`, d.Format as `Format`, d.DateLastComment as `LastDate`, d.LastCommentUserID as `LastUserID`, d.*, w.UserID as `WatchUserID`, w.DateLastViewed as `DateLastViewed`, w.Dismissed as `Dismissed`, w.Bookmarked as `Bookmarked`, w.CountComments as `CountCommentWatch`
from GDN_Discussion d
left join GDN_UserDiscussion w on d.DiscussionID = w.DiscussionID and w.UserID = 13
where d.DiscussionID in (\'3\', \'8\')
and coalesce(w.Dismissed, \'0\') = :coalescewDismissed0
order by d.DateLastComment desc
limit 15'
[InputParameters] array (
':coalescewDismissed0' => '0',
)
[Options] array (
'ReturnType' => 'DataSet',
)
[ReturnType] 'DataSet'
[PDOStatement] array (
'queryString' => 'select d.Type as `Type`, d.InsertUserID as `FirstUserID`, lc.Body as `LastUserComment`, d.DateInserted as `FirstDate`, d.CountBookmarks as `CountBookmarks`, d.Body as `Body`, d.Format as `Format`, d.DateLastComment as `LastDate`, d.LastCommentUserID as `LastUserID`, d.*, w.UserID as `WatchUserID`, w.DateLastViewed as `DateLastViewed`, w.Dismissed as `Dismissed`, w.Bookmarked as `Bookmarked`, w.CountComments as `CountCommentWatch`
from GDN_Discussion d
left join GDN_UserDiscussion w on d.DiscussionID = w.DiscussionID and w.UserID = 13
where d.DiscussionID in (\'3\', \'8\')
and coalesce(w.Dismissed, \'0\') = :coalescewDismissed0
order by d.DateLastComment desc
limit 15',
)
????
add this code
->Join('Comment lc', 'd.LastCommentID = lc.CommentID', 'left') // Last comment
after the line
->Join('User lcu', 'd.LastCommentUserID = lcu.UserID', 'left') // Last comment user
that's why it's complaining for the field => lc.Body
First time I uploaded your version, speech bubble showed, with background white. I added the buuble css to themes/mytheme/design/css but couldnt make it change???
mine is 2.0.17.8
try moving the
->Select('lc.Body','','LastUserComment')
below
->Select('lcu.Photo', '', 'LastPhoto')
->Select('lc.Body','','LastUserComment')
Ok: This shows excerpt but not last comment or photo still, but atleast no fatal error.
??? Cant change bubble css either
http://nicolasgallagher.com/pure-css-speech-bubbles/demo/
and if you want to copy my css code its in
http://www.pinoyau.info/applications/dashboard/design/style.css
/forum/plugins/Minify/min/?b=forum&token=10fcb15fd759198c57c9c9682b5ee396.css
???? what the?
btw, did you download my version of the discussionexcerpt plugin?
Have yours saved with changes you suggested here
http://vanillaforums.org/discussion/comment/145161#Comment_145161
Now have reverted to original plugin, but want to get the speech bubble happening.
In the plugin default.php < div class=bubble speech etc) is already in place, so if i insert the css in the right place, I should get the bubble yes?
here is link (original plugin current)
http://www.camosreptiles.com.au/forum/
If you want me reinstall your version, I can, Ill just upload my ready altered
class.discussionmodel.php and away we go