@@ -47,9 +47,9 @@ discard block |
||
47 | 47 | $this->set_keywords($this->get_post_keywords()); |
48 | 48 | $this->set_author(self::$AUTHOR); |
49 | 49 | |
50 | - $photo = Content::instance('FetchFirstPhoto', $this->post->body)->activate(true); |
|
51 | - $photo = preg_match('/^<img src="([a-z-:\.\/]+)" [^>]+>$/', $photo, $matches); |
|
52 | - $this->set_head('thumbnail', $matches[1]); |
|
50 | + $photo = Content::instance('FetchFirstPhoto', $this->post->body)->activate(true); |
|
51 | + $photo = preg_match('/^<img src="([a-z-:\.\/]+)" [^>]+>$/', $photo, $matches); |
|
52 | + $this->set_head('thumbnail', $matches[1]); |
|
53 | 53 | |
54 | 54 | if (array_key_exists($this->post->id, self::$DEPRECATED_BLOGS)) { |
55 | 55 | $log_id = self::$DEPRECATED_BLOGS[$this->post->id]; |
@@ -123,13 +123,13 @@ discard block |
||
123 | 123 | |
124 | 124 | $post = new stdclass(); |
125 | 125 | |
126 | - if (strpos($post_row['title'], 'Rainy Supe Loop') === 0) { |
|
127 | - $title = $post_row['title']; |
|
128 | - $title = explode(':', $title); |
|
129 | - $title = array_pop($title); |
|
130 | - $title = trim($title); |
|
131 | - $post->title = $title; |
|
132 | - } else if (strpos($post_row['title'], 'Isle Royale') === 0) { |
|
126 | + if (strpos($post_row['title'], 'Rainy Supe Loop') === 0) { |
|
127 | + $title = $post_row['title']; |
|
128 | + $title = explode(':', $title); |
|
129 | + $title = array_pop($title); |
|
130 | + $title = trim($title); |
|
131 | + $post->title = $title; |
|
132 | + } else if (strpos($post_row['title'], 'Isle Royale') === 0) { |
|
133 | 133 | $title = $post_row['title']; |
134 | 134 | $title = explode(',', $title); |
135 | 135 | $title = array_pop($title); |
@@ -160,12 +160,12 @@ discard block |
||
160 | 160 | private $series_posts; |
161 | 161 | private function fetch_series_posts() |
162 | 162 | { |
163 | - if(!isset($this->series_posts)) { |
|
164 | - global $container; |
|
165 | - $repository = new Jacobemerick\Web\Domain\Blog\Series\MysqlSeriesRepository($container['db_connection_locator']); |
|
166 | - $this->series_posts = $repository->getSeriesForPost($this->post->id); |
|
167 | - } |
|
168 | - return $this->series_posts; |
|
163 | + if(!isset($this->series_posts)) { |
|
164 | + global $container; |
|
165 | + $repository = new Jacobemerick\Web\Domain\Blog\Series\MysqlSeriesRepository($container['db_connection_locator']); |
|
166 | + $this->series_posts = $repository->getSeriesForPost($this->post->id); |
|
167 | + } |
|
168 | + return $this->series_posts; |
|
169 | 169 | } |
170 | 170 | |
171 | 171 | private function get_related_posts() |
@@ -26,7 +26,7 @@ discard block |
||
26 | 26 | parent::__construct(); |
27 | 27 | |
28 | 28 | $this->post = PostCollector::getPostByURI(URLDecode::getPiece(2)); |
29 | - if($this->post == null) |
|
29 | + if ($this->post == null) |
|
30 | 30 | $this->eject(); |
31 | 31 | |
32 | 32 | $this->handle_comment_submit( |
@@ -92,7 +92,7 @@ discard block |
||
92 | 92 | $keyword_array = array(); |
93 | 93 | $keywords = $this->tags; |
94 | 94 | |
95 | - foreach($keywords as $keyword) |
|
95 | + foreach ($keywords as $keyword) |
|
96 | 96 | { |
97 | 97 | $keyword_array[] = $keyword->tag; |
98 | 98 | } |
@@ -106,16 +106,16 @@ discard block |
||
106 | 106 | private function get_series_posts() |
107 | 107 | { |
108 | 108 | $series_posts = $this->fetch_series_posts(); |
109 | - if(count($series_posts) < 1) |
|
109 | + if (count($series_posts) < 1) |
|
110 | 110 | return array(); |
111 | 111 | |
112 | 112 | $previous_post = new stdclass(); |
113 | 113 | $next_post = new stdclass(); |
114 | 114 | |
115 | 115 | $found_current_post = false; |
116 | - foreach($series_posts as $post_row) |
|
116 | + foreach ($series_posts as $post_row) |
|
117 | 117 | { |
118 | - if($post_row['post'] == $this->post->id) |
|
118 | + if ($post_row['post'] == $this->post->id) |
|
119 | 119 | { |
120 | 120 | $found_current_post = true; |
121 | 121 | continue; |
@@ -141,7 +141,7 @@ discard block |
||
141 | 141 | |
142 | 142 | $post->url = Loader::getRootUrl('blog') . "{$post_row['category']}/{$post_row['path']}/"; |
143 | 143 | |
144 | - if(!$found_current_post) |
|
144 | + if (!$found_current_post) |
|
145 | 145 | $previous_post = $post; |
146 | 146 | else |
147 | 147 | { |
@@ -160,7 +160,7 @@ discard block |
||
160 | 160 | private $series_posts; |
161 | 161 | private function fetch_series_posts() |
162 | 162 | { |
163 | - if(!isset($this->series_posts)) { |
|
163 | + if (!isset($this->series_posts)) { |
|
164 | 164 | global $container; |
165 | 165 | $repository = new Jacobemerick\Web\Domain\Blog\Series\MysqlSeriesRepository($container['db_connection_locator']); |
166 | 166 | $this->series_posts = $repository->getSeriesForPost($this->post->id); |
@@ -171,14 +171,14 @@ discard block |
||
171 | 171 | private function get_related_posts() |
172 | 172 | { |
173 | 173 | $tag_array = array(); |
174 | - foreach($this->tags as $tag) |
|
174 | + foreach ($this->tags as $tag) |
|
175 | 175 | { |
176 | 176 | $tag_array[] = $tag->id; |
177 | 177 | } |
178 | 178 | |
179 | 179 | $series_posts = $this->fetch_series_posts(); |
180 | 180 | $exclude_post_array = array(); |
181 | - foreach($series_posts as $series_post) |
|
181 | + foreach ($series_posts as $series_post) |
|
182 | 182 | { |
183 | 183 | $exclude_post_array[] = $series_post->post; |
184 | 184 | } |
@@ -186,7 +186,7 @@ discard block |
||
186 | 186 | $post_array = array(); |
187 | 187 | $post_result = PostCollector::getRelatedPosts($this->post->id, $tag_array, $exclude_post_array); |
188 | 188 | |
189 | - foreach($post_result as $post_row) |
|
189 | + foreach ($post_result as $post_row) |
|
190 | 190 | { |
191 | 191 | $post = new stdclass(); |
192 | 192 | $post->title = $post_row->title; |
@@ -26,8 +26,9 @@ discard block |
||
26 | 26 | parent::__construct(); |
27 | 27 | |
28 | 28 | $this->post = PostCollector::getPostByURI(URLDecode::getPiece(2)); |
29 | - if($this->post == null) |
|
30 | - $this->eject(); |
|
29 | + if($this->post == null) { |
|
30 | + $this->eject(); |
|
31 | + } |
|
31 | 32 | |
32 | 33 | $this->handle_comment_submit( |
33 | 34 | self::$BLOG_SITE_ID, |
@@ -106,8 +107,9 @@ discard block |
||
106 | 107 | private function get_series_posts() |
107 | 108 | { |
108 | 109 | $series_posts = $this->fetch_series_posts(); |
109 | - if(count($series_posts) < 1) |
|
110 | - return array(); |
|
110 | + if(count($series_posts) < 1) { |
|
111 | + return array(); |
|
112 | + } |
|
111 | 113 | |
112 | 114 | $previous_post = new stdclass(); |
113 | 115 | $next_post = new stdclass(); |
@@ -141,9 +143,9 @@ discard block |
||
141 | 143 | |
142 | 144 | $post->url = Loader::getRootUrl('blog') . "{$post_row['category']}/{$post_row['path']}/"; |
143 | 145 | |
144 | - if(!$found_current_post) |
|
145 | - $previous_post = $post; |
|
146 | - else |
|
146 | + if(!$found_current_post) { |
|
147 | + $previous_post = $post; |
|
148 | + } else |
|
147 | 149 | { |
148 | 150 | $next_post = $post; |
149 | 151 | break; |