@@ -29,17 +29,17 @@ |
||
29 | 29 | |
30 | 30 | private function get_form_results() |
31 | 31 | { |
32 | - if(!Request::hasPost()) |
|
32 | + if (!Request::hasPost()) |
|
33 | 33 | return array(); |
34 | 34 | |
35 | - if(!Validate::checkRequest('post', 'name', 'string')) |
|
35 | + if (!Validate::checkRequest('post', 'name', 'string')) |
|
36 | 36 | $error_message['name'] = 'Please enter a value for your name.'; |
37 | - if(!Validate::checkRequest('post', 'email', 'string')) |
|
37 | + if (!Validate::checkRequest('post', 'email', 'string')) |
|
38 | 38 | $error_message['email'] = 'Please enter a valid email address.'; |
39 | - if(!Validate::checkRequest('post', 'message', 'string')) |
|
39 | + if (!Validate::checkRequest('post', 'message', 'string')) |
|
40 | 40 | $error_message['message'] = 'Please enter a message.'; |
41 | 41 | |
42 | - if(!empty($error_message)) |
|
42 | + if (!empty($error_message)) |
|
43 | 43 | { |
44 | 44 | return array( |
45 | 45 | 'error_message' => $error_message, |
@@ -41,7 +41,7 @@ discard block |
||
41 | 41 | $active_page = $this->get_active_page(); |
42 | 42 | |
43 | 43 | $menu = array(); |
44 | - foreach(self::$MENU as $item) |
|
44 | + foreach (self::$MENU as $item) |
|
45 | 45 | { |
46 | 46 | $menu[] = (object) array( |
47 | 47 | 'name' => $item['name'], |
@@ -56,13 +56,13 @@ discard block |
||
56 | 56 | { |
57 | 57 | $current_uri = URLDecode::getPiece(1); |
58 | 58 | |
59 | - if(!isset($current_uri)) |
|
59 | + if (!isset($current_uri)) |
|
60 | 60 | return 'About'; |
61 | 61 | |
62 | 62 | $menu = self::$MENU; |
63 | - foreach($menu as $link) |
|
63 | + foreach ($menu as $link) |
|
64 | 64 | { |
65 | - if($link['uri'] == $current_uri) |
|
65 | + if ($link['uri'] == $current_uri) |
|
66 | 66 | return $link['name']; |
67 | 67 | } |
68 | 68 |
@@ -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 | } |
@@ -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 | } |
@@ -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); |
@@ -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 | } |
@@ -27,7 +27,7 @@ |
||
27 | 27 | $alias = URLDecode::getPiece(2); |
28 | 28 | $this->companion = CompanionCollector::getByAlias($alias); |
29 | 29 | |
30 | - if(!$this->companion) |
|
30 | + if (!$this->companion) |
|
31 | 31 | $this->eject(); |
32 | 32 | |
33 | 33 | parent::__construct(); |
@@ -33,16 +33,16 @@ discard block |
||
33 | 33 | |
34 | 34 | private function process_form() |
35 | 35 | { |
36 | - if(!Request::hasPost() || Request::getPost('submit') != 'Send Message!') |
|
36 | + if (!Request::hasPost() || Request::getPost('submit') != 'Send Message!') |
|
37 | 37 | return (object) array('display' => 'normal'); |
38 | 38 | |
39 | 39 | Loader::load('utility', 'Validate'); |
40 | 40 | $error_result = array(); |
41 | - if(!Validate::checkRequest('post', 'name', 'string')) |
|
41 | + if (!Validate::checkRequest('post', 'name', 'string')) |
|
42 | 42 | $error_result['name'] = 'please enter your name'; |
43 | - if(!Validate::checkRequest('post', 'email', 'string')) |
|
43 | + if (!Validate::checkRequest('post', 'email', 'string')) |
|
44 | 44 | $error_result['email'] = 'please enter a valid email'; |
45 | - if(!Validate::checkRequest('post', 'message', 'string')) |
|
45 | + if (!Validate::checkRequest('post', 'message', 'string')) |
|
46 | 46 | $error_result['message'] = 'please write a message'; |
47 | 47 | |
48 | 48 | $values = (object) array( |
@@ -50,7 +50,7 @@ discard block |
||
50 | 50 | 'email' => Request::getPost('email'), |
51 | 51 | 'message' => Request::getPost('message')); |
52 | 52 | |
53 | - if(count($error_result) > 0) |
|
53 | + if (count($error_result) > 0) |
|
54 | 54 | { |
55 | 55 | return (object) array( |
56 | 56 | 'display' => 'error', |
@@ -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(); |