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
1 changed files with 7 additions and 25 deletions

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'
* @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();
}