@@ -35,16 +35,16 @@ discard block |
||
35 | 35 | |
36 | 36 | private function process_form() |
37 | 37 | { |
38 | - if(!Request::hasPost() || Request::getPost('submit') != 'Send Message!') |
|
38 | + if (!Request::hasPost() || Request::getPost('submit') != 'Send Message!') |
|
39 | 39 | return (object) array('display' => 'normal'); |
40 | 40 | |
41 | 41 | Loader::load('utility', 'Validate'); |
42 | 42 | $error_result = array(); |
43 | - if(!Validate::checkRequest('post', 'name', 'string')) |
|
43 | + if (!Validate::checkRequest('post', 'name', 'string')) |
|
44 | 44 | $error_result['name'] = 'please enter your name'; |
45 | - if(!Validate::checkRequest('post', 'email', 'string')) |
|
45 | + if (!Validate::checkRequest('post', 'email', 'string')) |
|
46 | 46 | $error_result['email'] = 'please enter a valid email'; |
47 | - if(!Validate::checkRequest('post', 'message', 'string')) |
|
47 | + if (!Validate::checkRequest('post', 'message', 'string')) |
|
48 | 48 | $error_result['message'] = 'please write a message'; |
49 | 49 | |
50 | 50 | $values = (object) array( |
@@ -52,7 +52,7 @@ discard block |
||
52 | 52 | 'email' => Request::getPost('email'), |
53 | 53 | 'message' => Request::getPost('message')); |
54 | 54 | |
55 | - if(count($error_result) > 0) |
|
55 | + if (count($error_result) > 0) |
|
56 | 56 | { |
57 | 57 | return (object) array( |
58 | 58 | 'display' => 'error', |
@@ -40,7 +40,7 @@ discard block |
||
40 | 40 | 'date' => date('Y'))); |
41 | 41 | |
42 | 42 | Loader::loadInstance('utility', 'Database'); |
43 | - if(Database::isConnected() === false) |
|
43 | + if (Database::isConnected() === false) |
|
44 | 44 | $this->unavailable(); |
45 | 45 | } |
46 | 46 | |
@@ -65,9 +65,9 @@ discard block |
||
65 | 65 | $post_array = array(); |
66 | 66 | $post_result = ActivityCollector::getRecent(); |
67 | 67 | |
68 | - foreach($post_result as $row) |
|
68 | + foreach ($post_result as $row) |
|
69 | 69 | { |
70 | - $post_array[] = $this->expand_post($row);; |
|
70 | + $post_array[] = $this->expand_post($row); ; |
|
71 | 71 | } |
72 | 72 | |
73 | 73 | return $post_array; |
@@ -86,7 +86,7 @@ discard block |
||
86 | 86 | |
87 | 87 | $post = new stdclass(); |
88 | 88 | |
89 | - switch($raw_post->type) |
|
89 | + switch ($raw_post->type) |
|
90 | 90 | { |
91 | 91 | case 'blog' : |
92 | 92 | $row = BlogCollector::getRow($raw_post->type_id); |
@@ -97,7 +97,7 @@ discard block |
||
97 | 97 | $post->title = "Blogged about {$category}: <a href=\"{$row->url}\">{$row->title}</a>."; |
98 | 98 | $post->comments = $row->comments; |
99 | 99 | |
100 | - if($format == 'full') |
|
100 | + if ($format == 'full') |
|
101 | 101 | $post->image = Content::instance('FetchFirstPhoto', $row->body)->activate(false, 'standard'); |
102 | 102 | break; |
103 | 103 | case 'book' : |
@@ -106,23 +106,23 @@ discard block |
||
106 | 106 | $post->type = 'book'; |
107 | 107 | $post->title = "Just finished reading {$row->title} by {$row->author}."; |
108 | 108 | |
109 | - if($format == 'full') |
|
109 | + if ($format == 'full') |
|
110 | 110 | $post->image = "<img alt=\"{$row->title} by {$row->author}\" src=\"{$row->image}\" />"; |
111 | 111 | break; |
112 | 112 | case 'distance' : |
113 | 113 | $row = DistanceCollector::getRow($raw_post->type_id); |
114 | 114 | |
115 | 115 | $post->type = 'distance'; |
116 | - if($row->type == 'running') |
|
116 | + if ($row->type == 'running') |
|
117 | 117 | { |
118 | 118 | $post->title = "Ran {$row->distance} miles and felt {$row->felt}."; |
119 | - if(strlen($row->message) > 0) |
|
119 | + if (strlen($row->message) > 0) |
|
120 | 120 | $post->title .= " Afterwards, I was all like '{$row->message}'."; |
121 | 121 | } |
122 | - else if($row->type == 'hiking') |
|
122 | + else if ($row->type == 'hiking') |
|
123 | 123 | { |
124 | 124 | $post->title = "Hiked {$row->distance} miles and felt {$row->felt}."; |
125 | - if(strlen($row->title) > 0) |
|
125 | + if (strlen($row->title) > 0) |
|
126 | 126 | $post->title .= " I was hiking up around the {$row->title} area."; |
127 | 127 | } |
128 | 128 | else if ($row->type == 'walking') { |
@@ -140,7 +140,7 @@ discard block |
||
140 | 140 | |
141 | 141 | $post->type = 'twitter'; |
142 | 142 | |
143 | - if($format == 'full') |
|
143 | + if ($format == 'full') |
|
144 | 144 | $post->title = $row->text_formatted_full; |
145 | 145 | else |
146 | 146 | $post->title = $row->text_formatted; |
@@ -153,12 +153,12 @@ discard block |
||
153 | 153 | |
154 | 154 | $post->type = 'youtube'; |
155 | 155 | |
156 | - if($format == 'full') |
|
156 | + if ($format == 'full') |
|
157 | 157 | $post->title = "Favorited {$row->title} by {$row->author} on YouTube."; |
158 | 158 | else |
159 | 159 | $post->title = "Favorited <a href=\"http://www.youtube.com/watch?feature=player_embedded&v={$row->video_id}\" rel=\"nofollow\" target=\"_blank\" title=\"{$row->content}\">{$row->title}</a> by {$row->author} on YouTube."; |
160 | 160 | |
161 | - if($format == 'full') |
|
161 | + if ($format == 'full') |
|
162 | 162 | $post->embed_code = "<iframe src=\"http://www.youtube.com/embed/{$row->video_id}?rel=0\" frameborder=\"0\" allowfullscreen></iframe>"; |
163 | 163 | break; |
164 | 164 | } |
@@ -186,9 +186,9 @@ discard block |
||
186 | 186 | $headers = $this->headers; |
187 | 187 | Header::$headers(); |
188 | 188 | Loader::load('view', '/Head', $this->data_array['head']); |
189 | - foreach($this->body_view_array as $view) |
|
189 | + foreach ($this->body_view_array as $view) |
|
190 | 190 | { |
191 | - if(substr($view, 0, 1) == '/') |
|
191 | + if (substr($view, 0, 1) == '/') |
|
192 | 192 | Loader::load('view', $view, $this->data_array['body']); |
193 | 193 | else |
194 | 194 | Loader::load('view', URLDecode::getSite() . '/' . $view, $this->data_array['body']); |
@@ -200,7 +200,7 @@ discard block |
||
200 | 200 | Loader::load('view', '/Foot', array('tracking_code' => self::$TRACKING_CODE)); |
201 | 201 | } |
202 | 202 | |
203 | - if($view == '/404' || $view == '/503') |
|
203 | + if ($view == '/404' || $view == '/503') |
|
204 | 204 | exit; |
205 | 205 | } |
206 | 206 | |
@@ -261,10 +261,10 @@ discard block |
||
261 | 261 | |
262 | 262 | $js_array = array(); |
263 | 263 | |
264 | - if(count($this->js_array) > 0) |
|
264 | + if (count($this->js_array) > 0) |
|
265 | 265 | $js_array = array_merge($js_array, $this->js_array); |
266 | 266 | |
267 | - if(count($js_array) > 0) |
|
267 | + if (count($js_array) > 0) |
|
268 | 268 | $js_array = Asset::getJS($js_array); |
269 | 269 | |
270 | 270 | $this->set_head('css_link_array', $css_array); |
@@ -278,26 +278,26 @@ discard block |
||
278 | 278 | |
279 | 279 | protected function eject() |
280 | 280 | { |
281 | - if(get_class($this) !== 'Error404Controller') |
|
281 | + if (get_class($this) !== 'Error404Controller') |
|
282 | 282 | Loader::loadNew('controller', '/Error404Controller')->activate(); |
283 | 283 | } |
284 | 284 | |
285 | 285 | protected function unavailable() |
286 | 286 | { |
287 | - if(get_class($this) !== 'Error503Controller') |
|
287 | + if (get_class($this) !== 'Error503Controller') |
|
288 | 288 | Loader::loadNew('controller', '/Error503Controller')->activate(); |
289 | 289 | } |
290 | 290 | |
291 | 291 | protected function redirect($uri, $method = 301) |
292 | 292 | { |
293 | - switch($method) |
|
293 | + switch ($method) |
|
294 | 294 | { |
295 | 295 | case 301 : |
296 | - if(get_class($this) !== 'Error301Controller') |
|
296 | + if (get_class($this) !== 'Error301Controller') |
|
297 | 297 | Loader::loadNew('controller', '/Error301Controller', array($uri))->activate(); |
298 | 298 | break; |
299 | 299 | case 303 : |
300 | - if(get_class($this) !== 'Error303Controller') |
|
300 | + if (get_class($this) !== 'Error303Controller') |
|
301 | 301 | Loader::loadNew('controller', '/Error303Controller', array($uri))->activate(); |
302 | 302 | break; |
303 | 303 | } |
@@ -317,7 +317,7 @@ discard block |
||
317 | 317 | private $comment_errors; |
318 | 318 | protected function handle_comment_submit($site_id, $path, $redirect_url, $page_title) |
319 | 319 | { |
320 | - if(Request::hasPost() && Request::getPost('submit') == 'Submit Comment') |
|
320 | + if (Request::hasPost() && Request::getPost('submit') == 'Submit Comment') |
|
321 | 321 | { |
322 | 322 | $parameters = array($site_id, $path, $redirect_url, $page_title); |
323 | 323 | $this->comment_errors = Loader::loadNew('module', 'form/CommentSubmitModule', $parameters)->activate(); |
@@ -335,7 +335,7 @@ discard block |
||
335 | 335 | $comment_array = array(); |
336 | 336 | $comment_result = CommentCollector::getCommentsForURL($site, $path, $commenter->id); |
337 | 337 | |
338 | - foreach($comment_result as $comment) |
|
338 | + foreach ($comment_result as $comment) |
|
339 | 339 | { |
340 | 340 | $comment_object = new stdclass(); |
341 | 341 | $comment_object->id = $comment->id; |
@@ -345,12 +345,12 @@ discard block |
||
345 | 345 | $comment_object->url = $comment->url; |
346 | 346 | $comment_object->trusted = $comment->trusted; |
347 | 347 | |
348 | - if($comment->reply == 0 && Request::getPost('type') == $comment->id) |
|
348 | + if ($comment->reply == 0 && Request::getPost('type') == $comment->id) |
|
349 | 349 | $comment_object->errors = $this->comment_errors; |
350 | 350 | else |
351 | 351 | $comment_object->errors = array(); |
352 | 352 | |
353 | - if($comment->reply == 0) |
|
353 | + if ($comment->reply == 0) |
|
354 | 354 | { |
355 | 355 | $comment_object->replies = array(); |
356 | 356 | $comment_array[$comment->id] = $comment_object; |
@@ -381,21 +381,21 @@ discard block |
||
381 | 381 | $commenter->website = ''; |
382 | 382 | |
383 | 383 | $commenter_cookie = Cookie::instance('Commenter'); |
384 | - if(!$commenter_cookie->exists()) |
|
384 | + if (!$commenter_cookie->exists()) |
|
385 | 385 | return $commenter; |
386 | 386 | |
387 | 387 | $commenter_cookie_value = $commenter_cookie->getValue(); |
388 | 388 | $commenter_cookie_value = json_decode($commenter_cookie_value); |
389 | 389 | |
390 | - if($commenter_cookie_value === NULL) |
|
390 | + if ($commenter_cookie_value === NULL) |
|
391 | 391 | return $commenter; |
392 | 392 | |
393 | - if(!isset($commenter_cookie_value->name) || !isset($commenter_cookie_value->email)) |
|
393 | + if (!isset($commenter_cookie_value->name) || !isset($commenter_cookie_value->email)) |
|
394 | 394 | return $commenter; |
395 | 395 | |
396 | 396 | $commenter_object = CommentCollector::getCommenterByFields($commenter_cookie_value->name, $commenter_cookie_value->email, (isset($commenter_cookie_value->website) ? $commenter_cookie_value->website : '')); |
397 | 397 | |
398 | - if($commenter_object === NULL) |
|
398 | + if ($commenter_object === NULL) |
|
399 | 399 | return $commenter; |
400 | 400 | |
401 | 401 | $commenter->id = $commenter_object->id; |
@@ -112,17 +112,17 @@ discard block |
||
112 | 112 | { |
113 | 113 | $album = array(); |
114 | 114 | |
115 | - if($this->waterfall->album == 0) |
|
115 | + if ($this->waterfall->album == 0) |
|
116 | 116 | return $album; |
117 | 117 | |
118 | 118 | $photo_list = AlbumCollector::getPhotoListForAlbum($this->waterfall->album); |
119 | - foreach($photo_list as $photo) |
|
119 | + foreach ($photo_list as $photo) |
|
120 | 120 | { |
121 | 121 | $photo_array = array(); |
122 | 122 | $photo_array['full_link'] = sprintf(self::$FULL_IMAGE_LINK, $photo->category, $photo->name); |
123 | 123 | $photo_array['description'] = $photo->description; |
124 | 124 | |
125 | - if($photo->height < $photo->width) |
|
125 | + if ($photo->height < $photo->width) |
|
126 | 126 | list($height, $width) = array(75, 100); |
127 | 127 | else |
128 | 128 | list($height, $width) = array(100, 75); |
@@ -154,7 +154,7 @@ discard block |
||
154 | 154 | $sidebar_data['drop_height'] = Content::instance('ImperialUnit', $waterfall->drop_height)->activate('inches'); |
155 | 155 | $sidebar_data['drop_count'] = $waterfall->drop_count; |
156 | 156 | |
157 | - $sidebar_data['county'] = (object) array ( |
|
157 | + $sidebar_data['county'] = (object) array( |
|
158 | 158 | 'name' => $waterfall->county, |
159 | 159 | 'alias' => $waterfall->county_alias, |
160 | 160 | 'title' => $waterfall->county_title, |
@@ -28,7 +28,7 @@ |
||
28 | 28 | $path = URLDecode::getPiece(1); |
29 | 29 | $this->county = CountyCollector::getByAlias($path); |
30 | 30 | |
31 | - if(!$this->county) |
|
31 | + if (!$this->county) |
|
32 | 32 | $this->eject(); |
33 | 33 | |
34 | 34 | parent::__construct(); |
@@ -25,7 +25,7 @@ discard block |
||
25 | 25 | $log_path = URLDecode::getPiece(2); |
26 | 26 | |
27 | 27 | $this->log = LogCollector::getByAlias($log_path); |
28 | - if(!$this->log) |
|
28 | + if (!$this->log) |
|
29 | 29 | $this->eject(); |
30 | 30 | |
31 | 31 | $this->parent_navigation_item = 'journal'; |
@@ -48,7 +48,7 @@ discard block |
||
48 | 48 | |
49 | 49 | $keyword_array = array(); |
50 | 50 | $tag_result = LogCollector::getTagListForLog($this->log->id); |
51 | - foreach($tag_result as $tag) |
|
51 | + foreach ($tag_result as $tag) |
|
52 | 52 | { |
53 | 53 | $keyword_array[] = $tag->name; |
54 | 54 | } |
@@ -124,7 +124,7 @@ discard block |
||
124 | 124 | 'next' => array()); |
125 | 125 | |
126 | 126 | $previous_log = LogCollector::getPreviousLog($this->log->id); |
127 | - if($previous_log != false) |
|
127 | + if ($previous_log != false) |
|
128 | 128 | { |
129 | 129 | $series['previous'] = (object) array( |
130 | 130 | 'path' => '/' . self::$JOURNAL_DIRECTORY . '/' . $previous_log->alias . '/', |
@@ -133,7 +133,7 @@ discard block |
||
133 | 133 | } |
134 | 134 | |
135 | 135 | $next_log = LogCollector::getNextLog($this->log->id); |
136 | - if($next_log != false) |
|
136 | + if ($next_log != false) |
|
137 | 137 | { |
138 | 138 | $series['next'] = (object) array( |
139 | 139 | 'path' => '/' . self::$JOURNAL_DIRECTORY . '/' . $next_log->alias . '/', |
@@ -150,7 +150,7 @@ discard block |
||
150 | 150 | |
151 | 151 | $sidebar['companion_list'] = array(); |
152 | 152 | $companions = LogCollector::getCompanionListForLog($this->log->id); |
153 | - foreach($companions as $companion) |
|
153 | + foreach ($companions as $companion) |
|
154 | 154 | { |
155 | 155 | $sidebar['companion_list'][] = (object) array( |
156 | 156 | 'title' => $companion->name, |
@@ -159,7 +159,7 @@ discard block |
||
159 | 159 | |
160 | 160 | $sidebar['tag_list'] = array(); |
161 | 161 | $tags = LogCollector::getTagListForLog($this->log->id); |
162 | - foreach($tags as $tag) |
|
162 | + foreach ($tags as $tag) |
|
163 | 163 | { |
164 | 164 | $sidebar['tag_list'][] = (object) array( |
165 | 165 | 'title' => $tag->name, |
@@ -168,7 +168,7 @@ discard block |
||
168 | 168 | |
169 | 169 | $sidebar['waterfall_list'] = array(); |
170 | 170 | $waterfalls = LogCollector::getWaterfallListForLog($this->log->id); |
171 | - foreach($waterfalls as $waterfall) |
|
171 | + foreach ($waterfalls as $waterfall) |
|
172 | 172 | { |
173 | 173 | $sidebar['waterfall_list'][] = (object) array( |
174 | 174 | 'title' => $waterfall->name, |
@@ -182,17 +182,17 @@ discard block |
||
182 | 182 | { |
183 | 183 | $album = array(); |
184 | 184 | |
185 | - if($this->log->album == 0) |
|
185 | + if ($this->log->album == 0) |
|
186 | 186 | return $album; |
187 | 187 | |
188 | 188 | $photo_list = AlbumCollector::getPhotoListForAlbum($this->log->album); |
189 | - foreach($photo_list as $photo) |
|
189 | + foreach ($photo_list as $photo) |
|
190 | 190 | { |
191 | 191 | $photo_array = array(); |
192 | 192 | $photo_array['full_link'] = sprintf(self::$FULL_IMAGE_LINK, $photo->category, $photo->name); |
193 | 193 | $photo_array['description'] = $photo->description; |
194 | 194 | |
195 | - if($photo->height < $photo->width) |
|
195 | + if ($photo->height < $photo->width) |
|
196 | 196 | list($height, $width) = array(75, 100); |
197 | 197 | else |
198 | 198 | list($height, $width) = array(100, 75); |
@@ -26,7 +26,7 @@ |
||
26 | 26 | $alias = URLDecode::getPiece(2); |
27 | 27 | $this->period = PeriodCollector::getByAlias($alias); |
28 | 28 | |
29 | - if(!$this->period) |
|
29 | + if (!$this->period) |
|
30 | 30 | $this->eject(); |
31 | 31 | |
32 | 32 | parent::__construct(); |
@@ -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 | } |
@@ -59,7 +59,7 @@ |
||
59 | 59 | $recent_comments = CommentCollector::getRecentWaterfallComments(); |
60 | 60 | |
61 | 61 | $recent_comment_container = array(); |
62 | - foreach($recent_comments as $comment) { |
|
62 | + foreach ($recent_comments as $comment) { |
|
63 | 63 | $body = $comment->body; |
64 | 64 | $body = strip_tags($body); |
65 | 65 |