From bda7fd1cd7a9ca7be84767109216cdbb7a996169 Mon Sep 17 00:00:00 2001 From: Andrew O'Neil Date: Tue, 2 Dec 2008 02:58:14 +0000 Subject: [PATCH] Reverted changes that shouldnt be in core --- code/BlogHolder.php | 32 +++++++------------------------- 1 file changed, 7 insertions(+), 25 deletions(-) diff --git a/code/BlogHolder.php b/code/BlogHolder.php index 4ad88ca..837a46a 100644 --- a/code/BlogHolder.php +++ b/code/BlogHolder.php @@ -67,10 +67,9 @@ class BlogHolder extends Page { * @param string date Only get blog entries on this date - either a year, or a year-month eg '2008' or '2008-02' * @return DataObjectSet */ - public function Entries($limit = '', $tag = '', $date = '', $author = '') { + public function Entries($limit = '', $tag = '', $date = '') { $tagCheck = ''; $dateCheck = ''; - $authorCheck = ''; if($tag) { $SQL_tag = Convert::raw2sql($tag); @@ -93,11 +92,7 @@ class BlogHolder extends Page { } } - if($author) { - $authorCheck = "AND Author = '{$author}'"; - } - - return DataObject::get("Page","`ParentID` = $this->ID AND ShowInMenus = 1 $authorCheck $tagCheck $dateCheck","`BlogEntry`.Date DESC",'',"$limit"); + return DataObject::get("Page","`ParentID` = $this->ID AND ShowInMenus = 1 $tagCheck $dateCheck","`BlogEntry`.Date DESC",'',"$limit"); } /** @@ -233,7 +228,6 @@ class BlogHolder_Controller extends Page_Controller { } function BlogEntries($limit = 10) { - $author = isset($_GET['author']) ? $_GET['author'] : ''; $start = isset($_GET['start']) ? (int) $_GET['start'] : 0; $tag = ''; $date = ''; @@ -253,7 +247,7 @@ class BlogHolder_Controller extends Page_Controller { } } - return $this->Entries("$start,$limit", $tag, $date, $author); + return $this->Entries("$start,$limit", $tag, $date); } /** @@ -292,25 +286,13 @@ class BlogHolder_Controller extends Page_Controller { */ function rss() { global $project; - $limit=10; - $authorCheck = ''; - - $author = isset($_GET['author']) ? $_GET['author'] : ''; + $blogName = $this->Name; - $altBlogName = "$this->Title » SilverStripe.com"; - - if($author) { - $authorCheck = "AND Author = '{$author}'"; - } - - $children = DataObject::get("Page","`ParentID` = $this->ID AND ShowInMenus = 1 $authorCheck","`BlogEntry`.Date DESC",'', "$limit"); - - if($author AND $children) { - $altBlogName = ucwords($author) . "'s blog » SilverStripe.com"; - } + $altBlogName = $project . ' blog'; + $children = $this->Children(); + $children->sort('Date', 'DESC'); $rss = new RSSFeed($children, $this->Link(), ($blogName ? $blogName : $altBlogName), "", "Title", "ParsedContent"); - $rss->outputToBrowser(); }