Completed
Push — master ( c330e2...cf0c7a )
by Jacob
03:58
created
collector/blog/PostCollector.class.inc.php 2 patches
Doc Comments   +9 added lines patch added patch discarded remove patch
@@ -17,6 +17,9 @@  discard block
 block discarded – undo
17 17
 		return self::run_query($query);
18 18
 	}
19 19
 
20
+	/**
21
+	 * @param integer $total
22
+	 */
20 23
 	public static function getMainList($total, $offset = 0)
21 24
 	{
22 25
 		$query = "SELECT `post`.`id` AS `id`, `title`, `path`, `date`, `body`, `category` FROM `jpemeric_blog`.`post` WHERE `display` = '1' ORDER BY `date` DESC LIMIT {$offset}, {$total}";
@@ -29,6 +32,9 @@  discard block
 block discarded – undo
29 32
 		return self::get_count($query);
30 33
 	}
31 34
 
35
+	/**
36
+	 * @param integer $total
37
+	 */
32 38
 	public static function getPostsForTag($tag_id, $total, $offset = 0)
33 39
 	{
34 40
 		$query = "SELECT `post`.`id` AS `id`, `title`, `path`, `date`, `body`, `category` FROM `jpemeric_blog`.`post`,`jpemeric_blog`.`ptlink` WHERE `display` = '1' && `post`.`id` = `ptlink`.`post_id` && `ptlink`.`tag_id` = '{$tag_id}' ORDER BY `date` DESC LIMIT {$offset}, {$total}";
@@ -41,6 +47,9 @@  discard block
 block discarded – undo
41 47
 		return self::get_count($query);
42 48
 	}
43 49
 
50
+	/**
51
+	 * @param integer $total
52
+	 */
44 53
 	public static function getPostsForCategory($category, $total, $offset = 0)
45 54
 	{
46 55
 		$category = self::escape($category);
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -80,7 +80,7 @@
 block discarded – undo
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);
Please login to merge, or discard this patch.
collector/comment/CommentCollector.class.inc.php 4 patches
Doc Comments   +3 added lines patch added patch discarded remove patch
@@ -83,6 +83,9 @@
 block discarded – undo
83 83
 		return self::run_query($query);
84 84
 	}
85 85
 
86
+	/**
87
+	 * @param integer $count
88
+	 */
86 89
 	public static function getRecentBlogComments($count)
87 90
 	{
88 91
 		$query = "
Please login to merge, or discard this patch.
Indentation   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -114,9 +114,9 @@  discard block
 block discarded – undo
114 114
 		return self::run_query($query);
115 115
 	}
116 116
 
117
-    public static function getRecentWaterfallComments($count = 5)
118
-    {
119
-        $query = "
117
+	public static function getRecentWaterfallComments($count = 5)
118
+	{
119
+		$query = "
120 120
             SELECT
121 121
                 `comment_meta`.`id`,
122 122
                 CONCAT('journal/', `log`.`alias`) AS `log_path`,
@@ -156,8 +156,8 @@  discard block
 block discarded – undo
156 156
                 `comment_meta`.`date` DESC
157 157
             LIMIT {$count}";
158 158
         
159
-        return self::run_query($query);
160
-    }
159
+		return self::run_query($query);
160
+	}
161 161
 
162 162
 	public static function getCommentsForURL($site, $path, $commenter = 0)
163 163
 	{
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -163,7 +163,7 @@
 block discarded – undo
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'";
Please login to merge, or discard this patch.
Braces   +5 added lines, -4 removed lines patch added patch discarded remove patch
@@ -163,10 +163,11 @@
 block discarded – undo
163 163
 	{
164 164
 		$path = self::escape($path);
165 165
 		
166
-		if($commenter != 0)
167
-			$trusted_commenter_clause = "(`commenter`.`trusted` = '1' || `commenter`.`id` = '{$commenter}')";
168
-		else
169
-			$trusted_commenter_clause = "`commenter`.`trusted` = '1'";
166
+		if($commenter != 0) {
167
+					$trusted_commenter_clause = "(`commenter`.`trusted` = '1' || `commenter`.`id` = '{$commenter}')";
168
+		} else {
169
+					$trusted_commenter_clause = "`commenter`.`trusted` = '1'";
170
+		}
170 171
 		
171 172
 		$query = "
172 173
 			SELECT
Please login to merge, or discard this patch.
collector/data/HuluCollector.class.inc.php 1 patch
Doc Comments   +3 added lines patch added patch discarded remove patch
@@ -12,6 +12,9 @@
 block discarded – undo
12 12
 		return self::run_query($query);
13 13
 	}
14 14
 
15
+	/**
16
+	 * @param integer $action
17
+	 */
15 18
 	public static function getHuluByFields($title, $action)
16 19
 	{
17 20
 		$title = self::escape($title);
Please login to merge, or discard this patch.
collector/portfolio/PortfolioCollector.class.inc.php 1 patch
Doc Comments   +3 added lines patch added patch discarded remove patch
@@ -19,6 +19,9 @@
 block discarded – undo
19 19
 		return self::run_row_query($query);
20 20
 	}
21 21
 
22
+	/**
23
+	 * @param integer $type
24
+	 */
22 25
 	public static function getImagesForPiece($piece_id, $type)
23 26
 	{
24 27
 		$piece_id = self::escape($piece_id);
Please login to merge, or discard this patch.
collector/stream/TwitterCollector.class.inc.php 1 patch
Doc Comments   +3 added lines patch added patch discarded remove patch
@@ -17,6 +17,9 @@
 block discarded – undo
17 17
 		return self::run_row_query($query);
18 18
 	}
19 19
 
20
+	/**
21
+	 * @param string $date
22
+	 */
20 23
 	public static function getTweetByFields($date, $text)
21 24
 	{
22 25
 		$query = "SELECT * FROM `jpemeric_stream`.`twitter` WHERE `date` = '{$date}' && `text` = '{$text}' LIMIT 1";
Please login to merge, or discard this patch.
collector/waterfall/LogCollector.class.inc.php 2 patches
Doc Comments   +6 added lines patch added patch discarded remove patch
@@ -34,6 +34,9 @@  discard block
 block discarded – undo
34 34
 		return self::run_query($query);
35 35
 	}
36 36
 
37
+    /**
38
+     * @param integer $total
39
+     */
37 40
     public static function getRecentList($total)
38 41
     {
39 42
         $query = "
@@ -178,6 +181,9 @@  discard block
 block discarded – undo
178 181
 		return self::run_row_query($query);
179 182
 	}
180 183
 
184
+    /**
185
+     * @param string $date
186
+     */
181 187
     public static function getByDate($date)
182 188
     {
183 189
         $date = self::escape($date);
Please login to merge, or discard this patch.
Indentation   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -34,9 +34,9 @@  discard block
 block discarded – undo
34 34
 		return self::run_query($query);
35 35
 	}
36 36
 
37
-    public static function getRecentList($total)
38
-    {
39
-        $query = "
37
+	public static function getRecentList($total)
38
+	{
39
+		$query = "
40 40
             SELECT
41 41
                 `log`.`title`,
42 42
                 `log`.`alias`,
@@ -59,8 +59,8 @@  discard block
 block discarded – undo
59 59
                 `log`.`date` DESC
60 60
             LIMIT
61 61
                 {$total}";
62
-        return self::run_query($query);
63
-    }
62
+		return self::run_query($query);
63
+	}
64 64
 
65 65
 	public static function getListCount()
66 66
 	{
@@ -178,11 +178,11 @@  discard block
 block discarded – undo
178 178
 		return self::run_row_query($query);
179 179
 	}
180 180
 
181
-    public static function getByDate($date)
182
-    {
183
-        $date = self::escape($date);
181
+	public static function getByDate($date)
182
+	{
183
+		$date = self::escape($date);
184 184
         
185
-        $query = "
185
+		$query = "
186 186
             SELECT
187 187
                 `log`.`alias`
188 188
             FROM
@@ -192,8 +192,8 @@  discard block
 block discarded – undo
192 192
                 `log`.`is_public` = '1'
193 193
             LIMIT 1";
194 194
         
195
-        return self::run_row_query($query);
196
-    }
195
+		return self::run_row_query($query);
196
+	}
197 197
 	
198 198
 	public static function getById($log)
199 199
 	{
Please login to merge, or discard this patch.
collector/waterfall/WaterfallCollector.class.inc.php 2 patches
Doc Comments   +3 added lines patch added patch discarded remove patch
@@ -117,6 +117,9 @@
 block discarded – undo
117 117
         return self::run_query($query);
118 118
     }
119 119
 
120
+    /**
121
+     * @param string $alias
122
+     */
120 123
     public static function getByOldAlias($alias)
121 124
     {
122 125
         $alias = self::escape($alias);
Please login to merge, or discard this patch.
Indentation   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -43,9 +43,9 @@  discard block
 block discarded – undo
43 43
 		return self::run_query($query);
44 44
 	}
45 45
 
46
-    public static function getMapList()
47
-    {
48
-        $query = "
46
+	public static function getMapList()
47
+	{
48
+		$query = "
49 49
             SELECT
50 50
                 `waterfall`.`name`,
51 51
                 `waterfall`.`alias`,
@@ -71,8 +71,8 @@  discard block
 block discarded – undo
71 71
             ORDER BY
72 72
                 `waterfall`.`name`";
73 73
         
74
-        return self::run_query($query);
75
-    }
74
+		return self::run_query($query);
75
+	}
76 76
 
77 77
 	public static function getListCount()
78 78
 	{
@@ -92,9 +92,9 @@  discard block
 block discarded – undo
92 92
 		return self::get_count($query);
93 93
 	}
94 94
 
95
-    public static function getNearbyList($waterfall)
96
-    {
97
-        $query = "
95
+	public static function getNearbyList($waterfall)
96
+	{
97
+		$query = "
98 98
             SELECT
99 99
                 `waterfall`.`name`,
100 100
                 `waterfall`.`alias` AS `alias`,
@@ -114,14 +114,14 @@  discard block
 block discarded – undo
114 114
                 `waterfall`.`name`,
115 115
                 `watercourse`.`name`";
116 116
         
117
-        return self::run_query($query);
118
-    }
117
+		return self::run_query($query);
118
+	}
119 119
 
120
-    public static function getByOldAlias($alias)
121
-    {
122
-        $alias = self::escape($alias);
120
+	public static function getByOldAlias($alias)
121
+	{
122
+		$alias = self::escape($alias);
123 123
         
124
-        $query = "
124
+		$query = "
125 125
             SELECT
126 126
                 `waterfall`.`alias`,
127 127
                 `watercourse`.`alias` AS `watercourse_alias`
@@ -134,8 +134,8 @@  discard block
 block discarded – undo
134 134
                 `waterfall`.`is_public` = '1'
135 135
             LIMIT 1";
136 136
         
137
-        return self::run_row_query($query);
138
-    }
137
+		return self::run_row_query($query);
138
+	}
139 139
 
140 140
 	public static function getByAlias($watercourse, $waterfall)
141 141
 	{
Please login to merge, or discard this patch.
controller/blog/DefaultPageController.class.inc.php 4 patches
Doc Comments   +3 added lines patch added patch discarded remove patch
@@ -97,6 +97,9 @@
 block discarded – undo
97 97
 		return $tag_array;
98 98
 	}
99 99
 
100
+	/**
101
+	 * @param boolean $trim
102
+	 */
100 103
 	final private function get_body_for_post($post, $trim)
101 104
 	{
102 105
 		$body = $post->body;
Please login to merge, or discard this patch.
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -86,7 +86,7 @@
 block discarded – undo
86 86
 		Loader::load('collector', 'blog/TagCollector');
87 87
 		
88 88
 		$tag_result = TagCollector::getTagsForPost($post->id);
89
-        $tag_array = array();
89
+		$tag_array = array();
90 90
 		foreach($tag_result as $tag)
91 91
 		{
92 92
 			$tag_object = new stdclass();
Please login to merge, or discard this patch.
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -37,7 +37,7 @@  discard block
 block discarded – undo
37 37
 		Loader::load('collector', 'image/PhotoCollector');
38 38
 		$photo_result = PhotoCollector::getRow($id);
39 39
 		
40
-		if($photo_result == null)
40
+		if ($photo_result == null)
41 41
 			return;
42 42
 		
43 43
 		$name = $photo_result->name;
@@ -87,7 +87,7 @@  discard block
 block discarded – undo
87 87
 		
88 88
 		$tag_result = TagCollector::getTagsForPost($post->id);
89 89
         $tag_array = array();
90
-		foreach($tag_result as $tag)
90
+		foreach ($tag_result as $tag)
91 91
 		{
92 92
 			$tag_object = new stdclass();
93 93
 			$tag_object->name = $tag->tag;
@@ -101,7 +101,7 @@  discard block
 block discarded – undo
101 101
 	{
102 102
 		$body = $post->body;
103 103
 		
104
-		if($trim)
104
+		if ($trim)
105 105
 			$body = Content::instance('SmartTrim', $body)->activate(self::$LENGTH_OF_TRIMMED_POST);
106 106
 		
107 107
 		$body = Content::instance('FixPhoto', $body)->activate(false, 'standard');
@@ -126,9 +126,9 @@  discard block
 block discarded – undo
126 126
 		$maximum_tag_count = $this->get_maximum_tag_count($tag_result);
127 127
 		
128 128
 		$cloud_array = array();
129
-		foreach($tag_result as $tag)
129
+		foreach ($tag_result as $tag)
130 130
 		{
131
-			if($tag->tag_count < self::$MINIMUM_TAG_COUNT)
131
+			if ($tag->tag_count < self::$MINIMUM_TAG_COUNT)
132 132
 				continue;
133 133
 			
134 134
 			$tag_object = new stdclass();
@@ -145,9 +145,9 @@  discard block
 block discarded – undo
145 145
 	{
146 146
 		$maximum = 1;
147 147
 		
148
-		foreach($tag_result as $tag)
148
+		foreach ($tag_result as $tag)
149 149
 		{
150
-			if($tag->tag_count > $maximum)
150
+			if ($tag->tag_count > $maximum)
151 151
 				$maximum = $tag->tag_count;
152 152
 		}
153 153
 		return $maximum;
@@ -158,7 +158,7 @@  discard block
 block discarded – undo
158 158
 		$comment_array = CommentCollector::getRecentBlogComments(self::$RECENT_COMMENT_COUNT);
159 159
 		
160 160
 		$array = array();
161
-		foreach($comment_array as $comment)
161
+		foreach ($comment_array as $comment)
162 162
 		{
163 163
 			$body = $comment->body;
164 164
 			$body = strip_tags($body);
Please login to merge, or discard this patch.
Braces   +12 added lines, -8 removed lines patch added patch discarded remove patch
@@ -37,8 +37,9 @@  discard block
 block discarded – undo
37 37
 		Loader::load('collector', 'image/PhotoCollector');
38 38
 		$photo_result = PhotoCollector::getRow($id);
39 39
 		
40
-		if($photo_result == null)
41
-			return;
40
+		if($photo_result == null) {
41
+					return;
42
+		}
42 43
 		
43 44
 		$name = $photo_result->name;
44 45
 		$category = $photo_result->category;
@@ -101,8 +102,9 @@  discard block
 block discarded – undo
101 102
 	{
102 103
 		$body = $post->body;
103 104
 		
104
-		if($trim)
105
-			$body = Content::instance('SmartTrim', $body)->activate(self::$LENGTH_OF_TRIMMED_POST);
105
+		if($trim) {
106
+					$body = Content::instance('SmartTrim', $body)->activate(self::$LENGTH_OF_TRIMMED_POST);
107
+		}
106 108
 		
107 109
 		$body = Content::instance('FixPhoto', $body)->activate(false, 'standard');
108 110
 		$body = Content::instance('MarkupCode', $body)->activate();
@@ -128,8 +130,9 @@  discard block
 block discarded – undo
128 130
 		$cloud_array = array();
129 131
 		foreach($tag_result as $tag)
130 132
 		{
131
-			if($tag->tag_count < self::$MINIMUM_TAG_COUNT)
132
-				continue;
133
+			if($tag->tag_count < self::$MINIMUM_TAG_COUNT) {
134
+							continue;
135
+			}
133 136
 			
134 137
 			$tag_object = new stdclass();
135 138
 			$tag_object->name = $tag->tag;
@@ -147,8 +150,9 @@  discard block
 block discarded – undo
147 150
 		
148 151
 		foreach($tag_result as $tag)
149 152
 		{
150
-			if($tag->tag_count > $maximum)
151
-				$maximum = $tag->tag_count;
153
+			if($tag->tag_count > $maximum) {
154
+							$maximum = $tag->tag_count;
155
+			}
152 156
 		}
153 157
 		return $maximum;
154 158
 	}
Please login to merge, or discard this patch.
controller/PageController.class.inc.php 4 patches
Doc Comments   +28 added lines patch added patch discarded remove patch
@@ -204,6 +204,9 @@  discard block
 block discarded – undo
204 204
 			exit;
205 205
 	}
206 206
 
207
+	/**
208
+	 * @param string $method
209
+	 */
207 210
 	protected function set_header_method($method)
208 211
 	{
209 212
 		$this->headers = $method;
@@ -214,6 +217,9 @@  discard block
 block discarded – undo
214 217
 		$this->set_head('title', $value);
215 218
 	}
216 219
 
220
+	/**
221
+	 * @param string $value
222
+	 */
217 223
 	protected function set_author($value)
218 224
 	{
219 225
 		$this->set_head('author', $value);
@@ -229,26 +235,41 @@  discard block
 block discarded – undo
229 235
 		$this->set_head('keywords', implode(', ', $array));
230 236
 	}
231 237
 	
238
+	/**
239
+	 * @param string $url
240
+	 */
232 241
 	protected function set_canonical($url)
233 242
 	{
234 243
 		$this->set_head('canonical', $url);
235 244
 	}
236 245
 
246
+	/**
247
+	 * @param string $set
248
+	 */
237 249
 	protected function set_head($set, $value)
238 250
 	{
239 251
 		$this->data_array['head'][$set] = $value;
240 252
 	}
241 253
 
254
+	/**
255
+	 * @param string $set
256
+	 */
242 257
 	protected function set_body($set, $value)
243 258
 	{
244 259
 		$this->data_array['body'][$set] = $value;
245 260
 	}
246 261
 
262
+	/**
263
+	 * @param string $file
264
+	 */
247 265
 	protected function add_css($file)
248 266
 	{
249 267
 		$this->css_array[] = $file;
250 268
 	}
251 269
 
270
+	/**
271
+	 * @param string $file
272
+	 */
252 273
 	protected function add_js($file)
253 274
 	{
254 275
 		$this->js_array[] = $file;
@@ -271,6 +292,9 @@  discard block
 block discarded – undo
271 292
 		$this->set_head('js_link_array', $js_array);
272 293
 	}
273 294
 
295
+	/**
296
+	 * @param string $view
297
+	 */
274 298
 	protected function set_body_view($view)
275 299
 	{
276 300
 		$this->body_view_array[] = $view;
@@ -315,6 +339,10 @@  discard block
 block discarded – undo
315 339
 	}
316 340
 
317 341
 	private $comment_errors;
342
+
343
+	/**
344
+	 * @param string $redirect_url
345
+	 */
318 346
 	protected function handle_comment_submit($site_id, $path, $redirect_url, $page_title)
319 347
 	{
320 348
 		if(Request::hasPost() && Request::getPost('submit') == 'Submit Comment')
Please login to merge, or discard this patch.
Indentation   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -60,9 +60,9 @@  discard block
 block discarded – undo
60 60
 
61 61
 	protected function get_recent_activity()
62 62
 	{
63
-    global $container;
64
-    $activityRepository = new Jacobemerick\Web\Domain\Stream\Post\MysqlPostRepository($container['db_connection_locator']);
65
-    $post_result = $activityRepository->getPosts(5);
63
+	global $container;
64
+	$activityRepository = new Jacobemerick\Web\Domain\Stream\Post\MysqlPostRepository($container['db_connection_locator']);
65
+	$post_result = $activityRepository->getPosts(5);
66 66
 
67 67
 		$post_array = array();
68 68
 		foreach($post_result as $row)
@@ -77,13 +77,13 @@  discard block
 block discarded – undo
77 77
 	{
78 78
 		Loader::load('utility', 'Content');
79 79
 
80
-    global $container;
81
-    $blogRepository = new Jacobemerick\Web\Domain\Stream\Blog\MysqlBlogRepository($container['db_connection_locator']);
82
-    $bookRepository = new Jacobemerick\Web\Domain\Stream\Book\MysqlBookRepository($container['db_connection_locator']);
83
-    $distanceRepository = new Jacobemerick\Web\Domain\Stream\Distance\MysqlDistanceRepository($container['db_connection_locator']);
84
-    $huluRepository = new Jacobemerick\Web\Domain\Stream\Hulu\MysqlHuluRepository($container['db_connection_locator']);
85
-    $twitterRepository = new Jacobemerick\Web\Domain\Stream\Twitter\MysqlTwitterRepository($container['db_connection_locator']);
86
-    $youtubeRepository = new Jacobemerick\Web\Domain\Stream\YouTube\MysqlYouTubeRepository($container['db_connection_locator']);
80
+	global $container;
81
+	$blogRepository = new Jacobemerick\Web\Domain\Stream\Blog\MysqlBlogRepository($container['db_connection_locator']);
82
+	$bookRepository = new Jacobemerick\Web\Domain\Stream\Book\MysqlBookRepository($container['db_connection_locator']);
83
+	$distanceRepository = new Jacobemerick\Web\Domain\Stream\Distance\MysqlDistanceRepository($container['db_connection_locator']);
84
+	$huluRepository = new Jacobemerick\Web\Domain\Stream\Hulu\MysqlHuluRepository($container['db_connection_locator']);
85
+	$twitterRepository = new Jacobemerick\Web\Domain\Stream\Twitter\MysqlTwitterRepository($container['db_connection_locator']);
86
+	$youtubeRepository = new Jacobemerick\Web\Domain\Stream\YouTube\MysqlYouTubeRepository($container['db_connection_locator']);
87 87
 
88 88
 		$post = new stdclass();
89 89
 		
@@ -126,9 +126,9 @@  discard block
 block discarded – undo
126 126
 					if(strlen($row['title']) > 0)
127 127
 						$post->title .= " I was hiking up around the {$row['title']} area.";
128 128
 				}
129
-                else if ($row['type'] == 'walking') {
130
-                    $post->title = "Walked {$row['distance']} miles and felt {$row['felt']}.";
131
-                }
129
+				else if ($row['type'] == 'walking') {
130
+					$post->title = "Walked {$row['distance']} miles and felt {$row['felt']}.";
131
+				}
132 132
 			break;
133 133
 			case 'hulu' :
134 134
 				$row = $huluRepository->getHuluById($raw_post['type_id']);
@@ -195,11 +195,11 @@  discard block
 block discarded – undo
195 195
 				Loader::load('view', URLDecode::getSite() . '/' . $view, $this->data_array['body']);
196 196
 		}
197 197
         
198
-        if (URLDecode::getSite() == 'waterfalls') {
199
-            Loader::load('view', '/WaterfallFoot');
200
-        } else {
201
-            Loader::load('view', '/Foot', array('tracking_code' => self::$TRACKING_CODE));
202
-        }
198
+		if (URLDecode::getSite() == 'waterfalls') {
199
+			Loader::load('view', '/WaterfallFoot');
200
+		} else {
201
+			Loader::load('view', '/Foot', array('tracking_code' => self::$TRACKING_CODE));
202
+		}
203 203
 		
204 204
 		if($view == '/404' || $view == '/503')
205 205
 			exit;
Please login to merge, or discard this patch.
Spacing   +31 added lines, -31 removed lines patch added patch discarded remove patch
@@ -40,7 +40,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
65 65
     $post_result = $activityRepository->getPosts(5);
66 66
 
67 67
 		$post_array = array();
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;
@@ -87,7 +87,7 @@  discard block
 block discarded – undo
87 87
 
88 88
 		$post = new stdclass();
89 89
 		
90
-		switch($raw_post['type'])
90
+		switch ($raw_post['type'])
91 91
 		{
92 92
 			case 'blog' :
93 93
 				$row = $blogRepository->getBlogById($raw_post['type_id']);
@@ -98,7 +98,7 @@  discard block
 block discarded – undo
98 98
 				$post->title = "Blogged about {$category}: <a href=\"{$row['url']}\">{$row['title']}</a>.";
99 99
 				$post->comments = $row['comments'];
100 100
 				
101
-				if($format == 'full')
101
+				if ($format == 'full')
102 102
 					$post->image = Content::instance('FetchFirstPhoto', $row['body'])->activate(false, 'standard');
103 103
 			break;
104 104
 			case 'book' :
@@ -107,23 +107,23 @@  discard block
 block discarded – undo
107 107
 				$post->type = 'book';
108 108
 				$post->title = "Just finished reading {$row['title']} by {$row['author']}.";
109 109
 				
110
-				if($format == 'full')
110
+				if ($format == 'full')
111 111
 					$post->image = "<img alt=\"{$row['title']} by {$row['author']}\" src=\"{$row['image']}\" />";
112 112
 			break;
113 113
 			case 'distance' :
114 114
 				$row = $distanceRepository->getDistanceById($raw_post['type_id']);
115 115
 				
116 116
 				$post->type = 'distance';
117
-				if($row['type'] == 'running')
117
+				if ($row['type'] == 'running')
118 118
 				{
119 119
 					$post->title = "Ran {$row['distance']} miles and felt {$row['felt']}.";
120
-					if(strlen($row['message']) > 0)
120
+					if (strlen($row['message']) > 0)
121 121
 						$post->title .= " Afterwards, I was all like '{$row['message']}'.";
122 122
 				}
123
-				else if($row['type'] == 'hiking')
123
+				else if ($row['type'] == 'hiking')
124 124
 				{
125 125
 					$post->title = "Hiked {$row['distance']} miles and felt {$row['felt']}.";
126
-					if(strlen($row['title']) > 0)
126
+					if (strlen($row['title']) > 0)
127 127
 						$post->title .= " I was hiking up around the {$row['title']} area.";
128 128
 				}
129 129
                 else if ($row['type'] == 'walking') {
@@ -141,7 +141,7 @@  discard block
 block discarded – undo
141 141
 				
142 142
 				$post->type = 'twitter';
143 143
 				
144
-				if($format == 'full')
144
+				if ($format == 'full')
145 145
 					$post->title = $row['text_formatted_full'];
146 146
 				else
147 147
 					$post->title = $row['text_formatted'];
@@ -154,12 +154,12 @@  discard block
 block discarded – undo
154 154
 				
155 155
 				$post->type = 'youtube';
156 156
 				
157
-				if($format == 'full')
157
+				if ($format == 'full')
158 158
 					$post->title = "Favorited {$row['title']} by {$row['author']} on YouTube.";
159 159
 				else
160 160
 					$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.";
161 161
 				
162
-				if($format == 'full')
162
+				if ($format == 'full')
163 163
 					$post->embed_code = "<iframe src=\"http://www.youtube.com/embed/{$row['video_id']}?rel=0\" frameborder=\"0\" allowfullscreen></iframe>";
164 164
 			break;
165 165
 		}
@@ -187,9 +187,9 @@  discard block
 block discarded – undo
187 187
 		$headers = $this->headers;
188 188
 		Header::$headers();
189 189
 		Loader::load('view', '/Head', $this->data_array['head']);
190
-		foreach($this->body_view_array as $view)
190
+		foreach ($this->body_view_array as $view)
191 191
 		{
192
-			if(substr($view, 0, 1) == '/')
192
+			if (substr($view, 0, 1) == '/')
193 193
 				Loader::load('view', $view, $this->data_array['body']);
194 194
 			else
195 195
 				Loader::load('view', URLDecode::getSite() . '/' . $view, $this->data_array['body']);
@@ -201,7 +201,7 @@  discard block
 block discarded – undo
201 201
             Loader::load('view', '/Foot', array('tracking_code' => self::$TRACKING_CODE));
202 202
         }
203 203
 		
204
-		if($view == '/404' || $view == '/503')
204
+		if ($view == '/404' || $view == '/503')
205 205
 			exit;
206 206
 	}
207 207
 
@@ -262,10 +262,10 @@  discard block
 block discarded – undo
262 262
 		
263 263
 		$js_array = array();
264 264
 		
265
-		if(count($this->js_array) > 0)
265
+		if (count($this->js_array) > 0)
266 266
 			$js_array = array_merge($js_array, $this->js_array);
267 267
 		
268
-		if(count($js_array) > 0)
268
+		if (count($js_array) > 0)
269 269
 			$js_array = Asset::getJS($js_array);
270 270
 		
271 271
 		$this->set_head('css_link_array', $css_array);
@@ -279,26 +279,26 @@  discard block
 block discarded – undo
279 279
 
280 280
 	protected function eject()
281 281
 	{
282
-		if(get_class($this) !== 'Error404Controller')
282
+		if (get_class($this) !== 'Error404Controller')
283 283
 			Loader::loadNew('controller', '/Error404Controller')->activate();
284 284
 	}
285 285
 
286 286
 	protected function unavailable()
287 287
 	{
288
-		if(get_class($this) !== 'Error503Controller')
288
+		if (get_class($this) !== 'Error503Controller')
289 289
 			Loader::loadNew('controller', '/Error503Controller')->activate();
290 290
 	}
291 291
 
292 292
 	protected function redirect($uri, $method = 301)
293 293
 	{
294
-		switch($method)
294
+		switch ($method)
295 295
 		{
296 296
 			case 301 :
297
-				if(get_class($this) !== 'Error301Controller')
297
+				if (get_class($this) !== 'Error301Controller')
298 298
 					Loader::loadNew('controller', '/Error301Controller', array($uri))->activate();
299 299
 				break;
300 300
 			case 303 :
301
-				if(get_class($this) !== 'Error303Controller')
301
+				if (get_class($this) !== 'Error303Controller')
302 302
 					Loader::loadNew('controller', '/Error303Controller', array($uri))->activate();
303 303
 				break;
304 304
 		}
@@ -318,7 +318,7 @@  discard block
 block discarded – undo
318 318
 	private $comment_errors;
319 319
 	protected function handle_comment_submit($site_id, $path, $redirect_url, $page_title)
320 320
 	{
321
-		if(Request::hasPost() && Request::getPost('submit') == 'Submit Comment')
321
+		if (Request::hasPost() && Request::getPost('submit') == 'Submit Comment')
322 322
 		{
323 323
 			$parameters = array($site_id, $path, $redirect_url, $page_title);
324 324
 			$this->comment_errors = Loader::loadNew('module', 'form/CommentSubmitModule', $parameters)->activate();
@@ -336,7 +336,7 @@  discard block
 block discarded – undo
336 336
 		$comment_array = array();
337 337
 		$comment_result = CommentCollector::getCommentsForURL($site, $path, $commenter->id);
338 338
 		
339
-		foreach($comment_result as $comment)
339
+		foreach ($comment_result as $comment)
340 340
 		{
341 341
 			$comment_object = new stdclass();
342 342
 			$comment_object->id = $comment->id;
@@ -346,12 +346,12 @@  discard block
 block discarded – undo
346 346
 			$comment_object->url = $comment->url;
347 347
 			$comment_object->trusted = $comment->trusted;
348 348
 			
349
-			if($comment->reply == 0 && Request::getPost('type') == $comment->id)
349
+			if ($comment->reply == 0 && Request::getPost('type') == $comment->id)
350 350
 				$comment_object->errors = $this->comment_errors;
351 351
 			else
352 352
 				$comment_object->errors = array();
353 353
 			
354
-			if($comment->reply == 0)
354
+			if ($comment->reply == 0)
355 355
 			{
356 356
 				$comment_object->replies = array();
357 357
 				$comment_array[$comment->id] = $comment_object;
@@ -382,21 +382,21 @@  discard block
 block discarded – undo
382 382
 		$commenter->website = '';
383 383
 		
384 384
 		$commenter_cookie = Cookie::instance('Commenter');
385
-		if(!$commenter_cookie->exists())
385
+		if (!$commenter_cookie->exists())
386 386
 			return $commenter;
387 387
 		
388 388
 		$commenter_cookie_value = $commenter_cookie->getValue();
389 389
 		$commenter_cookie_value = json_decode($commenter_cookie_value);
390 390
 		
391
-		if($commenter_cookie_value === NULL)
391
+		if ($commenter_cookie_value === NULL)
392 392
 			return $commenter;
393 393
 		
394
-		if(!isset($commenter_cookie_value->name) || !isset($commenter_cookie_value->email))
394
+		if (!isset($commenter_cookie_value->name) || !isset($commenter_cookie_value->email))
395 395
 			return $commenter;
396 396
 		
397 397
 		$commenter_object = CommentCollector::getCommenterByFields($commenter_cookie_value->name, $commenter_cookie_value->email, (isset($commenter_cookie_value->website) ? $commenter_cookie_value->website : ''));
398 398
 		
399
-		if($commenter_object === NULL)
399
+		if ($commenter_object === NULL)
400 400
 			return $commenter;
401 401
 		
402 402
 		$commenter->id = $commenter_object->id;
Please login to merge, or discard this patch.
Braces   +76 added lines, -57 removed lines patch added patch discarded remove patch
@@ -40,8 +40,9 @@  discard block
 block discarded – undo
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()
@@ -98,8 +99,9 @@  discard block
 block discarded – undo
98 99
 				$post->title = "Blogged about {$category}: <a href=\"{$row['url']}\">{$row['title']}</a>.";
99 100
 				$post->comments = $row['comments'];
100 101
 				
101
-				if($format == 'full')
102
-					$post->image = Content::instance('FetchFirstPhoto', $row['body'])->activate(false, 'standard');
102
+				if($format == 'full') {
103
+									$post->image = Content::instance('FetchFirstPhoto', $row['body'])->activate(false, 'standard');
104
+				}
103 105
 			break;
104 106
 			case 'book' :
105 107
 				$row = $bookRepository->getBookById($raw_post['type_id']);
@@ -107,8 +109,9 @@  discard block
 block discarded – undo
107 109
 				$post->type = 'book';
108 110
 				$post->title = "Just finished reading {$row['title']} by {$row['author']}.";
109 111
 				
110
-				if($format == 'full')
111
-					$post->image = "<img alt=\"{$row['title']} by {$row['author']}\" src=\"{$row['image']}\" />";
112
+				if($format == 'full') {
113
+									$post->image = "<img alt=\"{$row['title']} by {$row['author']}\" src=\"{$row['image']}\" />";
114
+				}
112 115
 			break;
113 116
 			case 'distance' :
114 117
 				$row = $distanceRepository->getDistanceById($raw_post['type_id']);
@@ -117,16 +120,16 @@  discard block
 block discarded – undo
117 120
 				if($row['type'] == 'running')
118 121
 				{
119 122
 					$post->title = "Ran {$row['distance']} miles and felt {$row['felt']}.";
120
-					if(strlen($row['message']) > 0)
121
-						$post->title .= " Afterwards, I was all like '{$row['message']}'.";
122
-				}
123
-				else if($row['type'] == 'hiking')
123
+					if(strlen($row['message']) > 0) {
124
+											$post->title .= " Afterwards, I was all like '{$row['message']}'.";
125
+					}
126
+				} else if($row['type'] == 'hiking')
124 127
 				{
125 128
 					$post->title = "Hiked {$row['distance']} miles and felt {$row['felt']}.";
126
-					if(strlen($row['title']) > 0)
127
-						$post->title .= " I was hiking up around the {$row['title']} area.";
128
-				}
129
-                else if ($row['type'] == 'walking') {
129
+					if(strlen($row['title']) > 0) {
130
+											$post->title .= " I was hiking up around the {$row['title']} area.";
131
+					}
132
+				} else if ($row['type'] == 'walking') {
130 133
                     $post->title = "Walked {$row['distance']} miles and felt {$row['felt']}.";
131 134
                 }
132 135
 			break;
@@ -141,10 +144,11 @@  discard block
 block discarded – undo
141 144
 				
142 145
 				$post->type = 'twitter';
143 146
 				
144
-				if($format == 'full')
145
-					$post->title = $row['text_formatted_full'];
146
-				else
147
-					$post->title = $row['text_formatted'];
147
+				if($format == 'full') {
148
+									$post->title = $row['text_formatted_full'];
149
+				} else {
150
+									$post->title = $row['text_formatted'];
151
+				}
148 152
 				
149 153
 				$post->retweets = ($row['is_retweet'] == 0) ? $row['retweets'] : 0;
150 154
 				$post->favorites = ($row['is_retweet'] == 0) ? $row['favorites'] : 0;
@@ -154,13 +158,15 @@  discard block
 block discarded – undo
154 158
 				
155 159
 				$post->type = 'youtube';
156 160
 				
157
-				if($format == 'full')
158
-					$post->title = "Favorited {$row['title']} by {$row['author']} on YouTube.";
159
-				else
160
-					$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.";
161
+				if($format == 'full') {
162
+									$post->title = "Favorited {$row['title']} by {$row['author']} on YouTube.";
163
+				} else {
164
+									$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.";
165
+				}
161 166
 				
162
-				if($format == 'full')
163
-					$post->embed_code = "<iframe src=\"http://www.youtube.com/embed/{$row['video_id']}?rel=0\" frameborder=\"0\" allowfullscreen></iframe>";
167
+				if($format == 'full') {
168
+									$post->embed_code = "<iframe src=\"http://www.youtube.com/embed/{$row['video_id']}?rel=0\" frameborder=\"0\" allowfullscreen></iframe>";
169
+				}
164 170
 			break;
165 171
 		}
166 172
 		
@@ -189,10 +195,11 @@  discard block
 block discarded – undo
189 195
 		Loader::load('view', '/Head', $this->data_array['head']);
190 196
 		foreach($this->body_view_array as $view)
191 197
 		{
192
-			if(substr($view, 0, 1) == '/')
193
-				Loader::load('view', $view, $this->data_array['body']);
194
-			else
195
-				Loader::load('view', URLDecode::getSite() . '/' . $view, $this->data_array['body']);
198
+			if(substr($view, 0, 1) == '/') {
199
+							Loader::load('view', $view, $this->data_array['body']);
200
+			} else {
201
+							Loader::load('view', URLDecode::getSite() . '/' . $view, $this->data_array['body']);
202
+			}
196 203
 		}
197 204
         
198 205
         if (URLDecode::getSite() == 'waterfalls') {
@@ -201,8 +208,9 @@  discard block
 block discarded – undo
201 208
             Loader::load('view', '/Foot', array('tracking_code' => self::$TRACKING_CODE));
202 209
         }
203 210
 		
204
-		if($view == '/404' || $view == '/503')
205
-			exit;
211
+		if($view == '/404' || $view == '/503') {
212
+					exit;
213
+		}
206 214
 	}
207 215
 
208 216
 	protected function set_header_method($method)
@@ -262,11 +270,13 @@  discard block
 block discarded – undo
262 270
 		
263 271
 		$js_array = array();
264 272
 		
265
-		if(count($this->js_array) > 0)
266
-			$js_array = array_merge($js_array, $this->js_array);
273
+		if(count($this->js_array) > 0) {
274
+					$js_array = array_merge($js_array, $this->js_array);
275
+		}
267 276
 		
268
-		if(count($js_array) > 0)
269
-			$js_array = Asset::getJS($js_array);
277
+		if(count($js_array) > 0) {
278
+					$js_array = Asset::getJS($js_array);
279
+		}
270 280
 		
271 281
 		$this->set_head('css_link_array', $css_array);
272 282
 		$this->set_head('js_link_array', $js_array);
@@ -279,14 +289,16 @@  discard block
 block discarded – undo
279 289
 
280 290
 	protected function eject()
281 291
 	{
282
-		if(get_class($this) !== 'Error404Controller')
283
-			Loader::loadNew('controller', '/Error404Controller')->activate();
292
+		if(get_class($this) !== 'Error404Controller') {
293
+					Loader::loadNew('controller', '/Error404Controller')->activate();
294
+		}
284 295
 	}
285 296
 
286 297
 	protected function unavailable()
287 298
 	{
288
-		if(get_class($this) !== 'Error503Controller')
289
-			Loader::loadNew('controller', '/Error503Controller')->activate();
299
+		if(get_class($this) !== 'Error503Controller') {
300
+					Loader::loadNew('controller', '/Error503Controller')->activate();
301
+		}
290 302
 	}
291 303
 
292 304
 	protected function redirect($uri, $method = 301)
@@ -294,12 +306,14 @@  discard block
 block discarded – undo
294 306
 		switch($method)
295 307
 		{
296 308
 			case 301 :
297
-				if(get_class($this) !== 'Error301Controller')
298
-					Loader::loadNew('controller', '/Error301Controller', array($uri))->activate();
309
+				if(get_class($this) !== 'Error301Controller') {
310
+									Loader::loadNew('controller', '/Error301Controller', array($uri))->activate();
311
+				}
299 312
 				break;
300 313
 			case 303 :
301
-				if(get_class($this) !== 'Error303Controller')
302
-					Loader::loadNew('controller', '/Error303Controller', array($uri))->activate();
314
+				if(get_class($this) !== 'Error303Controller') {
315
+									Loader::loadNew('controller', '/Error303Controller', array($uri))->activate();
316
+				}
303 317
 				break;
304 318
 		}
305 319
 	}
@@ -346,18 +360,19 @@  discard block
 block discarded – undo
346 360
 			$comment_object->url = $comment->url;
347 361
 			$comment_object->trusted = $comment->trusted;
348 362
 			
349
-			if($comment->reply == 0 && Request::getPost('type') == $comment->id)
350
-				$comment_object->errors = $this->comment_errors;
351
-			else
352
-				$comment_object->errors = array();
363
+			if($comment->reply == 0 && Request::getPost('type') == $comment->id) {
364
+							$comment_object->errors = $this->comment_errors;
365
+			} else {
366
+							$comment_object->errors = array();
367
+			}
353 368
 			
354 369
 			if($comment->reply == 0)
355 370
 			{
356 371
 				$comment_object->replies = array();
357 372
 				$comment_array[$comment->id] = $comment_object;
358
-			}
359
-			else
360
-				$comment_array[$comment->reply]->replies[$comment->id] = $comment_object;
373
+			} else {
374
+							$comment_array[$comment->reply]->replies[$comment->id] = $comment_object;
375
+			}
361 376
 		}
362 377
 		
363 378
 		$comment_count = CommentCollector::getCommentCountForURL($site, $path);
@@ -382,22 +397,26 @@  discard block
 block discarded – undo
382 397
 		$commenter->website = '';
383 398
 		
384 399
 		$commenter_cookie = Cookie::instance('Commenter');
385
-		if(!$commenter_cookie->exists())
386
-			return $commenter;
400
+		if(!$commenter_cookie->exists()) {
401
+					return $commenter;
402
+		}
387 403
 		
388 404
 		$commenter_cookie_value = $commenter_cookie->getValue();
389 405
 		$commenter_cookie_value = json_decode($commenter_cookie_value);
390 406
 		
391
-		if($commenter_cookie_value === NULL)
392
-			return $commenter;
407
+		if($commenter_cookie_value === NULL) {
408
+					return $commenter;
409
+		}
393 410
 		
394
-		if(!isset($commenter_cookie_value->name) || !isset($commenter_cookie_value->email))
395
-			return $commenter;
411
+		if(!isset($commenter_cookie_value->name) || !isset($commenter_cookie_value->email)) {
412
+					return $commenter;
413
+		}
396 414
 		
397 415
 		$commenter_object = CommentCollector::getCommenterByFields($commenter_cookie_value->name, $commenter_cookie_value->email, (isset($commenter_cookie_value->website) ? $commenter_cookie_value->website : ''));
398 416
 		
399
-		if($commenter_object === NULL)
400
-			return $commenter;
417
+		if($commenter_object === NULL) {
418
+					return $commenter;
419
+		}
401 420
 		
402 421
 		$commenter->id = $commenter_object->id;
403 422
 		$commenter->name = $commenter_object->name;
Please login to merge, or discard this patch.