@@ -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 | |
@@ -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); |
@@ -27,7 +27,7 @@ |
||
| 27 | 27 | $alias = URLDecode::getPiece(3); |
| 28 | 28 | $this->tag = LogTagCollector::getTag($alias); |
| 29 | 29 | |
| 30 | - if(!$this->tag) |
|
| 30 | + if (!$this->tag) |
|
| 31 | 31 | $this->eject(); |
| 32 | 32 | |
| 33 | 33 | parent::__construct(); |
@@ -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(); |
@@ -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 | } |
@@ -29,7 +29,7 @@ |
||
| 29 | 29 | $path = URLDecode::getPiece(1); |
| 30 | 30 | $this->watercourse = WatercourseCollector::getByAlias($path); |
| 31 | 31 | |
| 32 | - if(!$this->watercourse) |
|
| 32 | + if (!$this->watercourse) |
|
| 33 | 33 | $this->eject(); |
| 34 | 34 | |
| 35 | 35 | parent::__construct(); |
@@ -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, |
@@ -26,15 +26,15 @@ discard block |
||
| 26 | 26 | |
| 27 | 27 | public function activate() |
| 28 | 28 | {
|
| 29 | - if(!Request::hasPost()) |
|
| 29 | + if (!Request::hasPost()) |
|
| 30 | 30 | return false; |
| 31 | - if(!Request::getPost('submit') == 'Submit Comment')
|
|
| 31 | + if (!Request::getPost('submit') == 'Submit Comment')
|
|
| 32 | 32 | return false; |
| 33 | 33 | |
| 34 | 34 | $errors = $this->fetch_errors(); |
| 35 | - if(count($errors) > 0) |
|
| 35 | + if (count($errors) > 0) |
|
| 36 | 36 | return $errors; |
| 37 | - if(Request::getPost('catch') !== '')
|
|
| 37 | + if (Request::getPost('catch') !== '')
|
|
| 38 | 38 | return false; |
| 39 | 39 | |
| 40 | 40 | $page_id = $this->save_comment_page(); |
@@ -50,17 +50,17 @@ discard block |
||
| 50 | 50 | private function fetch_errors() |
| 51 | 51 | {
|
| 52 | 52 | $errors = array(); |
| 53 | - if(!Validate::checkRequest('post', 'name', 'name'))
|
|
| 53 | + if (!Validate::checkRequest('post', 'name', 'name'))
|
|
| 54 | 54 | $errors['name'] = 'You must include a valid name'; |
| 55 | - if(!Validate::checkRequest('post', 'email', 'email'))
|
|
| 55 | + if (!Validate::checkRequest('post', 'email', 'email'))
|
|
| 56 | 56 | $errors['email'] = 'You must include a valid email'; |
| 57 | - if(Request::getPost('website') && !Validate::checkRequest('post', 'website', 'url'))
|
|
| 57 | + if (Request::getPost('website') && !Validate::checkRequest('post', 'website', 'url'))
|
|
| 58 | 58 | $errors['website'] = 'Please enter a valid website'; |
| 59 | - if(!Validate::checkRequest('post', 'comment', 'string'))
|
|
| 59 | + if (!Validate::checkRequest('post', 'comment', 'string'))
|
|
| 60 | 60 | $errors['comment'] = 'You must enter a comment'; |
| 61 | - if(Request::getPost('notify') && Request::getPost('notify') != 'check')
|
|
| 61 | + if (Request::getPost('notify') && Request::getPost('notify') != 'check')
|
|
| 62 | 62 | $errors['notify'] = 'You entered an invalid notify request'; |
| 63 | - if(Request::getPost('reply') && !Validate::checkRequest('post', 'reply', 'integer'))
|
|
| 63 | + if (Request::getPost('reply') && !Validate::checkRequest('post', 'reply', 'integer'))
|
|
| 64 | 64 | $errors['reply'] = 'You entered an invalid reply request'; |
| 65 | 65 | |
| 66 | 66 | return $errors; |
@@ -69,7 +69,7 @@ discard block |
||
| 69 | 69 | private function save_comment_page() |
| 70 | 70 | {
|
| 71 | 71 | $page_result = CommentCollector::getCommentPageByURL($this->path, $this->site); |
| 72 | - if($page_result !== null) |
|
| 72 | + if ($page_result !== null) |
|
| 73 | 73 | return $page_result->id; |
| 74 | 74 | |
| 75 | 75 | $query = "INSERT INTO `jpemeric_comment`.`comment_page` (`site`, `path`) VALUES ('%d', '%s')";
|
@@ -85,7 +85,7 @@ discard block |
||
| 85 | 85 | 'name' => Request::getPost('name'),
|
| 86 | 86 | 'email' => Request::getPost('email'));
|
| 87 | 87 | |
| 88 | - if(Request::getPost('website') != '')
|
|
| 88 | + if (Request::getPost('website') != '')
|
|
| 89 | 89 | $cookie_value['website'] = Request::getPost('website');
|
| 90 | 90 | |
| 91 | 91 | $cookie_value = json_encode($cookie_value); |
@@ -95,7 +95,7 @@ discard block |
||
| 95 | 95 | ->save(); |
| 96 | 96 | |
| 97 | 97 | $commenter_result = CommentCollector::getCommenterByFields(Request::getPost('name'), Request::getPost('email'), Request::getPost('website'));
|
| 98 | - if($commenter_result !== null) |
|
| 98 | + if ($commenter_result !== null) |
|
| 99 | 99 | return $commenter_result->id; |
| 100 | 100 | |
| 101 | 101 | $query = "INSERT INTO `jpemeric_comment`.`commenter` (`name`,`email`,`url`) VALUES ('%s','%s','%s')";
|
@@ -112,7 +112,7 @@ discard block |
||
| 112 | 112 | private function save_comment() |
| 113 | 113 | {
|
| 114 | 114 | $comment_result = CommentCollector::getCommentByBody(Request::getPost('comment'));
|
| 115 | - if($comment_result !== null) |
|
| 115 | + if ($comment_result !== null) |
|
| 116 | 116 | return $comment_result->id; |
| 117 | 117 | |
| 118 | 118 | $query = "INSERT INTO `jpemeric_comment`.`comment` (`body`, `body_format`) VALUES ('%s', '%s')";
|
@@ -133,7 +133,7 @@ discard block |
||
| 133 | 133 | $query = "INSERT INTO `jpemeric_comment`.`comment_meta` (`commenter`,`comment`,`reply`,`notify`,`comment_page`,`date`,`display`) VALUES ('%d','%d','%d','%d','%d','%s','%d')";
|
| 134 | 134 | |
| 135 | 135 | $reply = Database::escape(Request::getPost('type'));
|
| 136 | - if($reply == 'new') |
|
| 136 | + if ($reply == 'new') |
|
| 137 | 137 | $reply = 0; |
| 138 | 138 | // else check to make sure value is legit |
| 139 | 139 | |
@@ -157,13 +157,13 @@ discard block |
||
| 157 | 157 | |
| 158 | 158 | $commenter_result = CommentCollector::getCommenterByFields(Request::getPost('name'), Request::getPost('email'), Request::getPost('website'));
|
| 159 | 159 | |
| 160 | - if($commenter_result->trusted == 1) |
|
| 160 | + if ($commenter_result->trusted == 1) |
|
| 161 | 161 | {
|
| 162 | 162 | $notification_result = CommentCollector::getNotificationForPage($page); |
| 163 | 163 | |
| 164 | - foreach($notification_result as $notification_row) |
|
| 164 | + foreach ($notification_result as $notification_row) |
|
| 165 | 165 | {
|
| 166 | - if($notification_row->email == Request::getPost('email'))
|
|
| 166 | + if ($notification_row->email == Request::getPost('email'))
|
|
| 167 | 167 | continue; |
| 168 | 168 | |
| 169 | 169 | $email_recipient_array[$notification_row->email] = array( |
@@ -180,7 +180,7 @@ discard block |
||
| 180 | 180 | $message = "Hello!\nThere has been a new comment on the page '{$this->page_title}' at Waterfalls of the Keweenaw. You have chosen to be notified of it - please reply to [email protected] if you would like to be removed from these notifications.\n\nOn " . date('F j, Y g:i a') . ", " . Request::getPost('name') . " commented...\n" . Request::getPost('comment') . "\n\nVisit {$this->full_path}#comments to see and reply to all the comments on this post.\nThank you!";
|
| 181 | 181 | } |
| 182 | 182 | |
| 183 | - foreach($email_recipient_array as $email_recipient) |
|
| 183 | + foreach ($email_recipient_array as $email_recipient) |
|
| 184 | 184 | {
|
| 185 | 185 | $mail = new Mail(); |
| 186 | 186 | $mail->setToAddress($email_recipient['email'], $email_recipient['name']); |
@@ -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 .= '/'; |