@@ -16,9 +16,9 @@ |
||
16 | 16 | |
17 | 17 | $pieces = PortfolioCollector::getAllPieces(); |
18 | 18 | |
19 | - foreach($pieces as $piece) |
|
19 | + foreach ($pieces as $piece) |
|
20 | 20 | { |
21 | - if($piece->category == 1) |
|
21 | + if ($piece->category == 1) |
|
22 | 22 | $this->addURL("web/{$piece->title_url}/", date('Y-01-01'), 'yearly', .7); |
23 | 23 | else |
24 | 24 | $this->addURL("print/{$piece->title_url}/", date('Y-01-01'), 'yearly', .7); |
@@ -18,10 +18,11 @@ |
||
18 | 18 | |
19 | 19 | foreach($pieces as $piece) |
20 | 20 | { |
21 | - if($piece->category == 1) |
|
22 | - $this->addURL("web/{$piece->title_url}/", date('Y-01-01'), 'yearly', .7); |
|
23 | - else |
|
24 | - $this->addURL("print/{$piece->title_url}/", date('Y-01-01'), 'yearly', .7); |
|
21 | + if($piece->category == 1) { |
|
22 | + $this->addURL("web/{$piece->title_url}/", date('Y-01-01'), 'yearly', .7); |
|
23 | + } else { |
|
24 | + $this->addURL("print/{$piece->title_url}/", date('Y-01-01'), 'yearly', .7); |
|
25 | + } |
|
25 | 26 | } |
26 | 27 | } |
27 | 28 |
@@ -7,16 +7,16 @@ discard block |
||
7 | 7 | { |
8 | 8 | |
9 | 9 | private static $HOME_PAGE_RANK = .9; |
10 | - private static $TAG_PAGE_RANK = .3; |
|
11 | - private static $PAGINATED_PAGE_RANK = .1; |
|
10 | + private static $TAG_PAGE_RANK = .3; |
|
11 | + private static $PAGINATED_PAGE_RANK = .1; |
|
12 | 12 | private static $POST_PAGE_RANK = .5; |
13 | - private static $ABOUT_PAGE_RANK = .7; |
|
13 | + private static $ABOUT_PAGE_RANK = .7; |
|
14 | 14 | |
15 | 15 | private static $HOME_PAGE_CHANGEFREQ = 'hourly'; |
16 | 16 | private static $TAG_PAGE_CHANGEFREQ = 'daily'; |
17 | - private static $PAGINATED_PAGE_CHANGEFREQ = 'daily'; |
|
17 | + private static $PAGINATED_PAGE_CHANGEFREQ = 'daily'; |
|
18 | 18 | private static $POST_PAGE_CHANGEFREQ = 'weekly'; |
19 | - private static $ABOUT_PAGE_CHANGEFREQ = 'monthly'; |
|
19 | + private static $ABOUT_PAGE_CHANGEFREQ = 'monthly'; |
|
20 | 20 | |
21 | 21 | private static $POSTS_PER_PAGE = 15; |
22 | 22 | |
@@ -42,12 +42,12 @@ discard block |
||
42 | 42 | $posts = ActivityCollector::getAll(); |
43 | 43 | |
44 | 44 | $tag_post_holder = array(); |
45 | - foreach($posts as $post) |
|
45 | + foreach ($posts as $post) |
|
46 | 46 | { |
47 | 47 | $tag_post_holder[$post->type][] = $post; |
48 | 48 | } |
49 | 49 | |
50 | - foreach($tag_post_holder as $tag => $posts) |
|
50 | + foreach ($tag_post_holder as $tag => $posts) |
|
51 | 51 | { |
52 | 52 | $url = "{$tag}/"; |
53 | 53 | $this->add_paginated_pages($posts, $url, self::$TAG_PAGE_CHANGEFREQ, self::$TAG_PAGE_RANK); |
@@ -58,7 +58,7 @@ discard block |
||
58 | 58 | { |
59 | 59 | $posts = ActivityCollector::getAll(); |
60 | 60 | |
61 | - foreach($posts as $post) |
|
61 | + foreach ($posts as $post) |
|
62 | 62 | { |
63 | 63 | $this->addURL("{$post->type}/{$post->id}/", date('Y-m-d', strtotime('last Monday')), self::$POST_PAGE_CHANGEFREQ, self::$POST_PAGE_RANK); |
64 | 64 | } |
@@ -66,7 +66,7 @@ discard block |
||
66 | 66 | |
67 | 67 | private function add_paginated_pages($posts, $base_url, $changefreq, $rank) |
68 | 68 | { |
69 | - switch($changefreq) |
|
69 | + switch ($changefreq) |
|
70 | 70 | { |
71 | 71 | case 'hourly' : |
72 | 72 | $lastmod = date('Y-m-d H:00:00'); |
@@ -83,7 +83,7 @@ discard block |
||
83 | 83 | } |
84 | 84 | |
85 | 85 | $this->addURL($base_url, $lastmod, $changefreq, $rank); |
86 | - for($i = 2; (($i - 1) * self::$POSTS_PER_PAGE) < count($posts); $i++) |
|
86 | + for ($i = 2; (($i - 1) * self::$POSTS_PER_PAGE) < count($posts); $i++) |
|
87 | 87 | { |
88 | 88 | $this->addURL("{$base_url}page/{$i}/", date('Y-m-01'), self::$PAGINATED_PAGE_CHANGEFREQ, self::$PAGINATED_PAGE_RANK); |
89 | 89 | } |
@@ -27,7 +27,7 @@ discard block |
||
27 | 27 | { |
28 | 28 | $entry = new stdclass(); |
29 | 29 | $entry->agent = self::$ALL_ROBOTS; |
30 | - if($url) |
|
30 | + if ($url) |
|
31 | 31 | $entry->allow = $url; |
32 | 32 | else |
33 | 33 | { |
@@ -42,7 +42,7 @@ discard block |
||
42 | 42 | { |
43 | 43 | $entry = new stdclass(); |
44 | 44 | $entry->agent = self::$ALL_ROBOTS; |
45 | - if($url) |
|
45 | + if ($url) |
|
46 | 46 | $entry->disallow = $url; |
47 | 47 | else |
48 | 48 | $entry->disallow = self::$ALL_URL; |
@@ -55,18 +55,18 @@ discard block |
||
55 | 55 | $this->set_data(); |
56 | 56 | Header::sendRobot(); |
57 | 57 | |
58 | - foreach($this->entries as $key => $entry) |
|
58 | + foreach ($this->entries as $key => $entry) |
|
59 | 59 | { |
60 | - if($key == 0) |
|
60 | + if ($key == 0) |
|
61 | 61 | echo "User-agent: {$entry->agent}\n"; |
62 | - if(isset($entry->disallow) && $entry->disallow != '') |
|
62 | + if (isset($entry->disallow) && $entry->disallow != '') |
|
63 | 63 | echo "Disallow: {$entry->disallow}\n"; |
64 | - if(isset($entry->allow)) |
|
64 | + if (isset($entry->allow)) |
|
65 | 65 | echo "Allow: {$entry->allow}\n"; |
66 | 66 | //echo "\n"; |
67 | 67 | } |
68 | 68 | |
69 | - if($this->show_sitemap) |
|
69 | + if ($this->show_sitemap) |
|
70 | 70 | { |
71 | 71 | echo "\n"; |
72 | 72 | $sitemap = URLDecode::getBase() . 'sitemap.xml'; |
@@ -27,9 +27,9 @@ discard block |
||
27 | 27 | { |
28 | 28 | $entry = new stdclass(); |
29 | 29 | $entry->agent = self::$ALL_ROBOTS; |
30 | - if($url) |
|
31 | - $entry->allow = $url; |
|
32 | - else |
|
30 | + if($url) { |
|
31 | + $entry->allow = $url; |
|
32 | + } else |
|
33 | 33 | { |
34 | 34 | $entry->disallow = ''; |
35 | 35 | $entry->allow = self::$ALL_URL; |
@@ -42,10 +42,11 @@ discard block |
||
42 | 42 | { |
43 | 43 | $entry = new stdclass(); |
44 | 44 | $entry->agent = self::$ALL_ROBOTS; |
45 | - if($url) |
|
46 | - $entry->disallow = $url; |
|
47 | - else |
|
48 | - $entry->disallow = self::$ALL_URL; |
|
45 | + if($url) { |
|
46 | + $entry->disallow = $url; |
|
47 | + } else { |
|
48 | + $entry->disallow = self::$ALL_URL; |
|
49 | + } |
|
49 | 50 | |
50 | 51 | $this->entries[] = $entry; |
51 | 52 | } |
@@ -57,12 +58,15 @@ discard block |
||
57 | 58 | |
58 | 59 | foreach($this->entries as $key => $entry) |
59 | 60 | { |
60 | - if($key == 0) |
|
61 | - echo "User-agent: {$entry->agent}\n"; |
|
62 | - if(isset($entry->disallow) && $entry->disallow != '') |
|
63 | - echo "Disallow: {$entry->disallow}\n"; |
|
64 | - if(isset($entry->allow)) |
|
65 | - echo "Allow: {$entry->allow}\n"; |
|
61 | + if($key == 0) { |
|
62 | + echo "User-agent: {$entry->agent}\n"; |
|
63 | + } |
|
64 | + if(isset($entry->disallow) && $entry->disallow != '') { |
|
65 | + echo "Disallow: {$entry->disallow}\n"; |
|
66 | + } |
|
67 | + if(isset($entry->allow)) { |
|
68 | + echo "Allow: {$entry->allow}\n"; |
|
69 | + } |
|
66 | 70 | //echo "\n"; |
67 | 71 | } |
68 | 72 |
@@ -22,7 +22,7 @@ |
||
22 | 22 | |
23 | 23 | protected function addURL($loc, $lastmod = false, $changefreq = 'monthly', $priority = .5) |
24 | 24 | { |
25 | - if(!$lastmod) |
|
25 | + if (!$lastmod) |
|
26 | 26 | $lastmod = $this->default_lastmod; |
27 | 27 | |
28 | 28 | $url = $this->xml->addChild('url'); |
@@ -22,8 +22,9 @@ |
||
22 | 22 | |
23 | 23 | protected function addURL($loc, $lastmod = false, $changefreq = 'monthly', $priority = .5) |
24 | 24 | { |
25 | - if(!$lastmod) |
|
26 | - $lastmod = $this->default_lastmod; |
|
25 | + if(!$lastmod) { |
|
26 | + $lastmod = $this->default_lastmod; |
|
27 | + } |
|
27 | 28 | |
28 | 29 | $url = $this->xml->addChild('url'); |
29 | 30 |
@@ -14,19 +14,19 @@ discard block |
||
14 | 14 | |
15 | 15 | protected function set_data() |
16 | 16 | { |
17 | - if(!Validate::checkRequest('post', 'name', 'name')) |
|
17 | + if (!Validate::checkRequest('post', 'name', 'name')) |
|
18 | 18 | return $this->fail_response('You must include a valid name.'); |
19 | - if(!Validate::checkRequest('post', 'email', 'email')) |
|
19 | + if (!Validate::checkRequest('post', 'email', 'email')) |
|
20 | 20 | return $this->fail_response('You must include a valid email.'); |
21 | - if(Request::getPost('website') && !Validate::checkRequest('post', 'website', 'url')) |
|
21 | + if (Request::getPost('website') && !Validate::checkRequest('post', 'website', 'url')) |
|
22 | 22 | return $this->fail_response('Please include a valid website.'); |
23 | - if(!Validate::checkRequest('post', 'comment', 'string')) |
|
23 | + if (!Validate::checkRequest('post', 'comment', 'string')) |
|
24 | 24 | return $this->fail_response('You must enter a comment.'); |
25 | - if(!Validate::checkRequest('post', 'save', 'boolean')) |
|
25 | + if (!Validate::checkRequest('post', 'save', 'boolean')) |
|
26 | 26 | return $this->fail_response('You entered an invalid save request.'); |
27 | - if(!Validate::checkRequest('post', 'notify', 'boolean')) |
|
27 | + if (!Validate::checkRequest('post', 'notify', 'boolean')) |
|
28 | 28 | return $this->fail_response('You entered an invalid notify request.'); |
29 | - if(Request::getPost('reply') && !Validate::checkRequest('post', 'reply', 'integer')) |
|
29 | + if (Request::getPost('reply') && !Validate::checkRequest('post', 'reply', 'integer')) |
|
30 | 30 | return $this->fail_response('You entered an invalid reply value.'); |
31 | 31 | |
32 | 32 | $referer_url = Request::getServer('HTTP_REFERER'); |
@@ -35,11 +35,11 @@ discard block |
||
35 | 35 | $url = array_pop($url); |
36 | 36 | $post = PostCollector::getPostByURI($url); |
37 | 37 | |
38 | - if($post === null) |
|
38 | + if ($post === null) |
|
39 | 39 | return $this->fail_response('There seems to be a problem with this page.', 'error'); |
40 | 40 | |
41 | 41 | $commentpage_result = CommentCollector::getCommentPageByURL($post->path, 2); |
42 | - if($commentpage_result === null) |
|
42 | + if ($commentpage_result === null) |
|
43 | 43 | { |
44 | 44 | $query = "INSERT INTO `jpemeric_comment`.`comment_page` (`site_id`, `url`) VALUES ('%d', '%s')"; |
45 | 45 | |
@@ -56,7 +56,7 @@ discard block |
||
56 | 56 | $save = (Request::getPost('save') == 'true') ? 1 : 0; |
57 | 57 | |
58 | 58 | $commenter_result = CommentCollector::getCommenterByFields(Request::getPost('name'), Request::getPost('email'), Request::getPost('website')); |
59 | - if($commenter_result === null) |
|
59 | + if ($commenter_result === null) |
|
60 | 60 | { |
61 | 61 | $query = "INSERT INTO `jpemeric_comment`.`commenter` (`name`,`email`,`url`,`save`) VALUES ('%s','%s','%s','%s')"; |
62 | 62 | |
@@ -70,7 +70,7 @@ discard block |
||
70 | 70 | } |
71 | 71 | else |
72 | 72 | { |
73 | - if($commenter_result->save !== $save) |
|
73 | + if ($commenter_result->save !== $save) |
|
74 | 74 | { |
75 | 75 | $query = "UPDATE `jpemeric_comment`.`commenter` SET `save` = '%s' WHERE `id` = '%d'"; |
76 | 76 | |
@@ -81,7 +81,7 @@ discard block |
||
81 | 81 | } |
82 | 82 | |
83 | 83 | $comment_result = CommentCollector::getCommentByBody(Request::getPost('comment')); |
84 | - if($comment_result === null) |
|
84 | + if ($comment_result === null) |
|
85 | 85 | { |
86 | 86 | $query = "INSERT INTO `jpemeric_comment`.`comment` (`body`) VALUES ('%s')"; |
87 | 87 | |
@@ -112,9 +112,9 @@ discard block |
||
112 | 112 | |
113 | 113 | $notification_result = CommentCollector::getNotificationForPage($commentpage_id); |
114 | 114 | |
115 | - foreach($notification_result as $notification_row) |
|
115 | + foreach ($notification_result as $notification_row) |
|
116 | 116 | { |
117 | - if($notification_row->email == $email) |
|
117 | + if ($notification_row->email == $email) |
|
118 | 118 | continue; |
119 | 119 | |
120 | 120 | $email_recipient_array[$notification_row->email] = array( |
@@ -123,7 +123,7 @@ discard block |
||
123 | 123 | } |
124 | 124 | |
125 | 125 | $message = "Hello!\nThere has been a new post on the post '{$post->title}' at Jacob Emerick's Blog. You have chosen to be notified of it - please reply to {$config->admin_email} if you do 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 {$referer_url}#comments to see and reply to all the comments on this post.\nThank you!"; |
126 | - foreach($email_recipient_array as $email_recipient) |
|
126 | + foreach ($email_recipient_array as $email_recipient) |
|
127 | 127 | { |
128 | 128 | $mail = new Mail(); |
129 | 129 | $mail->setToAddress($email_recipient['email'], $email_recipient['name']); |
@@ -132,7 +132,7 @@ discard block |
||
132 | 132 | $mail->send(); |
133 | 133 | } |
134 | 134 | |
135 | - if(Request::getPost('save') == true) |
|
135 | + if (Request::getPost('save') == true) |
|
136 | 136 | { |
137 | 137 | /* |
138 | 138 | $cookie = new Cookie('jpe_commenter'); |
@@ -14,20 +14,27 @@ discard block |
||
14 | 14 | |
15 | 15 | protected function set_data() |
16 | 16 | { |
17 | - if(!Validate::checkRequest('post', 'name', 'name')) |
|
18 | - return $this->fail_response('You must include a valid name.'); |
|
19 | - if(!Validate::checkRequest('post', 'email', 'email')) |
|
20 | - return $this->fail_response('You must include a valid email.'); |
|
21 | - if(Request::getPost('website') && !Validate::checkRequest('post', 'website', 'url')) |
|
22 | - return $this->fail_response('Please include a valid website.'); |
|
23 | - if(!Validate::checkRequest('post', 'comment', 'string')) |
|
24 | - return $this->fail_response('You must enter a comment.'); |
|
25 | - if(!Validate::checkRequest('post', 'save', 'boolean')) |
|
26 | - return $this->fail_response('You entered an invalid save request.'); |
|
27 | - if(!Validate::checkRequest('post', 'notify', 'boolean')) |
|
28 | - return $this->fail_response('You entered an invalid notify request.'); |
|
29 | - if(Request::getPost('reply') && !Validate::checkRequest('post', 'reply', 'integer')) |
|
30 | - return $this->fail_response('You entered an invalid reply value.'); |
|
17 | + if(!Validate::checkRequest('post', 'name', 'name')) { |
|
18 | + return $this->fail_response('You must include a valid name.'); |
|
19 | + } |
|
20 | + if(!Validate::checkRequest('post', 'email', 'email')) { |
|
21 | + return $this->fail_response('You must include a valid email.'); |
|
22 | + } |
|
23 | + if(Request::getPost('website') && !Validate::checkRequest('post', 'website', 'url')) { |
|
24 | + return $this->fail_response('Please include a valid website.'); |
|
25 | + } |
|
26 | + if(!Validate::checkRequest('post', 'comment', 'string')) { |
|
27 | + return $this->fail_response('You must enter a comment.'); |
|
28 | + } |
|
29 | + if(!Validate::checkRequest('post', 'save', 'boolean')) { |
|
30 | + return $this->fail_response('You entered an invalid save request.'); |
|
31 | + } |
|
32 | + if(!Validate::checkRequest('post', 'notify', 'boolean')) { |
|
33 | + return $this->fail_response('You entered an invalid notify request.'); |
|
34 | + } |
|
35 | + if(Request::getPost('reply') && !Validate::checkRequest('post', 'reply', 'integer')) { |
|
36 | + return $this->fail_response('You entered an invalid reply value.'); |
|
37 | + } |
|
31 | 38 | |
32 | 39 | $referer_url = Request::getServer('HTTP_REFERER'); |
33 | 40 | $url = explode('/', $referer_url); |
@@ -35,8 +42,9 @@ discard block |
||
35 | 42 | $url = array_pop($url); |
36 | 43 | $post = PostCollector::getPostByURI($url); |
37 | 44 | |
38 | - if($post === null) |
|
39 | - return $this->fail_response('There seems to be a problem with this page.', 'error'); |
|
45 | + if($post === null) { |
|
46 | + return $this->fail_response('There seems to be a problem with this page.', 'error'); |
|
47 | + } |
|
40 | 48 | |
41 | 49 | $commentpage_result = CommentCollector::getCommentPageByURL($post->path, 2); |
42 | 50 | if($commentpage_result === null) |
@@ -49,9 +57,9 @@ discard block |
||
49 | 57 | $query = sprintf($query, $site_id, $url); |
50 | 58 | Database::execute($query); |
51 | 59 | $commentpage_id = Database::lastInsertID(); |
52 | - } |
|
53 | - else |
|
54 | - $commentpage_id = $commentpage_result->id; |
|
60 | + } else { |
|
61 | + $commentpage_id = $commentpage_result->id; |
|
62 | + } |
|
55 | 63 | |
56 | 64 | $save = (Request::getPost('save') == 'true') ? 1 : 0; |
57 | 65 | |
@@ -67,8 +75,7 @@ discard block |
||
67 | 75 | $query = sprintf($query, $name, $email, $website, $save); |
68 | 76 | Database::execute($query); |
69 | 77 | $commenter_id = Database::lastInsertID(); |
70 | - } |
|
71 | - else |
|
78 | + } else |
|
72 | 79 | { |
73 | 80 | if($commenter_result->save !== $save) |
74 | 81 | { |
@@ -90,9 +97,9 @@ discard block |
||
90 | 97 | $query = sprintf($query, $body); |
91 | 98 | Database::execute($query); |
92 | 99 | $comment_id = Database::lastInsertID(); |
93 | - } |
|
94 | - else |
|
95 | - $comment_id = $comment_result->id; |
|
100 | + } else { |
|
101 | + $comment_id = $comment_result->id; |
|
102 | + } |
|
96 | 103 | |
97 | 104 | $query = "INSERT INTO `jpemeric_comment`.`comment_meta` (`commenter_id`,`comment_id`,`reply`,`notify`,`commentpage_id`,`date`,`display`) VALUES ('%d','%d','%d','%d','%d','%s','%d')"; |
98 | 105 | |
@@ -114,8 +121,9 @@ discard block |
||
114 | 121 | |
115 | 122 | foreach($notification_result as $notification_row) |
116 | 123 | { |
117 | - if($notification_row->email == $email) |
|
118 | - continue; |
|
124 | + if($notification_row->email == $email) { |
|
125 | + continue; |
|
126 | + } |
|
119 | 127 | |
120 | 128 | $email_recipient_array[$notification_row->email] = array( |
121 | 129 | 'email' => $notification_row->email, |
@@ -60,7 +60,7 @@ |
||
60 | 60 | 'values' => $values); |
61 | 61 | } |
62 | 62 | |
63 | - global $config; |
|
63 | + global $config; |
|
64 | 64 | $mail = Loader::loadNew('utility', 'Mail'); |
65 | 65 | $mail->setToAddress($config->admin_email, 'Jacob Emerick'); |
66 | 66 | $mail->setSubject('Home Page Contact'); |
@@ -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', |
@@ -35,17 +35,21 @@ |
||
35 | 35 | |
36 | 36 | private function process_form() |
37 | 37 | { |
38 | - if(!Request::hasPost() || Request::getPost('submit') != 'Send Message!') |
|
39 | - return (object) array('display' => 'normal'); |
|
38 | + if(!Request::hasPost() || Request::getPost('submit') != 'Send Message!') { |
|
39 | + return (object) array('display' => 'normal'); |
|
40 | + } |
|
40 | 41 | |
41 | 42 | Loader::load('utility', 'Validate'); |
42 | 43 | $error_result = array(); |
43 | - if(!Validate::checkRequest('post', 'name', 'string')) |
|
44 | - $error_result['name'] = 'please enter your name'; |
|
45 | - if(!Validate::checkRequest('post', 'email', 'string')) |
|
46 | - $error_result['email'] = 'please enter a valid email'; |
|
47 | - if(!Validate::checkRequest('post', 'message', 'string')) |
|
48 | - $error_result['message'] = 'please write a message'; |
|
44 | + if(!Validate::checkRequest('post', 'name', 'string')) { |
|
45 | + $error_result['name'] = 'please enter your name'; |
|
46 | + } |
|
47 | + if(!Validate::checkRequest('post', 'email', 'string')) { |
|
48 | + $error_result['email'] = 'please enter a valid email'; |
|
49 | + } |
|
50 | + if(!Validate::checkRequest('post', 'message', 'string')) { |
|
51 | + $error_result['message'] = 'please write a message'; |
|
52 | + } |
|
49 | 53 | |
50 | 54 | $values = (object) array( |
51 | 55 | 'name' => Request::getPost('name'), |
@@ -125,9 +125,9 @@ discard block |
||
125 | 125 | if(strlen($row->title) > 0) |
126 | 126 | $post->title .= " I was hiking up around the {$row->title} area."; |
127 | 127 | } |
128 | - else if ($row->type == 'walking') { |
|
129 | - $post->title = "Walked {$row->distance} miles and felt {$row->felt}."; |
|
130 | - } |
|
128 | + else if ($row->type == 'walking') { |
|
129 | + $post->title = "Walked {$row->distance} miles and felt {$row->felt}."; |
|
130 | + } |
|
131 | 131 | break; |
132 | 132 | case 'hulu' : |
133 | 133 | $row = HuluCollector::getRow($raw_post->type_id); |
@@ -194,11 +194,11 @@ discard block |
||
194 | 194 | Loader::load('view', URLDecode::getSite() . '/' . $view, $this->data_array['body']); |
195 | 195 | } |
196 | 196 | |
197 | - if (URLDecode::getSite() == 'waterfalls') { |
|
198 | - Loader::load('view', '/WaterfallFoot'); |
|
199 | - } else { |
|
200 | - Loader::load('view', '/Foot', array('tracking_code' => self::$TRACKING_CODE)); |
|
201 | - } |
|
197 | + if (URLDecode::getSite() == 'waterfalls') { |
|
198 | + Loader::load('view', '/WaterfallFoot'); |
|
199 | + } else { |
|
200 | + Loader::load('view', '/Foot', array('tracking_code' => self::$TRACKING_CODE)); |
|
201 | + } |
|
202 | 202 | |
203 | 203 | if($view == '/404' || $view == '/503') |
204 | 204 | exit; |
@@ -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; |
@@ -40,8 +40,9 @@ discard block |
||
40 | 40 | 'date' => date('Y'))); |
41 | 41 | |
42 | 42 | Loader::loadInstance('utility', 'Database'); |
43 | - if(Database::isConnected() === false) |
|
44 | - $this->unavailable(); |
|
43 | + if(Database::isConnected() === false) { |
|
44 | + $this->unavailable(); |
|
45 | + } |
|
45 | 46 | } |
46 | 47 | |
47 | 48 | protected function get_domain_container() |
@@ -97,8 +98,9 @@ discard block |
||
97 | 98 | $post->title = "Blogged about {$category}: <a href=\"{$row->url}\">{$row->title}</a>."; |
98 | 99 | $post->comments = $row->comments; |
99 | 100 | |
100 | - if($format == 'full') |
|
101 | - $post->image = Content::instance('FetchFirstPhoto', $row->body)->activate(false, 'standard'); |
|
101 | + if($format == 'full') { |
|
102 | + $post->image = Content::instance('FetchFirstPhoto', $row->body)->activate(false, 'standard'); |
|
103 | + } |
|
102 | 104 | break; |
103 | 105 | case 'book' : |
104 | 106 | $row = BookCollector::getRow($raw_post->type_id); |
@@ -106,8 +108,9 @@ discard block |
||
106 | 108 | $post->type = 'book'; |
107 | 109 | $post->title = "Just finished reading {$row->title} by {$row->author}."; |
108 | 110 | |
109 | - if($format == 'full') |
|
110 | - $post->image = "<img alt=\"{$row->title} by {$row->author}\" src=\"{$row->image}\" />"; |
|
111 | + if($format == 'full') { |
|
112 | + $post->image = "<img alt=\"{$row->title} by {$row->author}\" src=\"{$row->image}\" />"; |
|
113 | + } |
|
111 | 114 | break; |
112 | 115 | case 'distance' : |
113 | 116 | $row = DistanceCollector::getRow($raw_post->type_id); |
@@ -116,16 +119,16 @@ discard block |
||
116 | 119 | if($row->type == 'running') |
117 | 120 | { |
118 | 121 | $post->title = "Ran {$row->distance} miles and felt {$row->felt}."; |
119 | - if(strlen($row->message) > 0) |
|
120 | - $post->title .= " Afterwards, I was all like '{$row->message}'."; |
|
121 | - } |
|
122 | - else if($row->type == 'hiking') |
|
122 | + if(strlen($row->message) > 0) { |
|
123 | + $post->title .= " Afterwards, I was all like '{$row->message}'."; |
|
124 | + } |
|
125 | + } else if($row->type == 'hiking') |
|
123 | 126 | { |
124 | 127 | $post->title = "Hiked {$row->distance} miles and felt {$row->felt}."; |
125 | - if(strlen($row->title) > 0) |
|
126 | - $post->title .= " I was hiking up around the {$row->title} area."; |
|
127 | - } |
|
128 | - else if ($row->type == 'walking') { |
|
128 | + if(strlen($row->title) > 0) { |
|
129 | + $post->title .= " I was hiking up around the {$row->title} area."; |
|
130 | + } |
|
131 | + } else if ($row->type == 'walking') { |
|
129 | 132 | $post->title = "Walked {$row->distance} miles and felt {$row->felt}."; |
130 | 133 | } |
131 | 134 | break; |
@@ -140,10 +143,11 @@ discard block |
||
140 | 143 | |
141 | 144 | $post->type = 'twitter'; |
142 | 145 | |
143 | - if($format == 'full') |
|
144 | - $post->title = $row->text_formatted_full; |
|
145 | - else |
|
146 | - $post->title = $row->text_formatted; |
|
146 | + if($format == 'full') { |
|
147 | + $post->title = $row->text_formatted_full; |
|
148 | + } else { |
|
149 | + $post->title = $row->text_formatted; |
|
150 | + } |
|
147 | 151 | |
148 | 152 | $post->retweets = ($row->is_retweet == 0) ? $row->retweets : 0; |
149 | 153 | $post->favorites = ($row->is_retweet == 0) ? $row->favorites : 0; |
@@ -153,13 +157,15 @@ discard block |
||
153 | 157 | |
154 | 158 | $post->type = 'youtube'; |
155 | 159 | |
156 | - if($format == 'full') |
|
157 | - $post->title = "Favorited {$row->title} by {$row->author} on YouTube."; |
|
158 | - else |
|
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 | + if($format == 'full') { |
|
161 | + $post->title = "Favorited {$row->title} by {$row->author} on YouTube."; |
|
162 | + } else { |
|
163 | + $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."; |
|
164 | + } |
|
160 | 165 | |
161 | - if($format == 'full') |
|
162 | - $post->embed_code = "<iframe src=\"http://www.youtube.com/embed/{$row->video_id}?rel=0\" frameborder=\"0\" allowfullscreen></iframe>"; |
|
166 | + if($format == 'full') { |
|
167 | + $post->embed_code = "<iframe src=\"http://www.youtube.com/embed/{$row->video_id}?rel=0\" frameborder=\"0\" allowfullscreen></iframe>"; |
|
168 | + } |
|
163 | 169 | break; |
164 | 170 | } |
165 | 171 | |
@@ -188,10 +194,11 @@ discard block |
||
188 | 194 | Loader::load('view', '/Head', $this->data_array['head']); |
189 | 195 | foreach($this->body_view_array as $view) |
190 | 196 | { |
191 | - if(substr($view, 0, 1) == '/') |
|
192 | - Loader::load('view', $view, $this->data_array['body']); |
|
193 | - else |
|
194 | - Loader::load('view', URLDecode::getSite() . '/' . $view, $this->data_array['body']); |
|
197 | + if(substr($view, 0, 1) == '/') { |
|
198 | + Loader::load('view', $view, $this->data_array['body']); |
|
199 | + } else { |
|
200 | + Loader::load('view', URLDecode::getSite() . '/' . $view, $this->data_array['body']); |
|
201 | + } |
|
195 | 202 | } |
196 | 203 | |
197 | 204 | if (URLDecode::getSite() == 'waterfalls') { |
@@ -200,8 +207,9 @@ discard block |
||
200 | 207 | Loader::load('view', '/Foot', array('tracking_code' => self::$TRACKING_CODE)); |
201 | 208 | } |
202 | 209 | |
203 | - if($view == '/404' || $view == '/503') |
|
204 | - exit; |
|
210 | + if($view == '/404' || $view == '/503') { |
|
211 | + exit; |
|
212 | + } |
|
205 | 213 | } |
206 | 214 | |
207 | 215 | protected function set_header_method($method) |
@@ -261,11 +269,13 @@ discard block |
||
261 | 269 | |
262 | 270 | $js_array = array(); |
263 | 271 | |
264 | - if(count($this->js_array) > 0) |
|
265 | - $js_array = array_merge($js_array, $this->js_array); |
|
272 | + if(count($this->js_array) > 0) { |
|
273 | + $js_array = array_merge($js_array, $this->js_array); |
|
274 | + } |
|
266 | 275 | |
267 | - if(count($js_array) > 0) |
|
268 | - $js_array = Asset::getJS($js_array); |
|
276 | + if(count($js_array) > 0) { |
|
277 | + $js_array = Asset::getJS($js_array); |
|
278 | + } |
|
269 | 279 | |
270 | 280 | $this->set_head('css_link_array', $css_array); |
271 | 281 | $this->set_head('js_link_array', $js_array); |
@@ -278,14 +288,16 @@ discard block |
||
278 | 288 | |
279 | 289 | protected function eject() |
280 | 290 | { |
281 | - if(get_class($this) !== 'Error404Controller') |
|
282 | - Loader::loadNew('controller', '/Error404Controller')->activate(); |
|
291 | + if(get_class($this) !== 'Error404Controller') { |
|
292 | + Loader::loadNew('controller', '/Error404Controller')->activate(); |
|
293 | + } |
|
283 | 294 | } |
284 | 295 | |
285 | 296 | protected function unavailable() |
286 | 297 | { |
287 | - if(get_class($this) !== 'Error503Controller') |
|
288 | - Loader::loadNew('controller', '/Error503Controller')->activate(); |
|
298 | + if(get_class($this) !== 'Error503Controller') { |
|
299 | + Loader::loadNew('controller', '/Error503Controller')->activate(); |
|
300 | + } |
|
289 | 301 | } |
290 | 302 | |
291 | 303 | protected function redirect($uri, $method = 301) |
@@ -293,12 +305,14 @@ discard block |
||
293 | 305 | switch($method) |
294 | 306 | { |
295 | 307 | case 301 : |
296 | - if(get_class($this) !== 'Error301Controller') |
|
297 | - Loader::loadNew('controller', '/Error301Controller', array($uri))->activate(); |
|
308 | + if(get_class($this) !== 'Error301Controller') { |
|
309 | + Loader::loadNew('controller', '/Error301Controller', array($uri))->activate(); |
|
310 | + } |
|
298 | 311 | break; |
299 | 312 | case 303 : |
300 | - if(get_class($this) !== 'Error303Controller') |
|
301 | - Loader::loadNew('controller', '/Error303Controller', array($uri))->activate(); |
|
313 | + if(get_class($this) !== 'Error303Controller') { |
|
314 | + Loader::loadNew('controller', '/Error303Controller', array($uri))->activate(); |
|
315 | + } |
|
302 | 316 | break; |
303 | 317 | } |
304 | 318 | } |
@@ -345,18 +359,19 @@ discard block |
||
345 | 359 | $comment_object->url = $comment->url; |
346 | 360 | $comment_object->trusted = $comment->trusted; |
347 | 361 | |
348 | - if($comment->reply == 0 && Request::getPost('type') == $comment->id) |
|
349 | - $comment_object->errors = $this->comment_errors; |
|
350 | - else |
|
351 | - $comment_object->errors = array(); |
|
362 | + if($comment->reply == 0 && Request::getPost('type') == $comment->id) { |
|
363 | + $comment_object->errors = $this->comment_errors; |
|
364 | + } else { |
|
365 | + $comment_object->errors = array(); |
|
366 | + } |
|
352 | 367 | |
353 | 368 | if($comment->reply == 0) |
354 | 369 | { |
355 | 370 | $comment_object->replies = array(); |
356 | 371 | $comment_array[$comment->id] = $comment_object; |
357 | - } |
|
358 | - else |
|
359 | - $comment_array[$comment->reply]->replies[$comment->id] = $comment_object; |
|
372 | + } else { |
|
373 | + $comment_array[$comment->reply]->replies[$comment->id] = $comment_object; |
|
374 | + } |
|
360 | 375 | } |
361 | 376 | |
362 | 377 | $comment_count = CommentCollector::getCommentCountForURL($site, $path); |
@@ -381,22 +396,26 @@ discard block |
||
381 | 396 | $commenter->website = ''; |
382 | 397 | |
383 | 398 | $commenter_cookie = Cookie::instance('Commenter'); |
384 | - if(!$commenter_cookie->exists()) |
|
385 | - return $commenter; |
|
399 | + if(!$commenter_cookie->exists()) { |
|
400 | + return $commenter; |
|
401 | + } |
|
386 | 402 | |
387 | 403 | $commenter_cookie_value = $commenter_cookie->getValue(); |
388 | 404 | $commenter_cookie_value = json_decode($commenter_cookie_value); |
389 | 405 | |
390 | - if($commenter_cookie_value === NULL) |
|
391 | - return $commenter; |
|
406 | + if($commenter_cookie_value === NULL) { |
|
407 | + return $commenter; |
|
408 | + } |
|
392 | 409 | |
393 | - if(!isset($commenter_cookie_value->name) || !isset($commenter_cookie_value->email)) |
|
394 | - return $commenter; |
|
410 | + if(!isset($commenter_cookie_value->name) || !isset($commenter_cookie_value->email)) { |
|
411 | + return $commenter; |
|
412 | + } |
|
395 | 413 | |
396 | 414 | $commenter_object = CommentCollector::getCommenterByFields($commenter_cookie_value->name, $commenter_cookie_value->email, (isset($commenter_cookie_value->website) ? $commenter_cookie_value->website : '')); |
397 | 415 | |
398 | - if($commenter_object === NULL) |
|
399 | - return $commenter; |
|
416 | + if($commenter_object === NULL) { |
|
417 | + return $commenter; |
|
418 | + } |
|
400 | 419 | |
401 | 420 | $commenter->id = $commenter_object->id; |
402 | 421 | $commenter->name = $commenter_object->name; |
@@ -1,231 +1,231 @@ |
||
1 | 1 | <? |
2 | 2 | |
3 | 3 | Loader::load('collector', array( |
4 | - 'image/AlbumCollector', |
|
5 | - 'waterfall/WatercourseCollector', |
|
6 | - 'waterfall/WaterfallCollector', |
|
7 | - 'waterfall/LogCollector')); |
|
4 | + 'image/AlbumCollector', |
|
5 | + 'waterfall/WatercourseCollector', |
|
6 | + 'waterfall/WaterfallCollector', |
|
7 | + 'waterfall/LogCollector')); |
|
8 | 8 | Loader::load('controller', 'waterfalls/DefaultPageController'); |
9 | 9 | |
10 | 10 | final class WaterfallController extends DefaultPageController |
11 | 11 | { |
12 | 12 | |
13 | - private static $STANDARD_IMAGE_NODE = '<img src="/photo/%s/%s-size-standard.jpg" alt="%s" height="600" width="800" />'; |
|
14 | - |
|
15 | - private static $FULL_IMAGE_LINK = '/photo/%s/%s-size-standard.jpg'; |
|
16 | - private static $THUMB_IMAGE_NODE = '<img src="/photo/%s/%s-size-thumb.jpg" alt="%s" height="%s" width="%s" />'; |
|
17 | - private static $MEDIUM_IMAGE_NODE = '<img src="/photo/%s/%s-size-medium.jpg" alt="%s" height="375" width="500" />'; |
|
18 | - |
|
19 | - private $waterfall; |
|
20 | - |
|
21 | - public function __construct() |
|
22 | - { |
|
23 | - parent::__construct(); |
|
24 | - |
|
25 | - $path_watercourse = URLDecode::getPiece(1); |
|
26 | - $path_fall = URLDecode::getPiece(2); |
|
27 | - |
|
28 | - $this->waterfall = WaterfallCollector::getByAlias($path_watercourse, $path_fall); |
|
29 | - if (!$this->waterfall) { |
|
30 | - $this->eject(); |
|
31 | - } |
|
32 | - |
|
33 | - $this->handle_comment_submit( |
|
34 | - self::$WATERFALL_SITE_ID, |
|
35 | - "{$this->waterfall->watercourse_alias}/{$this->waterfall->alias}", |
|
36 | - Loader::getRootUrl('waterfalls') . "{$this->waterfall->watercourse_alias}/{$this->waterfall->alias}/", |
|
37 | - $this->waterfall->name); |
|
38 | - |
|
39 | - $this->add_waterfall_js(); |
|
40 | - } |
|
41 | - |
|
42 | - protected function set_head_data() |
|
43 | - { |
|
44 | - parent::set_head_data(); |
|
45 | - |
|
46 | - $this->set_title("{$this->waterfall->name} on {$this->waterfall->watercourse} | " . self::$WEBSITE_TITLE); |
|
47 | - $this->set_description($this->waterfall->description); |
|
48 | - $this->set_keywords((array) $this->waterfall->name); |
|
49 | - } |
|
50 | - |
|
51 | - protected function set_body_data($page_type = 'normal') |
|
52 | - { |
|
53 | - parent::set_body_data($page_type); |
|
54 | - |
|
55 | - $body_data = $this->format_waterfall_data($this->waterfall); |
|
56 | - $body_data['comment_array'] = $this->get_comment_array(self::$WATERFALL_SITE_ID, "{$this->waterfall->watercourse_alias}/{$this->waterfall->alias}"); |
|
57 | - |
|
58 | - $this->set_body('data', $body_data); |
|
59 | - |
|
60 | - $this->set_body('view', 'Fall'); |
|
61 | - } |
|
62 | - |
|
63 | - private function format_waterfall_data($waterfall) |
|
64 | - { |
|
65 | - $waterfall_data = array(); |
|
66 | - $waterfall_data['introduction'] = $this->get_waterfall_introduction($waterfall); |
|
67 | - $waterfall_data['name'] = $waterfall->name; |
|
68 | - $waterfall_data['watercourse'] = $waterfall->watercourse; |
|
69 | - $waterfall_data['path'] = "/{$waterfall->watercourse_alias}/{$waterfall->alias}/"; |
|
70 | - $waterfall_data['tagline'] = $waterfall->introduction; |
|
71 | - $waterfall_data['main_photo'] = sprintf(self::$STANDARD_IMAGE_NODE, $waterfall->photo_category, $waterfall->photo, $waterfall->photo_description); |
|
72 | - $waterfall_data['album'] = $this->get_album(); |
|
73 | - $waterfall_data['body'] = $this->format_waterfall_content($waterfall->body); |
|
74 | - $waterfall_data['directions'] = $this->format_waterfall_content($waterfall->directions); |
|
75 | - $waterfall_data['sidebar'] = $this->get_sidebar($waterfall); |
|
76 | - |
|
77 | - return $waterfall_data; |
|
78 | - } |
|
79 | - |
|
80 | - private function get_waterfall_introduction($waterfall) |
|
81 | - { |
|
82 | - return array( |
|
83 | - 'path' => "/{$waterfall->watercourse_alias}/{$waterfall->alias}/", |
|
84 | - 'name' => $waterfall->name, |
|
85 | - 'watercourse' => $waterfall->watercourse, |
|
86 | - 'tagline' => $waterfall->introduction, |
|
87 | - ); |
|
88 | - } |
|
89 | - |
|
90 | - private function get_main_watercourse($alias) |
|
91 | - { |
|
92 | - $watercourse = WatercourseCollector::getByAlias($alias); |
|
93 | - if ($watercourse->parent != 0) { |
|
94 | - $watercourse = WatercourseCollector::getById($watercourse->parent); |
|
95 | - } |
|
96 | - |
|
97 | - return (object) array( |
|
98 | - 'name' => $watercourse->name, |
|
99 | - 'title' => $watercourse->name, |
|
100 | - 'alias' => $watercourse->alias, |
|
101 | - ); |
|
102 | - } |
|
103 | - |
|
104 | - private function format_waterfall_content($content) |
|
105 | - { |
|
106 | - $content = Content::instance('FixInternalLink', $content)->activate(); |
|
107 | - |
|
108 | - return $content; |
|
109 | - } |
|
110 | - |
|
111 | - private function get_album() |
|
112 | - { |
|
113 | - $album = array(); |
|
114 | - |
|
115 | - if($this->waterfall->album == 0) |
|
116 | - return $album; |
|
117 | - |
|
118 | - $photo_list = AlbumCollector::getPhotoListForAlbum($this->waterfall->album); |
|
119 | - foreach($photo_list as $photo) |
|
120 | - { |
|
121 | - $photo_array = array(); |
|
122 | - $photo_array['full_link'] = sprintf(self::$FULL_IMAGE_LINK, $photo->category, $photo->name); |
|
123 | - $photo_array['description'] = $photo->description; |
|
13 | + private static $STANDARD_IMAGE_NODE = '<img src="/photo/%s/%s-size-standard.jpg" alt="%s" height="600" width="800" />'; |
|
14 | + |
|
15 | + private static $FULL_IMAGE_LINK = '/photo/%s/%s-size-standard.jpg'; |
|
16 | + private static $THUMB_IMAGE_NODE = '<img src="/photo/%s/%s-size-thumb.jpg" alt="%s" height="%s" width="%s" />'; |
|
17 | + private static $MEDIUM_IMAGE_NODE = '<img src="/photo/%s/%s-size-medium.jpg" alt="%s" height="375" width="500" />'; |
|
18 | + |
|
19 | + private $waterfall; |
|
20 | + |
|
21 | + public function __construct() |
|
22 | + { |
|
23 | + parent::__construct(); |
|
24 | + |
|
25 | + $path_watercourse = URLDecode::getPiece(1); |
|
26 | + $path_fall = URLDecode::getPiece(2); |
|
27 | + |
|
28 | + $this->waterfall = WaterfallCollector::getByAlias($path_watercourse, $path_fall); |
|
29 | + if (!$this->waterfall) { |
|
30 | + $this->eject(); |
|
31 | + } |
|
32 | + |
|
33 | + $this->handle_comment_submit( |
|
34 | + self::$WATERFALL_SITE_ID, |
|
35 | + "{$this->waterfall->watercourse_alias}/{$this->waterfall->alias}", |
|
36 | + Loader::getRootUrl('waterfalls') . "{$this->waterfall->watercourse_alias}/{$this->waterfall->alias}/", |
|
37 | + $this->waterfall->name); |
|
38 | + |
|
39 | + $this->add_waterfall_js(); |
|
40 | + } |
|
41 | + |
|
42 | + protected function set_head_data() |
|
43 | + { |
|
44 | + parent::set_head_data(); |
|
45 | + |
|
46 | + $this->set_title("{$this->waterfall->name} on {$this->waterfall->watercourse} | " . self::$WEBSITE_TITLE); |
|
47 | + $this->set_description($this->waterfall->description); |
|
48 | + $this->set_keywords((array) $this->waterfall->name); |
|
49 | + } |
|
50 | + |
|
51 | + protected function set_body_data($page_type = 'normal') |
|
52 | + { |
|
53 | + parent::set_body_data($page_type); |
|
54 | + |
|
55 | + $body_data = $this->format_waterfall_data($this->waterfall); |
|
56 | + $body_data['comment_array'] = $this->get_comment_array(self::$WATERFALL_SITE_ID, "{$this->waterfall->watercourse_alias}/{$this->waterfall->alias}"); |
|
57 | + |
|
58 | + $this->set_body('data', $body_data); |
|
59 | + |
|
60 | + $this->set_body('view', 'Fall'); |
|
61 | + } |
|
62 | + |
|
63 | + private function format_waterfall_data($waterfall) |
|
64 | + { |
|
65 | + $waterfall_data = array(); |
|
66 | + $waterfall_data['introduction'] = $this->get_waterfall_introduction($waterfall); |
|
67 | + $waterfall_data['name'] = $waterfall->name; |
|
68 | + $waterfall_data['watercourse'] = $waterfall->watercourse; |
|
69 | + $waterfall_data['path'] = "/{$waterfall->watercourse_alias}/{$waterfall->alias}/"; |
|
70 | + $waterfall_data['tagline'] = $waterfall->introduction; |
|
71 | + $waterfall_data['main_photo'] = sprintf(self::$STANDARD_IMAGE_NODE, $waterfall->photo_category, $waterfall->photo, $waterfall->photo_description); |
|
72 | + $waterfall_data['album'] = $this->get_album(); |
|
73 | + $waterfall_data['body'] = $this->format_waterfall_content($waterfall->body); |
|
74 | + $waterfall_data['directions'] = $this->format_waterfall_content($waterfall->directions); |
|
75 | + $waterfall_data['sidebar'] = $this->get_sidebar($waterfall); |
|
76 | + |
|
77 | + return $waterfall_data; |
|
78 | + } |
|
79 | + |
|
80 | + private function get_waterfall_introduction($waterfall) |
|
81 | + { |
|
82 | + return array( |
|
83 | + 'path' => "/{$waterfall->watercourse_alias}/{$waterfall->alias}/", |
|
84 | + 'name' => $waterfall->name, |
|
85 | + 'watercourse' => $waterfall->watercourse, |
|
86 | + 'tagline' => $waterfall->introduction, |
|
87 | + ); |
|
88 | + } |
|
89 | + |
|
90 | + private function get_main_watercourse($alias) |
|
91 | + { |
|
92 | + $watercourse = WatercourseCollector::getByAlias($alias); |
|
93 | + if ($watercourse->parent != 0) { |
|
94 | + $watercourse = WatercourseCollector::getById($watercourse->parent); |
|
95 | + } |
|
96 | + |
|
97 | + return (object) array( |
|
98 | + 'name' => $watercourse->name, |
|
99 | + 'title' => $watercourse->name, |
|
100 | + 'alias' => $watercourse->alias, |
|
101 | + ); |
|
102 | + } |
|
103 | + |
|
104 | + private function format_waterfall_content($content) |
|
105 | + { |
|
106 | + $content = Content::instance('FixInternalLink', $content)->activate(); |
|
107 | + |
|
108 | + return $content; |
|
109 | + } |
|
110 | + |
|
111 | + private function get_album() |
|
112 | + { |
|
113 | + $album = array(); |
|
114 | + |
|
115 | + if($this->waterfall->album == 0) |
|
116 | + return $album; |
|
117 | + |
|
118 | + $photo_list = AlbumCollector::getPhotoListForAlbum($this->waterfall->album); |
|
119 | + foreach($photo_list as $photo) |
|
120 | + { |
|
121 | + $photo_array = array(); |
|
122 | + $photo_array['full_link'] = sprintf(self::$FULL_IMAGE_LINK, $photo->category, $photo->name); |
|
123 | + $photo_array['description'] = $photo->description; |
|
124 | 124 | |
125 | - if($photo->height < $photo->width) |
|
126 | - list($height, $width) = array(75, 100); |
|
127 | - else |
|
128 | - list($height, $width) = array(100, 75); |
|
125 | + if($photo->height < $photo->width) |
|
126 | + list($height, $width) = array(75, 100); |
|
127 | + else |
|
128 | + list($height, $width) = array(100, 75); |
|
129 | 129 | |
130 | - $photo_array['image_node'] = sprintf( |
|
131 | - self::$THUMB_IMAGE_NODE, |
|
132 | - $photo->category, |
|
133 | - $photo->name, |
|
134 | - $photo->description, |
|
135 | - $height, |
|
136 | - $width); |
|
130 | + $photo_array['image_node'] = sprintf( |
|
131 | + self::$THUMB_IMAGE_NODE, |
|
132 | + $photo->category, |
|
133 | + $photo->name, |
|
134 | + $photo->description, |
|
135 | + $height, |
|
136 | + $width); |
|
137 | 137 | |
138 | - $album[] = (object) $photo_array; |
|
139 | - } |
|
138 | + $album[] = (object) $photo_array; |
|
139 | + } |
|
140 | 140 | |
141 | - return $album; |
|
142 | - } |
|
141 | + return $album; |
|
142 | + } |
|
143 | 143 | |
144 | 144 | private function get_sidebar($waterfall) |
145 | 145 | { |
146 | 146 | $sidebar_data = array(); |
147 | 147 | $sidebar_data['name'] = $waterfall->name; |
148 | 148 | $sidebar_data['watercourse'] = $waterfall->watercourse; |
149 | - $sidebar_data['main_watercourse'] = $this->get_main_watercourse($waterfall->watercourse_alias); |
|
149 | + $sidebar_data['main_watercourse'] = $this->get_main_watercourse($waterfall->watercourse_alias); |
|
150 | 150 | $sidebar_data['rating_display'] = ($waterfall->rating / 2) . '/5'; |
151 | - $sidebar_data['rating'] = $waterfall->rating; |
|
151 | + $sidebar_data['rating'] = $waterfall->rating; |
|
152 | 152 | $sidebar_data['height'] = Content::instance('ImperialUnit', $waterfall->height)->activate('inches'); |
153 | 153 | $sidebar_data['width'] = Content::instance('ImperialUnit', $waterfall->width)->activate('inches'); |
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 ( |
|
158 | - 'name' => $waterfall->county, |
|
159 | - 'alias' => $waterfall->county_alias, |
|
160 | - 'title' => $waterfall->county_title, |
|
161 | - ); |
|
157 | + $sidebar_data['county'] = (object) array ( |
|
158 | + 'name' => $waterfall->county, |
|
159 | + 'alias' => $waterfall->county_alias, |
|
160 | + 'title' => $waterfall->county_title, |
|
161 | + ); |
|
162 | 162 | |
163 | 163 | $sidebar_data['nearest_town'] = $waterfall->nearest_town; |
164 | 164 | $sidebar_data['latitude'] = round($waterfall->latitude, 5); |
165 | 165 | $sidebar_data['longitude'] = round($waterfall->longitude, 5); |
166 | 166 | $sidebar_data['elevation'] = Content::instance('ImperialUnit', $waterfall->elevation)->activate('feet'); |
167 | 167 | |
168 | - $sidebar_data['map'] = $this->get_map_piece($waterfall); |
|
168 | + $sidebar_data['map'] = $this->get_map_piece($waterfall); |
|
169 | 169 | |
170 | - $sidebar_data['journal_list'] = $this->get_journal_list($waterfall->id); |
|
170 | + $sidebar_data['journal_list'] = $this->get_journal_list($waterfall->id); |
|
171 | 171 | |
172 | - $sidebar_data['nearby_list'] = $this->get_nearby_list($waterfall->id); |
|
172 | + $sidebar_data['nearby_list'] = $this->get_nearby_list($waterfall->id); |
|
173 | 173 | |
174 | 174 | return $sidebar_data; |
175 | 175 | } |
176 | 176 | |
177 | - private function get_journal_list($waterfall) |
|
178 | - { |
|
179 | - $list = array(); |
|
180 | - $log_result = LogCollector::getLogListForWaterfall($waterfall); |
|
181 | - foreach ($log_result as $log_row) { |
|
182 | - $list[] = (object) array( |
|
183 | - 'date' => date('F j, Y', strtotime($log_row->date)), |
|
184 | - 'title' => $log_row->title, |
|
185 | - 'url' => "/journal/{$log_row->alias}/", |
|
186 | - ); |
|
187 | - } |
|
188 | - |
|
189 | - return $list; |
|
190 | - } |
|
191 | - |
|
192 | - private function get_map_piece($waterfall) |
|
193 | - { |
|
194 | - $map_holder = array(); |
|
195 | - |
|
196 | - $url = 'http://maps.googleapis.com/maps/api/staticmap'; |
|
197 | - $url .= "?center={$waterfall->latitude},{$waterfall->longitude}"; |
|
198 | - $url .= "&zoom=8"; |
|
199 | - $url .= "&maptype=terrain"; |
|
200 | - $url .= "&size=230x200"; |
|
201 | - $url .= "&markers=color:red|size:small|{$waterfall->latitude},{$waterfall->longitude}"; |
|
202 | - $url .= "&sensor=false"; |
|
203 | - $url .= "&key=AIzaSyA3eWALjUTSIa44KsbOUYRpG0oMd3aNo00"; |
|
204 | - |
|
205 | - $image = "<img src=\"{$url}\" height=\"200\" width=\"230\" alt=\"{$waterfall->name} Location\" />"; |
|
206 | - $map_holder['image'] = $image; |
|
207 | - |
|
208 | - $map_holder['uri'] = '/map/'; |
|
209 | - $map_holder['title'] = "View {$waterfall->name} on a larger map"; |
|
210 | - |
|
211 | - return (object) $map_holder; |
|
212 | - } |
|
213 | - |
|
214 | - private function get_nearby_list($waterfall) |
|
215 | - { |
|
216 | - $nearby_list = array(); |
|
217 | - |
|
218 | - $result = WaterfallCollector::getNearbyList($waterfall); |
|
219 | - foreach ($result as $row) { |
|
220 | - $nearby_list[] = (object) array( |
|
221 | - 'url' => "/{$row->watercourse_alias}/{$row->alias}/", |
|
222 | - 'anchor' => $row->name, |
|
223 | - 'title' => "{$row->name} of {$row->watercourse}", |
|
224 | - 'distance' => Content::instance('ImperialUnit', $row->distance)->activate(false), |
|
225 | - ); |
|
226 | - } |
|
227 | - |
|
228 | - return $nearby_list; |
|
229 | - } |
|
177 | + private function get_journal_list($waterfall) |
|
178 | + { |
|
179 | + $list = array(); |
|
180 | + $log_result = LogCollector::getLogListForWaterfall($waterfall); |
|
181 | + foreach ($log_result as $log_row) { |
|
182 | + $list[] = (object) array( |
|
183 | + 'date' => date('F j, Y', strtotime($log_row->date)), |
|
184 | + 'title' => $log_row->title, |
|
185 | + 'url' => "/journal/{$log_row->alias}/", |
|
186 | + ); |
|
187 | + } |
|
188 | + |
|
189 | + return $list; |
|
190 | + } |
|
191 | + |
|
192 | + private function get_map_piece($waterfall) |
|
193 | + { |
|
194 | + $map_holder = array(); |
|
195 | + |
|
196 | + $url = 'http://maps.googleapis.com/maps/api/staticmap'; |
|
197 | + $url .= "?center={$waterfall->latitude},{$waterfall->longitude}"; |
|
198 | + $url .= "&zoom=8"; |
|
199 | + $url .= "&maptype=terrain"; |
|
200 | + $url .= "&size=230x200"; |
|
201 | + $url .= "&markers=color:red|size:small|{$waterfall->latitude},{$waterfall->longitude}"; |
|
202 | + $url .= "&sensor=false"; |
|
203 | + $url .= "&key=AIzaSyA3eWALjUTSIa44KsbOUYRpG0oMd3aNo00"; |
|
204 | + |
|
205 | + $image = "<img src=\"{$url}\" height=\"200\" width=\"230\" alt=\"{$waterfall->name} Location\" />"; |
|
206 | + $map_holder['image'] = $image; |
|
207 | + |
|
208 | + $map_holder['uri'] = '/map/'; |
|
209 | + $map_holder['title'] = "View {$waterfall->name} on a larger map"; |
|
210 | + |
|
211 | + return (object) $map_holder; |
|
212 | + } |
|
213 | + |
|
214 | + private function get_nearby_list($waterfall) |
|
215 | + { |
|
216 | + $nearby_list = array(); |
|
217 | + |
|
218 | + $result = WaterfallCollector::getNearbyList($waterfall); |
|
219 | + foreach ($result as $row) { |
|
220 | + $nearby_list[] = (object) array( |
|
221 | + 'url' => "/{$row->watercourse_alias}/{$row->alias}/", |
|
222 | + 'anchor' => $row->name, |
|
223 | + 'title' => "{$row->name} of {$row->watercourse}", |
|
224 | + 'distance' => Content::instance('ImperialUnit', $row->distance)->activate(false), |
|
225 | + ); |
|
226 | + } |
|
227 | + |
|
228 | + return $nearby_list; |
|
229 | + } |
|
230 | 230 | |
231 | 231 | } |
232 | 232 | \ No newline at end of file |
@@ -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, |
@@ -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,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(); |
@@ -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 | } |