@@ -163,7 +163,7 @@ |
||
163 | 163 | { |
164 | 164 | $path = self::escape($path); |
165 | 165 | |
166 | - if($commenter != 0) |
|
166 | + if ($commenter != 0) |
|
167 | 167 | $trusted_commenter_clause = "(`commenter`.`trusted` = '1' || `commenter`.`id` = '{$commenter}')"; |
168 | 168 | else |
169 | 169 | $trusted_commenter_clause = "`commenter`.`trusted` = '1'"; |
@@ -80,7 +80,7 @@ |
||
80 | 80 | $tag_clause = "'{$tag_clause}'"; |
81 | 81 | |
82 | 82 | $exclude_clause = ''; |
83 | - if(count($exclude_posts) > 0) |
|
83 | + if (count($exclude_posts) > 0) |
|
84 | 84 | { |
85 | 85 | $exclude_clause .= " && `ptlink`.`post_id` NOT IN ('"; |
86 | 86 | $exclude_clause .= implode("', '", $exclude_posts); |
@@ -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, |
@@ -20,14 +20,14 @@ discard block |
||
20 | 20 | parent::__construct(); |
21 | 21 | |
22 | 22 | $id = URLDecode::getPiece(2); |
23 | - if(!$id || !is_numeric($id)) |
|
23 | + if (!$id || !is_numeric($id)) |
|
24 | 24 | $this->eject(); |
25 | 25 | |
26 | 26 | $post = ActivityCollector::getPost($id); |
27 | - if(!$post) |
|
27 | + if (!$post) |
|
28 | 28 | $this->eject(); |
29 | 29 | |
30 | - if(URLDecode::getPiece(1) != $post->type) |
|
30 | + if (URLDecode::getPiece(1) != $post->type) |
|
31 | 31 | $this->eject(); |
32 | 32 | |
33 | 33 | $this->post = $post; |
@@ -59,7 +59,7 @@ discard block |
||
59 | 59 | |
60 | 60 | private function get_title() |
61 | 61 | { |
62 | - switch($this->post->type) |
|
62 | + switch ($this->post->type) |
|
63 | 63 | { |
64 | 64 | case 'blog' : |
65 | 65 | return 'Jacob blogged'; |
@@ -84,7 +84,7 @@ discard block |
||
84 | 84 | |
85 | 85 | private function get_description() |
86 | 86 | { |
87 | - switch($this->post->type) |
|
87 | + switch ($this->post->type) |
|
88 | 88 | { |
89 | 89 | case 'blog' : |
90 | 90 | return 'Another awesome blog post from Jacob. Did I mention it was awesome?'; |
@@ -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 | } |
@@ -55,11 +55,11 @@ |
||
55 | 55 | final private function get_list_posts() |
56 | 56 | { |
57 | 57 | $post_array = array(); |
58 | - foreach($this->get_list_results() as $post) |
|
58 | + foreach ($this->get_list_results() as $post) |
|
59 | 59 | { |
60 | 60 | $post_array[] = $this->expand_post($post, 'full'); |
61 | 61 | } |
62 | - if(count($post_array) < 1 && URLDecode::getPiece(1) !== 'search') |
|
62 | + if (count($post_array) < 1 && URLDecode::getPiece(1) !== 'search') |
|
63 | 63 | $this->eject(); |
64 | 64 | return $post_array; |
65 | 65 | } |
@@ -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 | } |