@@ -5,7 +5,7 @@ |
||
5 | 5 | interface PostRepository |
6 | 6 | { |
7 | 7 | public function findPostByPath($category, $path); |
8 | - public function getActivePosts($limit = null, $offset= 0); |
|
8 | + public function getActivePosts($limit = null, $offset = 0); |
|
9 | 9 | public function getActivePostsCount(); |
10 | 10 | public function getActivePostsByTag($tag, $limit = null, $offset = 0); |
11 | 11 | public function getActivePostsCountByTag($tag); |
@@ -45,11 +45,11 @@ discard block |
||
45 | 45 | |
46 | 46 | protected function check_for_special_redirect($uri) |
47 | 47 | { |
48 | - if(preg_match('@^/post_([0-9]{4}-[0-9]{2}-[0-9]{2})_([a-z0-9-]+)(/?)$@', $uri, $matches)) |
|
48 | + if (preg_match('@^/post_([0-9]{4}-[0-9]{2}-[0-9]{2})_([a-z0-9-]+)(/?)$@', $uri, $matches)) |
|
49 | 49 | { |
50 | 50 | Loader::load('collector', 'blog/PostCollector'); |
51 | 51 | $post = PostCollector::getPostByURI($matches[2]); |
52 | - if(!$post) |
|
52 | + if (!$post) |
|
53 | 53 | { |
54 | 54 | Loader::loadNew('controller', '/Error404Controller') |
55 | 55 | ->activate(); |
@@ -61,21 +61,21 @@ discard block |
||
61 | 61 | else |
62 | 62 | { |
63 | 63 | $post_uri = URLDecode::getPiece(1); |
64 | - if($post_uri !== null) |
|
64 | + if ($post_uri !== null) |
|
65 | 65 | { |
66 | 66 | Loader::load('collector', 'blog/PostCollector'); |
67 | 67 | $post = PostCollector::getPostByURI($post_uri); |
68 | 68 | |
69 | - if($post != false) |
|
69 | + if ($post != false) |
|
70 | 70 | { |
71 | 71 | Loader::load('utility', 'Content'); |
72 | 72 | $uri = Content::instance('URLSafe', "/{$post->category}/{$post->title_url}/")->activate(); |
73 | 73 | } |
74 | 74 | } |
75 | 75 | } |
76 | - if($uri == '/search/') |
|
76 | + if ($uri == '/search/') |
|
77 | 77 | { |
78 | - if(Request::getGet('submit') == 'Submit Search' && Request::getGet('search')) |
|
78 | + if (Request::getGet('submit') == 'Submit Search' && Request::getGet('search')) |
|
79 | 79 | { |
80 | 80 | $uri .= Request::getGet('search'); |
81 | 81 | $uri .= '/'; |
@@ -163,7 +163,7 @@ |
||
163 | 163 | { |
164 | 164 | $path = self::escape($path); |
165 | 165 | |
166 | - if($commenter != 0) |
|
166 | + if ($commenter != 0) |
|
167 | 167 | $trusted_commenter_clause = "(`commenter`.`trusted` = '1' || `commenter`.`id` = '{$commenter}')"; |
168 | 168 | else |
169 | 169 | $trusted_commenter_clause = "`commenter`.`trusted` = '1'"; |
@@ -28,7 +28,7 @@ |
||
28 | 28 | |
29 | 29 | protected function set_response($message, $type = 'internal') |
30 | 30 | { |
31 | - switch($type) |
|
31 | + switch ($type) |
|
32 | 32 | { |
33 | 33 | case 'internal' : |
34 | 34 | $this->response['internal'] = $message; |
@@ -42,7 +42,7 @@ discard block |
||
42 | 42 | $companion_result = CompanionCollector::getCompanionList(); |
43 | 43 | $companion_list = array(); |
44 | 44 | |
45 | - foreach($companion_result as $companion_row) |
|
45 | + foreach ($companion_result as $companion_row) |
|
46 | 46 | { |
47 | 47 | $companion = new stdclass(); |
48 | 48 | $companion->name = $companion_row->name; |
@@ -55,7 +55,7 @@ discard block |
||
55 | 55 | $period_result = PeriodCollector::getPeriodList(); |
56 | 56 | $period_list = array(); |
57 | 57 | |
58 | - foreach($period_result as $period_row) |
|
58 | + foreach ($period_result as $period_row) |
|
59 | 59 | { |
60 | 60 | $period = new stdclass(); |
61 | 61 | $period->name = $period_row->name; |
@@ -27,7 +27,7 @@ |
||
27 | 27 | protected function get_page_number() |
28 | 28 | { |
29 | 29 | $page = URLDecode::getPiece(2); |
30 | - if(isset($page) && is_numeric($page)) |
|
30 | + if (isset($page) && is_numeric($page)) |
|
31 | 31 | return $page; |
32 | 32 | return 1; |
33 | 33 | } |
@@ -41,7 +41,7 @@ discard block |
||
41 | 41 | $county_result = CountyCollector::getCountyList(); |
42 | 42 | $county_list = array(); |
43 | 43 | |
44 | - foreach($county_result as $county_row) |
|
44 | + foreach ($county_result as $county_row) |
|
45 | 45 | { |
46 | 46 | $county = new stdclass(); |
47 | 47 | $county->name = $county_row->name; |
@@ -54,7 +54,7 @@ discard block |
||
54 | 54 | $watercourse_result = WatercourseCollector::getWatercourseList(); |
55 | 55 | $watercourse_list = array(); |
56 | 56 | |
57 | - foreach($watercourse_result as $watercourse_row) |
|
57 | + foreach ($watercourse_result as $watercourse_row) |
|
58 | 58 | { |
59 | 59 | $watercourse = new stdclass(); |
60 | 60 | $watercourse->name = $watercourse_row->name; |
@@ -36,7 +36,7 @@ |
||
36 | 36 | Loader::load('collector', 'blog/IntroductionCollector'); |
37 | 37 | $introduction_result = IntroductionCollector::getRow('about'); |
38 | 38 | |
39 | - if($introduction_result !== null) |
|
39 | + if ($introduction_result !== null) |
|
40 | 40 | { |
41 | 41 | $introduction = array(); |
42 | 42 | $introduction['title'] = $introduction_result->title; |
@@ -56,11 +56,11 @@ |
||
56 | 56 | final private function get_list_posts() |
57 | 57 | { |
58 | 58 | $post_array = array(); |
59 | - foreach($this->get_list_results() as $post) |
|
59 | + foreach ($this->get_list_results() as $post) |
|
60 | 60 | { |
61 | 61 | $post_array[] = $this->format_post($post, true); |
62 | 62 | } |
63 | - if(count($post_array) < 1 && URLDecode::getPiece(1) !== 'search') |
|
63 | + if (count($post_array) < 1 && URLDecode::getPiece(1) !== 'search') |
|
64 | 64 | $this->eject(); |
65 | 65 | return $post_array; |
66 | 66 | } |