@@ -28,7 +28,7 @@ |
||
28 | 28 | |
29 | 29 | protected function set_response($message, $type = 'internal') |
30 | 30 | { |
31 | - switch($type) |
|
31 | + switch ($type) |
|
32 | 32 | { |
33 | 33 | case 'internal' : |
34 | 34 | $this->response['internal'] = $message; |
@@ -26,7 +26,7 @@ |
||
26 | 26 | { |
27 | 27 | $post_result = PostCollector::getMainList(250); |
28 | 28 | |
29 | - foreach($post_result as $post) |
|
29 | + foreach ($post_result as $post) |
|
30 | 30 | { |
31 | 31 | $this->addItem( |
32 | 32 | $post->title, |
@@ -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 | } |
@@ -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'; |