diff --git a/application/modules/blog/controllers/ArchiveController.php b/application/modules/blog/controllers/ArchiveController.php index 9391816..ad2aa5f 100644 --- a/application/modules/blog/controllers/ArchiveController.php +++ b/application/modules/blog/controllers/ArchiveController.php @@ -4,7 +4,8 @@ class Blog_ArchiveController extends Fiktiv_Controller_Action { public function indexAction() { - $this->view->postsByMonthYear = $this->dataService->BlogPost->findByMonth(); + $blogposts = new ModelBlogPost(); + $this->view->postsByMonthYear = $blogposts->findByMonth(); } public function filterAction() @@ -12,15 +13,16 @@ class Blog_ArchiveController extends Fiktiv_Controller_Action $params = $this->_getAllParams(); + $blogposts = new ModelBlogPost(); + if (array_key_exists('date', $params)) { - $this->view->posts = $this->dataService->BlogPost->findByDate($params['date']); + $this->view->posts = $blogposts->findByDate($params['date'], '%Y-%MM'); } else if (array_key_exists('tag', $params)) { - $this->view->posts = $this->dataService->BlogPost->findByTag($params['tag']); + $this->view->posts = $blogposts->findByTag($params['tag']); } - } } \ No newline at end of file diff --git a/application/modules/blog/controllers/IndexController.php b/application/modules/blog/controllers/IndexController.php index 4fd063f..016a211 100644 --- a/application/modules/blog/controllers/IndexController.php +++ b/application/modules/blog/controllers/IndexController.php @@ -10,7 +10,8 @@ class Blog_IndexController extends Fiktiv_Controller_Action public function latestAction() { // Fetch last ten posts - $this->view->posts = $this->dataService->BlogPost->findAll(10); + $posts = new ModelBlogPost(); + $this->view->posts = $posts->fetchAll(null, 'pubDate DESC', 10); } public function readableAction() @@ -20,7 +21,8 @@ class Blog_IndexController extends Fiktiv_Controller_Action public function readAction() { - $this->view->post = $this->dataService->BlogPost->findByPermalink($this->_getParam('id', null)); + $posts = new ModelBlogPost(); + $this->view->post = $posts->findByPermlink($this->_getParam('id', null)); if (!$this->view->post) $this->_redirect(array('action' => 'latest')); diff --git a/application/modules/blog/views/scripts/archive/filter.phtml b/application/modules/blog/views/scripts/archive/filter.phtml index 38844f6..540d4f9 100644 --- a/application/modules/blog/views/scripts/archive/filter.phtml +++ b/application/modules/blog/views/scripts/archive/filter.phtml @@ -1,29 +1,28 @@ -« =$this->translate('u:back') ?> +« =$this->translate('u:back') ?> posts as $post) : ?>
=$post->getPubDate()->toString('yyyy-MM-dd').' '.$this->translate('TIME_AT').' '.$post->getPubDate()->toString('HH:mm').' '.$post->getAuthor()->getFirstName() ?>
+=$post->getPubDate()->toString('yyyy-MM-dd').' '.$this->translate('TIME_AT').' '.$post->getPubDate()->toString('HH:mm').' '.$post->getAuthor()->firstName ?>
=$this->translate('BLOG_LATEST_INTRO') ?>
+setHighlighter('geshi'); +?> + + posts as $post) : ?>=$post->getPubDate()->toString('yyyy-MM-dd').' '.$this->translate('TIME_AT').' '.$post->getPubDate()->toString('HH:mm').' '.$post->getAuthor()->getFirstName() ?>
+=$post->getPubDate()->toString('yyyy-MM-dd').' '.$this->translate('TIME_AT').' '.$post->getPubDate()->toString('HH:mm').' '.$post->getAuthor()->firstName ?>
=$this->post->getPubDate()->toString('yyyy-MM-dd').' '.$this->translate('TIME_AT').' '.$this->post->getPubDate()->toString('HH:mm').' '.$this->post->getAuthor()->getFirstName() ?>
-=$this->post->getPubDate()->toString('yyyy-MM-dd').' '.$this->translate('TIME_AT').' '.$this->post->getPubDate()->toString('HH:mm').' '.$this->translate('by').' '.$this->post->getAuthor()->firstName ?>
+