Skip to content
Permalink
Browse files

Updates blog to use series repos instead of collectors

  • Loading branch information...
jacobemerick committed Feb 29, 2016
1 parent 2b16eb7 commit 13f20ee2b9902499275a24401c2e5b9c888e104b
Showing with 15 additions and 51 deletions.
  1. +0 −38 collector/blog/SeriesCollector.class.inc.php
  2. +15 −13 controller/blog/PostController.class.inc.php

This file was deleted.

Oops, something went wrong.
@@ -1,7 +1,6 @@
<?
Loader::load('collector', array(
'blog/SeriesCollector',
'blog/TagCollector',
'waterfall/LogCollector'));
Loader::load('controller', 'blog/DefaultPageController');
@@ -116,31 +115,31 @@ private function get_series_posts()
$found_current_post = false;
foreach($series_posts as $post_row)
{
if($post_row->post == $this->post->id)
if($post_row['post'] == $this->post->id)
{
$found_current_post = true;
continue;
}
$post = new stdclass();
if (strpos($post_row->title, 'Rainy Supe Loop') === 0) {
$title = $post_row->title;
if (strpos($post_row['title'], 'Rainy Supe Loop') === 0) {
$title = $post_row['title'];
$title = explode(':', $title);
$title = array_pop($title);
$title = trim($title);
$post->title = $title;
} else if (strpos($post_row->title, 'Isle Royale') === 0) {
$title = $post_row->title;
} else if (strpos($post_row['title'], 'Isle Royale') === 0) {
$title = $post_row['title'];
$title = explode(',', $title);
$title = array_pop($title);
$title = trim($title);
$post->title = $title;
} else {
$post->title = $post_row->title;
$post->title = $post_row['title'];
}
$post->url = Loader::getRootUrl('blog') . "{$post_row->category}/{$post_row->path}/";
$post->url = Loader::getRootUrl('blog') . "{$post_row['category']}/{$post_row['path']}/";
if(!$found_current_post)
$previous_post = $post;
@@ -152,18 +151,21 @@ private function get_series_posts()
}
return array(
'title' => $post_row->series_title,
'description' => Content::instance('FixInternalLink', $post_row->description)->activate(),
'title' => $post_row['series_title'],
'description' => Content::instance('FixInternalLink', $post_row['series_description'])->activate(),
'previous' => $previous_post,
'next' => $next_post);
}
private $series_posts;
private function fetch_series_posts()
{
if(!isset($this->series_posts))
$this->series_posts = SeriesCollector::getSeriesForPost($this->post->id);
return $this->series_posts;
if(!isset($this->series_posts)) {
global $container;
$repository = new Jacobemerick\Web\Domain\Blog\Series\MysqlSeriesRepository($container['db_connection_locator']);
$this->series_posts = $repository->getSeriesForPost($this->post->id);
}
return $this->series_posts;
}
private function get_related_posts()

0 comments on commit 13f20ee

Please sign in to comment.
You can’t perform that action at this time.