Completed
Branch master (de1ee7)
by Jacob
05:01
created
controller/blog/AboutController.class.inc.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -36,7 +36,7 @@
 block discarded – undo
36 36
 		Loader::load('collector', 'blog/IntroductionCollector');
37 37
 		$introduction_result = IntroductionCollector::getRow('about');
38 38
 		
39
-		if($introduction_result !== null)
39
+		if ($introduction_result !== null)
40 40
 		{
41 41
 			$introduction = array();
42 42
 			$introduction['title'] = $introduction_result->title;
Please login to merge, or discard this patch.
controller/blog/CategoryController.class.inc.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -67,10 +67,10 @@  discard block
 block discarded – undo
67 67
 	{
68 68
 		parent::set_head_data();
69 69
 		
70
-		switch($this->category->display)
70
+		switch ($this->category->display)
71 71
 		{
72 72
 			case 'Hiking' :
73
-				if($this->page == 1)
73
+				if ($this->page == 1)
74 74
 				{
75 75
 					$this->set_title(self::$TITLE_MAIN_HIKING);
76 76
 					$this->set_description(self::$DESCRIPTION_MAIN_HIKING);
@@ -83,7 +83,7 @@  discard block
 block discarded – undo
83 83
 				$this->set_keywords(self::$KEYWORD_ARRAY_HIKING);
84 84
 			break;
85 85
 			case 'Personal' :
86
-				if($this->page == 1)
86
+				if ($this->page == 1)
87 87
 				{
88 88
 					$this->set_title(self::$TITLE_MAIN_PERSONAL);
89 89
 					$this->set_description(self::$DESCRIPTION_MAIN_PERSONAL);
@@ -96,7 +96,7 @@  discard block
 block discarded – undo
96 96
 				$this->set_keywords(self::$KEYWORD_ARRAY_PERSONAL);
97 97
 			break;
98 98
 			case 'Web Development' :
99
-				if($this->page == 1)
99
+				if ($this->page == 1)
100 100
 				{
101 101
 					$this->set_title(self::$TITLE_MAIN_WEBDEVELOPMENT);
102 102
 					$this->set_description(self::$DESCRIPTION_MAIN_WEBDEVELOPMENT);
@@ -113,7 +113,7 @@  discard block
 block discarded – undo
113 113
 
114 114
 	protected function get_introduction()
115 115
 	{
116
-		if($this->page == 1)
116
+		if ($this->page == 1)
117 117
 		{
118 118
 			Loader::load('collector', 'blog/IntroductionCollector');
119 119
 			$introduction_result = IntroductionCollector::getRow('category', $this->category->link);
@@ -133,7 +133,7 @@  discard block
 block discarded – undo
133 133
 	protected function get_page_number()
134 134
 	{
135 135
 		$page = URLDecode::getPiece(2);
136
-		if(isset($page) && is_numeric($page))
136
+		if (isset($page) && is_numeric($page))
137 137
 			return $page;
138 138
 		return 1;
139 139
 	}
@@ -153,16 +153,16 @@  discard block
 block discarded – undo
153 153
 
154 154
 	protected function get_list_next_link()
155 155
 	{
156
-		if($this->page == 1)
156
+		if ($this->page == 1)
157 157
 			return;
158
-		if($this->page == 2)
158
+		if ($this->page == 2)
159 159
 			return Content::instance('URLSafe', "/{$this->category->link}/")->activate();
160 160
 		return Content::instance('URLSafe', "/{$this->category->link}/" . ($this->page - 1) . '/')->activate();
161 161
 	}
162 162
 
163 163
 	protected function get_list_prev_link()
164 164
 	{
165
-		if(($this->page * self::$POSTS_PER_PAGE) >= $this->get_total_post_count())
165
+		if (($this->page * self::$POSTS_PER_PAGE) >= $this->get_total_post_count())
166 166
 			return;
167 167
 		return Content::instance('URLSafe', "/{$this->category->link}/" . ($this->page + 1) . '/')->activate();
168 168
 	}
@@ -170,7 +170,7 @@  discard block
 block discarded – undo
170 170
 	private $total_post_count;
171 171
 	protected function get_total_post_count()
172 172
 	{
173
-		if(!isset($this->total_post_count))
173
+		if (!isset($this->total_post_count))
174 174
 			$this->total_post_count = PostCollector::getPostCountForCategory($this->category->link);
175 175
 		return $this->total_post_count;
176 176
 	}
Please login to merge, or discard this patch.
controller/blog/DefaultListController.class.inc.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -56,11 +56,11 @@
 block discarded – undo
56 56
 	final private function get_list_posts()
57 57
 	{
58 58
 		$post_array = array();
59
-		foreach($this->get_list_results() as $post)
59
+		foreach ($this->get_list_results() as $post)
60 60
 		{
61 61
 			$post_array[] = $this->format_post($post, true);
62 62
 		}
63
-		if(count($post_array) < 1 && URLDecode::getPiece(1) !== 'search')
63
+		if (count($post_array) < 1 && URLDecode::getPiece(1) !== 'search')
64 64
 			$this->eject();
65 65
 		return $post_array;
66 66
 	}
Please login to merge, or discard this patch.
controller/blog/DefaultPageController.class.inc.php 1 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.
controller/blog/HomeController.class.inc.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -32,12 +32,12 @@  discard block
 block discarded – undo
32 32
 	{
33 33
 		parent::set_head_data();
34 34
 		
35
-		if($this->page == 1)
35
+		if ($this->page == 1)
36 36
 			$this->set_title(self::$TITLE_MAIN);
37 37
 		else
38 38
 			$this->set_title(sprintf(self::$TITLE_PAGINATED, $this->page, $this->total_pages));
39 39
 		
40
-		if($this->page == 1)
40
+		if ($this->page == 1)
41 41
 			$this->set_description(self::$DESCRIPTION_MAIN);
42 42
 		else
43 43
 			$this->set_description(sprintf(self::$DESCRIPTION_PAGINATED, $this->page, $this->total_pages));
@@ -47,7 +47,7 @@  discard block
 block discarded – undo
47 47
 
48 48
 	protected function get_introduction()
49 49
 	{
50
-		if($this->page == 1)
50
+		if ($this->page == 1)
51 51
 		{
52 52
 			Loader::load('collector', 'blog/IntroductionCollector');
53 53
 			$introduction_result = IntroductionCollector::getRow('home');
@@ -67,7 +67,7 @@  discard block
 block discarded – undo
67 67
 	protected function get_page_number()
68 68
 	{
69 69
 		$page = URLDecode::getPiece(1);
70
-		if(isset($page) && is_numeric($page))
70
+		if (isset($page) && is_numeric($page))
71 71
 			return $page;
72 72
 		return 1;
73 73
 	}
@@ -87,16 +87,16 @@  discard block
 block discarded – undo
87 87
 
88 88
 	protected function get_list_next_link()
89 89
 	{
90
-		if($this->page == 1)
90
+		if ($this->page == 1)
91 91
 			return;
92
-		if($this->page == 2)
92
+		if ($this->page == 2)
93 93
 			return '/';
94 94
 		return '/' . ($this->page - 1) . '/';
95 95
 	}
96 96
 
97 97
 	protected function get_list_prev_link()
98 98
 	{
99
-		if(($this->page * self::$POSTS_PER_PAGE) >= $this->get_total_post_count())
99
+		if (($this->page * self::$POSTS_PER_PAGE) >= $this->get_total_post_count())
100 100
 			return;
101 101
 		return '/' . ($this->page + 1) . '/';
102 102
 	}
@@ -104,7 +104,7 @@  discard block
 block discarded – undo
104 104
 	private $total_post_count;
105 105
 	protected function get_total_post_count()
106 106
 	{
107
-		if(!isset($this->total_post_count))
107
+		if (!isset($this->total_post_count))
108 108
 			$this->total_post_count = PostCollector::getMainPostCount();
109 109
 		return $this->total_post_count;
110 110
 	}
Please login to merge, or discard this patch.
controller/blog/PostController.class.inc.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -27,7 +27,7 @@  discard block
 block discarded – undo
27 27
 		parent::__construct();
28 28
 		
29 29
 		$this->post = PostCollector::getPostByURI(URLDecode::getPiece(2));
30
-		if($this->post == null)
30
+		if ($this->post == null)
31 31
 			$this->eject();
32 32
 		
33 33
 		$this->handle_comment_submit(
@@ -89,7 +89,7 @@  discard block
 block discarded – undo
89 89
 		$keyword_array = array();
90 90
 		$keywords = $this->tags;
91 91
 		
92
-		foreach($keywords as $keyword)
92
+		foreach ($keywords as $keyword)
93 93
 		{
94 94
 			$keyword_array[] = $keyword->tag;
95 95
 		}
@@ -103,16 +103,16 @@  discard block
 block discarded – undo
103 103
 	private function get_series_posts()
104 104
 	{
105 105
 		$series_posts = $this->fetch_series_posts();
106
-		if(count($series_posts) < 1)
106
+		if (count($series_posts) < 1)
107 107
 			return array();
108 108
 		
109 109
 		$previous_post = new stdclass();
110 110
 		$next_post = new stdclass();
111 111
 		
112 112
 		$found_current_post = false;
113
-		foreach($series_posts as $post_row)
113
+		foreach ($series_posts as $post_row)
114 114
 		{
115
-			if($post_row->post == $this->post->id)
115
+			if ($post_row->post == $this->post->id)
116 116
 			{
117 117
 				$found_current_post = true;
118 118
 				continue;
@@ -132,7 +132,7 @@  discard block
 block discarded – undo
132 132
 
133 133
 			$post->url = Loader::getRootUrl('blog') . "{$post_row->category}/{$post_row->path}/";
134 134
 			
135
-			if(!$found_current_post)
135
+			if (!$found_current_post)
136 136
 				$previous_post = $post;
137 137
 			else
138 138
 			{
@@ -151,7 +151,7 @@  discard block
 block discarded – undo
151 151
 	private $series_posts;
152 152
 	private function fetch_series_posts()
153 153
 	{
154
-		if(!isset($this->series_posts))
154
+		if (!isset($this->series_posts))
155 155
 			$this->series_posts = SeriesCollector::getSeriesForPost($this->post->id);
156 156
 		return $this->series_posts;
157 157
 	}
@@ -159,14 +159,14 @@  discard block
 block discarded – undo
159 159
 	private function get_related_posts()
160 160
 	{
161 161
 		$tag_array = array();
162
-		foreach($this->tags as $tag)
162
+		foreach ($this->tags as $tag)
163 163
 		{
164 164
 			$tag_array[] = $tag->id;
165 165
 		}
166 166
 		
167 167
 		$series_posts = $this->fetch_series_posts();
168 168
 		$exclude_post_array = array();
169
-		foreach($series_posts as $series_post)
169
+		foreach ($series_posts as $series_post)
170 170
 		{
171 171
 			$exclude_post_array[] = $series_post->post;
172 172
 		}
@@ -174,7 +174,7 @@  discard block
 block discarded – undo
174 174
 		$post_array = array();
175 175
 		$post_result = PostCollector::getRelatedPosts($this->post->id, $tag_array, $exclude_post_array);
176 176
 		
177
-		foreach($post_result as $post_row)
177
+		foreach ($post_result as $post_row)
178 178
 		{
179 179
 			$post = new stdclass();
180 180
 			$post->title = $post_row->title;
Please login to merge, or discard this patch.
controller/blog/SearchController.class.inc.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -45,7 +45,7 @@  discard block
 block discarded – undo
45 45
 	{
46 46
 		parent::set_head_data();
47 47
 		
48
-		if($this->page == 1)
48
+		if ($this->page == 1)
49 49
 		{
50 50
 			$this->set_title(sprintf(self::$TITLE_MAIN, ucwords($this->query)));
51 51
 			$this->set_description(sprintf(self::$DESCRIPTION_MAIN, ucwords($this->query)));
@@ -63,10 +63,10 @@  discard block
 block discarded – undo
63 63
 
64 64
 	protected function get_introduction()
65 65
 	{
66
-		if($this->total_pages > 1)
66
+		if ($this->total_pages > 1)
67 67
 			return array(
68 68
 				'title' => "Posts from search '{$this->query}', page {$this->page} of {$this->total_pages}.");
69
-		else if($this->total_pages == 1)
69
+		else if ($this->total_pages == 1)
70 70
 			return array(
71 71
 				'title' => "Posts from search '{$this->query}'.");
72 72
 		else
@@ -77,7 +77,7 @@  discard block
 block discarded – undo
77 77
 	protected function get_page_number()
78 78
 	{
79 79
 		$page = URLDecode::getPiece(3);
80
-		if(isset($page) && is_numeric($page))
80
+		if (isset($page) && is_numeric($page))
81 81
 			return $page;
82 82
 		return 1;
83 83
 	}
@@ -85,7 +85,7 @@  discard block
 block discarded – undo
85 85
 	private $search_result;
86 86
 	private function get_search_result()
87 87
 	{
88
-		if(!isset($this->search_result))
88
+		if (!isset($this->search_result))
89 89
 		{
90 90
 			$posts = PostCollector::getMainList(self::$MAXIMUM_SEARCH_POSTS);
91 91
 			
@@ -113,16 +113,16 @@  discard block
 block discarded – undo
113 113
 
114 114
 	protected function get_list_next_link()
115 115
 	{
116
-		if($this->page == 1)
116
+		if ($this->page == 1)
117 117
 			return;
118
-		if($this->page == 2)
118
+		if ($this->page == 2)
119 119
 			return Content::instance('URLSafe', "/search/{$this->query}/")->activate();
120 120
 		return Content::instance('URLSafe', "/search/{$this->query}/" . ($this->page - 1) . '/')->activate();
121 121
 	}
122 122
 
123 123
 	protected function get_list_prev_link()
124 124
 	{
125
-		if(($this->page * self::$POSTS_PER_PAGE) >= $this->get_total_post_count())
125
+		if (($this->page * self::$POSTS_PER_PAGE) >= $this->get_total_post_count())
126 126
 			return;
127 127
 		return Content::instance('URLSafe', "/search/{$this->query}/" . ($this->page + 1) . '/')->activate();
128 128
 	}
@@ -130,7 +130,7 @@  discard block
 block discarded – undo
130 130
 	private $total_post_count;
131 131
 	protected function get_total_post_count()
132 132
 	{
133
-		if(!isset($this->total_post_count))
133
+		if (!isset($this->total_post_count))
134 134
 			$this->total_post_count = count($this->get_search_result());
135 135
 		return $this->total_post_count;
136 136
 	}
Please login to merge, or discard this patch.
controller/blog/TagController.class.inc.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -28,7 +28,7 @@  discard block
 block discarded – undo
28 28
 		$tag = str_replace('-', ' ', $tag);
29 29
 		
30 30
 		$tag_result = TagCollector::getSingleTag($tag);
31
-		if($tag_result === false)
31
+		if ($tag_result === false)
32 32
 			$this->eject();
33 33
 		
34 34
 		$this->tag = $tag_result;
@@ -40,7 +40,7 @@  discard block
 block discarded – undo
40 40
 	{
41 41
 		parent::set_head_data();
42 42
 		
43
-		if($this->page == 1)
43
+		if ($this->page == 1)
44 44
 		{
45 45
 			$this->set_title(sprintf(self::$TITLE_MAIN, ucwords($this->tag->tag)));
46 46
 			$this->set_description(sprintf(self::$DESCRIPTION_MAIN, ucwords($this->tag->tag)));
@@ -60,12 +60,12 @@  discard block
 block discarded – undo
60 60
 	{
61 61
 		$tag = ucwords($this->tag->tag);
62 62
 		
63
-		if($this->page == 1)
63
+		if ($this->page == 1)
64 64
 		{
65 65
 			Loader::load('collector', 'blog/IntroductionCollector');
66 66
 			$introduction_result = IntroductionCollector::getRow('tag', $this->tag->tag);
67 67
 			
68
-			if($introduction_result !== null)
68
+			if ($introduction_result !== null)
69 69
 			{
70 70
 				$introduction = array();
71 71
 				$introduction['title'] = $introduction_result->title;
@@ -86,7 +86,7 @@  discard block
 block discarded – undo
86 86
 	protected function get_page_number()
87 87
 	{
88 88
 		$page = URLDecode::getPiece(3);
89
-		if(isset($page) && is_numeric($page))
89
+		if (isset($page) && is_numeric($page))
90 90
 			return $page;
91 91
 		return 1;
92 92
 	}
@@ -106,16 +106,16 @@  discard block
 block discarded – undo
106 106
 
107 107
 	protected function get_list_next_link()
108 108
 	{
109
-		if($this->page == 1)
109
+		if ($this->page == 1)
110 110
 			return;
111
-		if($this->page == 2)
111
+		if ($this->page == 2)
112 112
 			return Content::instance('URLSafe', "/tag/{$this->tag->tag}/")->activate();
113 113
 		return Content::instance('URLSafe', "/tag/{$this->tag->tag}/" . ($this->page - 1) . '/')->activate();
114 114
 	}
115 115
 
116 116
 	protected function get_list_prev_link()
117 117
 	{
118
-		if(($this->page * self::$POSTS_PER_PAGE) >= $this->get_total_post_count())
118
+		if (($this->page * self::$POSTS_PER_PAGE) >= $this->get_total_post_count())
119 119
 			return;
120 120
 		return Content::instance('URLSafe', "/tag/{$this->tag->tag}/" . ($this->page + 1) . '/')->activate();
121 121
 	}
@@ -123,7 +123,7 @@  discard block
 block discarded – undo
123 123
 	private $total_post_count;
124 124
 	protected function get_total_post_count()
125 125
 	{
126
-		if(!isset($this->total_post_count))
126
+		if (!isset($this->total_post_count))
127 127
 			$this->total_post_count = PostCollector::getPostCountForTag($this->tag->id);
128 128
 		return $this->total_post_count;
129 129
 	}
Please login to merge, or discard this patch.
controller/home/ContactController.class.inc.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -35,16 +35,16 @@  discard block
 block discarded – undo
35 35
 
36 36
 	private function process_form()
37 37
 	{
38
-		if(!Request::hasPost() || Request::getPost('submit') != 'Send Message!')
38
+		if (!Request::hasPost() || Request::getPost('submit') != 'Send Message!')
39 39
 			return (object) array('display' => 'normal');
40 40
 		
41 41
 		Loader::load('utility', 'Validate');
42 42
 		$error_result = array();
43
-		if(!Validate::checkRequest('post', 'name', 'string'))
43
+		if (!Validate::checkRequest('post', 'name', 'string'))
44 44
 			$error_result['name'] = 'please enter your name';
45
-		if(!Validate::checkRequest('post', 'email', 'string'))
45
+		if (!Validate::checkRequest('post', 'email', 'string'))
46 46
 			$error_result['email'] = 'please enter a valid email';
47
-		if(!Validate::checkRequest('post', 'message', 'string'))
47
+		if (!Validate::checkRequest('post', 'message', 'string'))
48 48
 			$error_result['message'] = 'please write a message';
49 49
 		
50 50
 		$values = (object) array(
@@ -52,7 +52,7 @@  discard block
 block discarded – undo
52 52
 			'email' => Request::getPost('email'),
53 53
 			'message' => Request::getPost('message'));
54 54
 		
55
-		if(count($error_result) > 0)
55
+		if (count($error_result) > 0)
56 56
 		{
57 57
 			return (object) array(
58 58
 				'display' => 'error',
Please login to merge, or discard this patch.