@@ -57,8 +57,7 @@ |
||
57 | 57 | |
58 | 58 | Loader::load('utility', 'Content'); |
59 | 59 | $uri = Content::instance('URLSafe', "/{$post->category}/{$post->title_url}/")->activate(); |
60 | - } |
|
61 | - else |
|
60 | + } else |
|
62 | 61 | { |
63 | 62 | $post_uri = URLDecode::getPiece(1); |
64 | 63 | if($post_uri !== null) |
@@ -163,10 +163,11 @@ |
||
163 | 163 | { |
164 | 164 | $path = self::escape($path); |
165 | 165 | |
166 | - if($commenter != 0) |
|
167 | - $trusted_commenter_clause = "(`commenter`.`trusted` = '1' || `commenter`.`id` = '{$commenter}')"; |
|
168 | - else |
|
169 | - $trusted_commenter_clause = "`commenter`.`trusted` = '1'"; |
|
166 | + if($commenter != 0) { |
|
167 | + $trusted_commenter_clause = "(`commenter`.`trusted` = '1' || `commenter`.`id` = '{$commenter}')"; |
|
168 | + } else { |
|
169 | + $trusted_commenter_clause = "`commenter`.`trusted` = '1'"; |
|
170 | + } |
|
170 | 171 | |
171 | 172 | $query = " |
172 | 173 | SELECT |
@@ -112,8 +112,9 @@ discard block |
||
112 | 112 | { |
113 | 113 | $album = array(); |
114 | 114 | |
115 | - if($this->waterfall->album == 0) |
|
116 | - return $album; |
|
115 | + if($this->waterfall->album == 0) { |
|
116 | + return $album; |
|
117 | + } |
|
117 | 118 | |
118 | 119 | $photo_list = AlbumCollector::getPhotoListForAlbum($this->waterfall->album); |
119 | 120 | foreach($photo_list as $photo) |
@@ -122,10 +123,11 @@ discard block |
||
122 | 123 | $photo_array['full_link'] = sprintf(self::$FULL_IMAGE_LINK, $photo->category, $photo->name); |
123 | 124 | $photo_array['description'] = $photo->description; |
124 | 125 | |
125 | - if($photo->height < $photo->width) |
|
126 | - list($height, $width) = array(75, 100); |
|
127 | - else |
|
128 | - list($height, $width) = array(100, 75); |
|
126 | + if($photo->height < $photo->width) { |
|
127 | + list($height, $width) = array(75, 100); |
|
128 | + } else { |
|
129 | + list($height, $width) = array(100, 75); |
|
130 | + } |
|
129 | 131 | |
130 | 132 | $photo_array['image_node'] = sprintf( |
131 | 133 | self::$THUMB_IMAGE_NODE, |
@@ -28,8 +28,9 @@ |
||
28 | 28 | $path = URLDecode::getPiece(1); |
29 | 29 | $this->county = CountyCollector::getByAlias($path); |
30 | 30 | |
31 | - if(!$this->county) |
|
32 | - $this->eject(); |
|
31 | + if(!$this->county) { |
|
32 | + $this->eject(); |
|
33 | + } |
|
33 | 34 | |
34 | 35 | parent::__construct(); |
35 | 36 | } |
@@ -25,8 +25,9 @@ discard block |
||
25 | 25 | $log_path = URLDecode::getPiece(2); |
26 | 26 | |
27 | 27 | $this->log = LogCollector::getByAlias($log_path); |
28 | - if(!$this->log) |
|
29 | - $this->eject(); |
|
28 | + if(!$this->log) { |
|
29 | + $this->eject(); |
|
30 | + } |
|
30 | 31 | |
31 | 32 | $this->parent_navigation_item = 'journal'; |
32 | 33 | |
@@ -182,8 +183,9 @@ discard block |
||
182 | 183 | { |
183 | 184 | $album = array(); |
184 | 185 | |
185 | - if($this->log->album == 0) |
|
186 | - return $album; |
|
186 | + if($this->log->album == 0) { |
|
187 | + return $album; |
|
188 | + } |
|
187 | 189 | |
188 | 190 | $photo_list = AlbumCollector::getPhotoListForAlbum($this->log->album); |
189 | 191 | foreach($photo_list as $photo) |
@@ -192,10 +194,11 @@ discard block |
||
192 | 194 | $photo_array['full_link'] = sprintf(self::$FULL_IMAGE_LINK, $photo->category, $photo->name); |
193 | 195 | $photo_array['description'] = $photo->description; |
194 | 196 | |
195 | - if($photo->height < $photo->width) |
|
196 | - list($height, $width) = array(75, 100); |
|
197 | - else |
|
198 | - list($height, $width) = array(100, 75); |
|
197 | + if($photo->height < $photo->width) { |
|
198 | + list($height, $width) = array(75, 100); |
|
199 | + } else { |
|
200 | + list($height, $width) = array(100, 75); |
|
201 | + } |
|
199 | 202 | |
200 | 203 | if ($photo->description == '') { |
201 | 204 | Debugger::logMessage("No description for {$photo->category}/{$photo->name}"); |
@@ -26,8 +26,9 @@ |
||
26 | 26 | $alias = URLDecode::getPiece(2); |
27 | 27 | $this->period = PeriodCollector::getByAlias($alias); |
28 | 28 | |
29 | - if(!$this->period) |
|
30 | - $this->eject(); |
|
29 | + if(!$this->period) { |
|
30 | + $this->eject(); |
|
31 | + } |
|
31 | 32 | |
32 | 33 | parent::__construct(); |
33 | 34 | } |
@@ -27,8 +27,9 @@ |
||
27 | 27 | protected function get_page_number() |
28 | 28 | { |
29 | 29 | $page = URLDecode::getPiece(2); |
30 | - if(isset($page) && is_numeric($page)) |
|
31 | - return $page; |
|
30 | + if(isset($page) && is_numeric($page)) { |
|
31 | + return $page; |
|
32 | + } |
|
32 | 33 | return 1; |
33 | 34 | } |
34 | 35 |
@@ -33,17 +33,21 @@ |
||
33 | 33 | |
34 | 34 | private function process_form() |
35 | 35 | { |
36 | - if(!Request::hasPost() || Request::getPost('submit') != 'Send Message!') |
|
37 | - return (object) array('display' => 'normal'); |
|
36 | + if(!Request::hasPost() || Request::getPost('submit') != 'Send Message!') { |
|
37 | + return (object) array('display' => 'normal'); |
|
38 | + } |
|
38 | 39 | |
39 | 40 | Loader::load('utility', 'Validate'); |
40 | 41 | $error_result = array(); |
41 | - if(!Validate::checkRequest('post', 'name', 'string')) |
|
42 | - $error_result['name'] = 'please enter your name'; |
|
43 | - if(!Validate::checkRequest('post', 'email', 'string')) |
|
44 | - $error_result['email'] = 'please enter a valid email'; |
|
45 | - if(!Validate::checkRequest('post', 'message', 'string')) |
|
46 | - $error_result['message'] = 'please write a message'; |
|
42 | + if(!Validate::checkRequest('post', 'name', 'string')) { |
|
43 | + $error_result['name'] = 'please enter your name'; |
|
44 | + } |
|
45 | + if(!Validate::checkRequest('post', 'email', 'string')) { |
|
46 | + $error_result['email'] = 'please enter a valid email'; |
|
47 | + } |
|
48 | + if(!Validate::checkRequest('post', 'message', 'string')) { |
|
49 | + $error_result['message'] = 'please write a message'; |
|
50 | + } |
|
47 | 51 | |
48 | 52 | $values = (object) array( |
49 | 53 | 'name' => Request::getPost('name'), |
@@ -27,8 +27,9 @@ |
||
27 | 27 | $alias = URLDecode::getPiece(3); |
28 | 28 | $this->tag = LogTagCollector::getTag($alias); |
29 | 29 | |
30 | - if(!$this->tag) |
|
31 | - $this->eject(); |
|
30 | + if(!$this->tag) { |
|
31 | + $this->eject(); |
|
32 | + } |
|
32 | 33 | |
33 | 34 | parent::__construct(); |
34 | 35 | } |