Vanilla 1.1.5 is a product of Lussumo. More Information: Documentation, Community Support.
Help keep Vanilla free:
// Retrieve properties from current DataRowSet
function GetPropertiesFromDataSet($DataSet, $Configuration) {
$this->DelegateParameters["DataSet"] = &$DataSet;
$this->DelegateParameters["Configuration"] = &$Configuration;
$this->CallDelegate('PreGetPropertiesFromDataSet');
...
$Discussion = $Context->ObjectFactory->NewContextObject($Context, "Discussion");
function Discussion_SetFirstCommentBody(&$Discussion) {
$d = &$Discussion->DelegateParameters['DataSet'];
$Discussion->CommentBody = @$d['CommentBody'];
}
$Context->AddToDelegate("Discussion",
"GetPropertiesFromDataSet",
"Discussion_SetFirstCommentBody");
PreGetDiscussionList(line 231 in Vanilla.Class.DiscussionManager) delegate, and write an
addSelect->LUM_Comment.Bodyinto the extension.
$Configuration['DATABASE_TABLE_PREFIX'] . $DatabaseColumns['Comment'] . '.' . $DatabaseColumns['Comment']['Body']which should evaluate to LUM_Comment.Body
$DiscussionManager = $Context->ObjectFactory->NewContextObject($Context, "DiscussionManager");
function DiscussionManager_GetFirstCommentBody(&$DiscussionManager) {
$s = &$DiscussionManager->DelegateParameters['SqlBuilder'];
//AddJoin($NewTable, $NewTableAlias, $NewTableField, $ExistingAlias, $ExistingField, $JoinMethod, $AdditionalJoinMethods = '')
$s->AddJoin('Comment', 'com', 'CommentID', 't', 'FirstCommentID', 'left join');
$s->AddSelect('Body', 'com', 'CommentBody');
}
$Context->AddToDelegate("DiscussionManager",
"PreGetDiscussionList",
"DiscussionManager_GetFirstCommentBody");
<a href='blah?discussionID=xxx'>Title <div>This is the first x words of the post </div></a>... then we just have to text-decoration: none on the div, and we get a bonus of a larger click area for the blog post...1 to 15 of 15