@@ -23,9 +23,9 @@ discard block |
||
| 23 | 23 | { |
| 24 | 24 | parent::__construct(); |
| 25 | 25 | |
| 26 | - global $container; |
|
| 27 | - $repository = new Jacobemerick\Web\Domain\Blog\Post\MysqlPostRepository($container['db_connection_locator']); |
|
| 28 | - $this->post = $repository->findPostByPath(URLDecode::getPiece(2)); |
|
| 26 | + global $container; |
|
| 27 | + $repository = new Jacobemerick\Web\Domain\Blog\Post\MysqlPostRepository($container['db_connection_locator']); |
|
| 28 | + $this->post = $repository->findPostByPath(URLDecode::getPiece(2)); |
|
| 29 | 29 | |
| 30 | 30 | if($this->post == null) |
| 31 | 31 | $this->eject(); |
@@ -36,9 +36,9 @@ discard block |
||
| 36 | 36 | Loader::getRootUrl('blog') . $this->post['category'] . '/' . $this->post['path'] . '/', |
| 37 | 37 | $this->post['title']); |
| 38 | 38 | |
| 39 | - global $container; |
|
| 40 | - $repository = new Jacobemerick\Web\Domain\Blog\Tag\MysqlTagRepository($container['db_connection_locator']); |
|
| 41 | - $this->tags = $repository->getTagsForPost($this->post['id']); |
|
| 39 | + global $container; |
|
| 40 | + $repository = new Jacobemerick\Web\Domain\Blog\Tag\MysqlTagRepository($container['db_connection_locator']); |
|
| 41 | + $this->tags = $repository->getTagsForPost($this->post['id']); |
|
| 42 | 42 | } |
| 43 | 43 | |
| 44 | 44 | protected function set_head_data() |
@@ -50,9 +50,9 @@ discard block |
||
| 50 | 50 | $this->set_keywords($this->get_post_keywords()); |
| 51 | 51 | $this->set_author(self::$AUTHOR); |
| 52 | 52 | |
| 53 | - $photo = Content::instance('FetchFirstPhoto', $this->post['body'])->activate(true); |
|
| 54 | - $photo = preg_match('/^<img src="([a-z-:\.\/]+)" [^>]+>$/', $photo, $matches); |
|
| 55 | - $this->set_head('thumbnail', $matches[1]); |
|
| 53 | + $photo = Content::instance('FetchFirstPhoto', $this->post['body'])->activate(true); |
|
| 54 | + $photo = preg_match('/^<img src="([a-z-:\.\/]+)" [^>]+>$/', $photo, $matches); |
|
| 55 | + $this->set_head('thumbnail', $matches[1]); |
|
| 56 | 56 | |
| 57 | 57 | if (array_key_exists($this->post['id'], self::$DEPRECATED_BLOGS)) { |
| 58 | 58 | $log_id = self::$DEPRECATED_BLOGS[$this->post['id']]; |
@@ -126,16 +126,16 @@ discard block |
||
| 126 | 126 | |
| 127 | 127 | $post = new stdclass(); |
| 128 | 128 | |
| 129 | - if ( |
|
| 130 | - strpos($post_row['title'], 'Rainy Supe Loop') === 0 || |
|
| 131 | - strpos($post_row['title'], 'Malapais Loop') === 0 |
|
| 132 | - ) { |
|
| 133 | - $title = $post_row['title']; |
|
| 134 | - $title = explode(':', $title); |
|
| 135 | - $title = array_pop($title); |
|
| 136 | - $title = trim($title); |
|
| 137 | - $post->title = $title; |
|
| 138 | - } else if (strpos($post_row['title'], 'Isle Royale') === 0) { |
|
| 129 | + if ( |
|
| 130 | + strpos($post_row['title'], 'Rainy Supe Loop') === 0 || |
|
| 131 | + strpos($post_row['title'], 'Malapais Loop') === 0 |
|
| 132 | + ) { |
|
| 133 | + $title = $post_row['title']; |
|
| 134 | + $title = explode(':', $title); |
|
| 135 | + $title = array_pop($title); |
|
| 136 | + $title = trim($title); |
|
| 137 | + $post->title = $title; |
|
| 138 | + } else if (strpos($post_row['title'], 'Isle Royale') === 0) { |
|
| 139 | 139 | $title = $post_row['title']; |
| 140 | 140 | $title = explode(',', $title); |
| 141 | 141 | $title = array_pop($title); |
@@ -166,12 +166,12 @@ discard block |
||
| 166 | 166 | private $series_posts; |
| 167 | 167 | private function fetch_series_posts() |
| 168 | 168 | { |
| 169 | - if(!isset($this->series_posts)) { |
|
| 170 | - global $container; |
|
| 171 | - $repository = new Jacobemerick\Web\Domain\Blog\Series\MysqlSeriesRepository($container['db_connection_locator']); |
|
| 172 | - $this->series_posts = $repository->getSeriesForPost($this->post['id']); |
|
| 173 | - } |
|
| 174 | - return $this->series_posts; |
|
| 169 | + if(!isset($this->series_posts)) { |
|
| 170 | + global $container; |
|
| 171 | + $repository = new Jacobemerick\Web\Domain\Blog\Series\MysqlSeriesRepository($container['db_connection_locator']); |
|
| 172 | + $this->series_posts = $repository->getSeriesForPost($this->post['id']); |
|
| 173 | + } |
|
| 174 | + return $this->series_posts; |
|
| 175 | 175 | } |
| 176 | 176 | |
| 177 | 177 | private function get_related_posts() |
@@ -189,11 +189,11 @@ discard block |
||
| 189 | 189 | $exclude_post_array[] = $series_post['post']; |
| 190 | 190 | } |
| 191 | 191 | |
| 192 | - global $container; |
|
| 193 | - $repository = new Jacobemerick\Web\Domain\Blog\Post\MysqlPostRepository($container['db_connection_locator']); |
|
| 194 | - $post_result = $repository->getActivePostsByRelatedTags($this->post['id']); |
|
| 192 | + global $container; |
|
| 193 | + $repository = new Jacobemerick\Web\Domain\Blog\Post\MysqlPostRepository($container['db_connection_locator']); |
|
| 194 | + $post_result = $repository->getActivePostsByRelatedTags($this->post['id']); |
|
| 195 | 195 | |
| 196 | - $post_array = array(); |
|
| 196 | + $post_array = array(); |
|
| 197 | 197 | |
| 198 | 198 | foreach($post_result as $post_row) |
| 199 | 199 | { |