Reverted changes that shouldnt be in core

This commit is contained in:
Andrew O'Neil 2008-12-02 02:58:14 +00:00
parent 0ba0c52553
commit bda7fd1cd7

View File

@ -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' * @param string date Only get blog entries on this date - either a year, or a year-month eg '2008' or '2008-02'
* @return DataObjectSet * @return DataObjectSet
*/ */
public function Entries($limit = '', $tag = '', $date = '', $author = '') { public function Entries($limit = '', $tag = '', $date = '') {
$tagCheck = ''; $tagCheck = '';
$dateCheck = ''; $dateCheck = '';
$authorCheck = '';
if($tag) { if($tag) {
$SQL_tag = Convert::raw2sql($tag); $SQL_tag = Convert::raw2sql($tag);
@ -93,11 +92,7 @@ class BlogHolder extends Page {
} }
} }
if($author) { return DataObject::get("Page","`ParentID` = $this->ID AND ShowInMenus = 1 $tagCheck $dateCheck","`BlogEntry`.Date DESC",'',"$limit");
$authorCheck = "AND Author = '{$author}'";
}
return DataObject::get("Page","`ParentID` = $this->ID AND ShowInMenus = 1 $authorCheck $tagCheck $dateCheck","`BlogEntry`.Date DESC",'',"$limit");
} }
/** /**
@ -233,7 +228,6 @@ class BlogHolder_Controller extends Page_Controller {
} }
function BlogEntries($limit = 10) { function BlogEntries($limit = 10) {
$author = isset($_GET['author']) ? $_GET['author'] : '';
$start = isset($_GET['start']) ? (int) $_GET['start'] : 0; $start = isset($_GET['start']) ? (int) $_GET['start'] : 0;
$tag = ''; $tag = '';
$date = ''; $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() { function rss() {
global $project; global $project;
$limit=10;
$authorCheck = '';
$author = isset($_GET['author']) ? $_GET['author'] : '';
$blogName = $this->Name; $blogName = $this->Name;
$altBlogName = "$this->Title » SilverStripe.com"; $altBlogName = $project . ' blog';
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";
}
$children = $this->Children();
$children->sort('Date', 'DESC');
$rss = new RSSFeed($children, $this->Link(), ($blogName ? $blogName : $altBlogName), "", "Title", "ParsedContent"); $rss = new RSSFeed($children, $this->Link(), ($blogName ? $blogName : $altBlogName), "", "Title", "ParsedContent");
$rss->outputToBrowser(); $rss->outputToBrowser();
} }