YEAH, to find something in Silverstripe forums
is sometimes hard.
Would be fine if there was only ONE result shown for a 'thread' if one post of the thread meets the query. and not any post of the thread, that meets the search criteria...
BTW: if anyone is interested:
I did a replacement of Forum.php function Topics()
with 'the old version' of this function and things are ok for now.
function Topics() {
if(Member::currentUser()==$this->Moderator()) {
return DataObject::get("Post", "ForumID = $this->ID and ParentID = 0 and (Status = 'Moderated' or Status = 'Awaiting')");
}
return DataObject::get("Post", "ForumID = $this->ID and ParentID = 0 and Status = 'Moderated'");
}
the new function
function Topics() {
if(Member::currentUser()==$this->Moderator() && is_numeric($this->ID)) {
$statusFilter = "(`Post`.Status IN ('Moderated', 'Awaiting')";
} else {
$statusFilter = "`Post`.Status = 'Moderated'";
}
if(isset($_GET['start']) && is_numeric($_GET['start'])) $limit = Convert::raw2sql($_GET['start']) . ", 30";
else $limit = 30;
return DataObject::get("Post", "`Post`.ForumID = $this->ID and `Post`.ParentID = 0 and $statusFilter", "max(PostList.Created) DESC",
"INNER JOIN `Post` AS PostList ON PostList.TopicID = `Post`.TopicID", $limit
);
}
seems to be better in showing the latest reply on articles in front of the thread, but it worked without this in former versions.
And maybe someone can do this correct for older my-sql versions in future versions...