Vanilla 1 is no longer supported or maintained. If you need a copy, you can get it here.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.
LastCommentID
Wondering if this is possible - I'm terrible at SqlBuilder.
I'm using the RSS2 add-on but would like to return in the join the most recent comment rather than the first comment. At present the code joins the first comment obviously based on the FirstCommentID field in the Discussion table like this:
How can this be tweaked to join the latest Comment content in that discussion rather than the first? I'm assuming its a sub query but I'm lost.
thanks for any help
I'm using the RSS2 add-on but would like to return in the join the most recent comment rather than the first comment. At present the code joins the first comment obviously based on the FirstCommentID field in the Discussion table like this:
function DiscussionManager_GetFirstCommentForRSS2($DiscussionManager) {
$SqlBuilder = &$DiscussionManager->DelegateParameters['SqlBuilder'];
$SqlBuilder->AddJoin('Comment', 'fc', 'CommentID', 't', 'FirstCommentID', 'left join');
$SqlBuilder->AddSelect(array('FormatType', 'Body'), 'fc');
}
How can this be tweaked to join the latest Comment content in that discussion rather than the first? I'm assuming its a sub query but I'm lost.
thanks for any help
0
Comments
function DiscussionManager_GetFirstCommentForRSS2($DiscussionManager) { $SqlBuilder = &$DiscussionManager->DelegateParameters['SqlBuilder']; $SqlBuilder->AddJoin('Comment', 'lc', 'CommentID', 't', 'LastCommentID', 'left join'); $SqlBuilder->AddSelect(array('FormatType', 'Body'), 'lc'); }
SELECT CommentID FROM `LUM_Comment` WHERE DiscussionID = XXX ORDER BY DateCreated DESC LIMIT 1
not be used to get the LastCommentID and then joined to the Discussion Manager? Mark seems to be referring to a 'LastCommentID' but I don't see that existing anywhere like 'FirstCommentID' exists in the Discussion table...?
Confused.