@@ -46,7 +46,7 @@ discard block |
||
46 | 46 | |
47 | 47 | private function get_title() |
48 | 48 | { |
49 | - switch($this->tag) |
|
49 | + switch ($this->tag) |
|
50 | 50 | { |
51 | 51 | case 'blog' : |
52 | 52 | return 'Jacob has a Blog'; |
@@ -71,7 +71,7 @@ discard block |
||
71 | 71 | |
72 | 72 | private function get_description() |
73 | 73 | { |
74 | - switch($this->tag) |
|
74 | + switch ($this->tag) |
|
75 | 75 | { |
76 | 76 | case 'blog' : |
77 | 77 | return 'Yeah, Jacob has a blog. Check out his posting activity.'; |
@@ -97,7 +97,7 @@ discard block |
||
97 | 97 | protected function get_page_number() |
98 | 98 | { |
99 | 99 | $page = URLDecode::getPiece(3); |
100 | - if(isset($page) && is_numeric($page)) |
|
100 | + if (isset($page) && is_numeric($page)) |
|
101 | 101 | return $page; |
102 | 102 | return 1; |
103 | 103 | } |
@@ -117,16 +117,16 @@ discard block |
||
117 | 117 | |
118 | 118 | protected function get_list_next_link() |
119 | 119 | { |
120 | - if($this->page == 1) |
|
120 | + if ($this->page == 1) |
|
121 | 121 | return; |
122 | - if($this->page == 2) |
|
122 | + if ($this->page == 2) |
|
123 | 123 | return Loader::getRootUrl('lifestream') . $this->tag . '/'; |
124 | 124 | return Loader::getRootUrl('lifestream') . $this->tag . '/page/' . ($this->page - 1) . '/'; |
125 | 125 | } |
126 | 126 | |
127 | 127 | protected function get_list_prev_link() |
128 | 128 | { |
129 | - if(($this->page * self::$POSTS_PER_PAGE) >= $this->get_total_post_count()) |
|
129 | + if (($this->page * self::$POSTS_PER_PAGE) >= $this->get_total_post_count()) |
|
130 | 130 | return; |
131 | 131 | return Loader::getRootUrl('lifestream') . $this->tag . '/page/' . ($this->page + 1) . '/'; |
132 | 132 | } |
@@ -134,7 +134,7 @@ discard block |
||
134 | 134 | private $total_post_count; |
135 | 135 | protected function get_total_post_count() |
136 | 136 | { |
137 | - if(!isset($this->total_post_count)) |
|
137 | + if (!isset($this->total_post_count)) |
|
138 | 138 | $this->total_post_count = ActivityCollector::getCountForTag($this->tag); |
139 | 139 | return $this->total_post_count; |
140 | 140 | } |
@@ -38,7 +38,7 @@ discard block |
||
38 | 38 | protected function get_page_number() |
39 | 39 | { |
40 | 40 | $page = URLDecode::getPiece(2); |
41 | - if(isset($page) && is_numeric($page)) |
|
41 | + if (isset($page) && is_numeric($page)) |
|
42 | 42 | return $page; |
43 | 43 | return 1; |
44 | 44 | } |
@@ -58,16 +58,16 @@ discard block |
||
58 | 58 | |
59 | 59 | protected function get_list_next_link() |
60 | 60 | { |
61 | - if($this->page == 1) |
|
61 | + if ($this->page == 1) |
|
62 | 62 | return; |
63 | - if($this->page == 2) |
|
63 | + if ($this->page == 2) |
|
64 | 64 | return Loader::getRootUrl('lifestream'); |
65 | 65 | return Loader::getRootUrl('lifestream') . 'page/' . ($this->page - 1) . '/'; |
66 | 66 | } |
67 | 67 | |
68 | 68 | protected function get_list_prev_link() |
69 | 69 | { |
70 | - if(($this->page * self::$POSTS_PER_PAGE) >= $this->get_total_post_count()) |
|
70 | + if (($this->page * self::$POSTS_PER_PAGE) >= $this->get_total_post_count()) |
|
71 | 71 | return; |
72 | 72 | return Loader::getRootUrl('lifestream') . 'page/' . ($this->page + 1) . '/'; |
73 | 73 | } |
@@ -75,7 +75,7 @@ discard block |
||
75 | 75 | private $total_post_count; |
76 | 76 | protected function get_total_post_count() |
77 | 77 | { |
78 | - if(!isset($this->total_post_count)) |
|
78 | + if (!isset($this->total_post_count)) |
|
79 | 79 | $this->total_post_count = ActivityCollector::getCount(); |
80 | 80 | return $this->total_post_count; |
81 | 81 | } |
@@ -9,19 +9,19 @@ discard block |
||
9 | 9 | final class BlogSitemapController extends SitemapController |
10 | 10 | { |
11 | 11 | |
12 | - private static $HOME_PAGE_RANK = .9; |
|
13 | - private static $CATEGORY_PAGE_RANK = .3; |
|
14 | - private static $TAG_PAGE_RANK = .2; |
|
15 | - private static $PAGINATED_PAGE_RANK = .1; |
|
16 | - private static $POST_PAGE_RANK = .8; |
|
12 | + private static $HOME_PAGE_RANK = .9; |
|
13 | + private static $CATEGORY_PAGE_RANK = .3; |
|
14 | + private static $TAG_PAGE_RANK = .2; |
|
15 | + private static $PAGINATED_PAGE_RANK = .1; |
|
16 | + private static $POST_PAGE_RANK = .8; |
|
17 | 17 | |
18 | 18 | private static $HOME_PAGE_CHANGEFREQ = 'daily'; |
19 | - private static $CATEGORY_PAGE_CHANGEFREQ = 'weekly'; |
|
19 | + private static $CATEGORY_PAGE_CHANGEFREQ = 'weekly'; |
|
20 | 20 | private static $TAG_PAGE_CHANGEFREQ = 'monthly'; |
21 | - private static $PAGINATED_PAGE_CHANGEFREQ = 'monthly'; |
|
21 | + private static $PAGINATED_PAGE_CHANGEFREQ = 'monthly'; |
|
22 | 22 | private static $POST_PAGE_CHANGEFREQ = 'weekly'; |
23 | 23 | |
24 | - private static $POSTS_PER_PAGE = 10; |
|
24 | + private static $POSTS_PER_PAGE = 10; |
|
25 | 25 | |
26 | 26 | private static $CATEGORY_ARRAY = array( |
27 | 27 | 'hiking', |
@@ -50,7 +50,7 @@ discard block |
||
50 | 50 | { |
51 | 51 | $categories = self::$CATEGORY_ARRAY; |
52 | 52 | |
53 | - foreach($categories as $category) |
|
53 | + foreach ($categories as $category) |
|
54 | 54 | { |
55 | 55 | $post_count = PostCollector::getPostCountForCategory($category); |
56 | 56 | |
@@ -63,7 +63,7 @@ discard block |
||
63 | 63 | { |
64 | 64 | $tags = TagCollector::getAllTags(); |
65 | 65 | |
66 | - foreach($tags as $tag) |
|
66 | + foreach ($tags as $tag) |
|
67 | 67 | { |
68 | 68 | $post_count = PostCollector::getPostCountForTag($tag->id); |
69 | 69 | |
@@ -76,7 +76,7 @@ discard block |
||
76 | 76 | { |
77 | 77 | $posts = PostCollector::getMainList(500); |
78 | 78 | |
79 | - foreach($posts as $post) |
|
79 | + foreach ($posts as $post) |
|
80 | 80 | { |
81 | 81 | $base_url = "{$post->category}/{$post->path}/"; |
82 | 82 | $this->addURL($base_url, date('Y-m-d', strtotime('last Monday')), self::$POST_PAGE_CHANGEFREQ, self::$POST_PAGE_RANK); |
@@ -85,7 +85,7 @@ discard block |
||
85 | 85 | |
86 | 86 | private function add_paginated_pages($post_count, $base_url, $changefreq, $rank) |
87 | 87 | { |
88 | - switch($changefreq) |
|
88 | + switch ($changefreq) |
|
89 | 89 | { |
90 | 90 | case 'daily' : |
91 | 91 | $lastmod = date('Y-m-d'); |
@@ -99,7 +99,7 @@ discard block |
||
99 | 99 | } |
100 | 100 | |
101 | 101 | $this->addURL($base_url, $lastmod, $changefreq, $rank); |
102 | - for($i = 2; (($i - 1) * self::$POSTS_PER_PAGE) < $post_count; $i++) |
|
102 | + for ($i = 2; (($i - 1) * self::$POSTS_PER_PAGE) < $post_count; $i++) |
|
103 | 103 | { |
104 | 104 | $this->addURL("{$base_url}{$i}/", date('Y-m-01'), self::$PAGINATED_PAGE_CHANGEFREQ, self::$PAGINATED_PAGE_RANK); |
105 | 105 | } |
@@ -135,7 +135,7 @@ discard block |
||
135 | 135 | |
136 | 136 | private function add_paginated_pages($count, $items_per_page, $base_url, $type) |
137 | 137 | { |
138 | - switch($type) { |
|
138 | + switch ($type) { |
|
139 | 139 | case 'waterfall': |
140 | 140 | $lastmod = date('Y-m-01'); |
141 | 141 | $changefreq = self::$WATERFALL_LISTING_SUBPAGES_CHANGEFREQ; |
@@ -148,7 +148,7 @@ discard block |
||
148 | 148 | break; |
149 | 149 | } |
150 | 150 | |
151 | - for($i = 2; (($i - 1) * $items_per_page) < $count; $i++) { |
|
151 | + for ($i = 2; (($i - 1) * $items_per_page) < $count; $i++) { |
|
152 | 152 | $this->addURL("{$base_url}/{$i}/", $lastmod, $changefreq, $rank); |
153 | 153 | } |
154 | 154 | } |
@@ -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); |
@@ -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 | } |
@@ -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'); |
@@ -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'); |
@@ -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, |