@@ -37,7 +37,7 @@ discard block |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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); |
@@ -32,12 +32,12 @@ discard block |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 | } |
@@ -56,11 +56,11 @@ |
||
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 | } |
@@ -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 |
@@ -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, |
@@ -29,7 +29,7 @@ |
||
29 | 29 | Loader::load('collector', 'data/ChangelogCollector'); |
30 | 30 | $changelog_result = ChangelogCollector::getLast20Changes(); |
31 | 31 | |
32 | - foreach($changelog_result as $change) |
|
32 | + foreach ($changelog_result as $change) |
|
33 | 33 | { |
34 | 34 | $changelog[] = (object) array( |
35 | 35 | 'date' => (object) array( |
@@ -16,13 +16,13 @@ discard block |
||
16 | 16 | { |
17 | 17 | $file = URLDecode::getURI(); |
18 | 18 | |
19 | - if( |
|
19 | + if ( |
|
20 | 20 | URLDecode::getSite() == 'images' || |
21 | 21 | URLDecode::getExtension() == 'ico') |
22 | 22 | $file = "/css/{$file}"; |
23 | - else if(URLDecode::getSite() == 'portfolio') |
|
23 | + else if (URLDecode::getSite() == 'portfolio') |
|
24 | 24 | $file = "/portfolio/{$file}"; |
25 | - else if(substr($file, 0, 7) == '/photo/') |
|
25 | + else if (substr($file, 0, 7) == '/photo/') |
|
26 | 26 | $file = '/photo/processed/' . substr($file, 7); |
27 | 27 | |
28 | 28 | $this->use_old_image_logic($file); |
@@ -32,7 +32,7 @@ discard block |
||
32 | 32 | |
33 | 33 | private function send_headers($extension, $last_modified) |
34 | 34 | { |
35 | - switch($extension) |
|
35 | + switch ($extension) |
|
36 | 36 | { |
37 | 37 | case 'gif' : |
38 | 38 | Header::sendGIF($last_modified); |
@@ -52,11 +52,11 @@ discard block |
||
52 | 52 | private function use_old_image_logic($file) |
53 | 53 | { |
54 | 54 | $image = new ImageOld($file); |
55 | - if(!$image->isValid()) { |
|
55 | + if (!$image->isValid()) { |
|
56 | 56 | $this->eject(); |
57 | 57 | } |
58 | 58 | |
59 | - switch($image->getExtension()) |
|
59 | + switch ($image->getExtension()) |
|
60 | 60 | { |
61 | 61 | case 'gif' : |
62 | 62 | Header::sendGIF($image->getLastModified()); |
@@ -78,7 +78,7 @@ discard block |
||
78 | 78 | |
79 | 79 | protected function eject() |
80 | 80 | { |
81 | - if(get_class($this) !== 'Error404Controller') |
|
81 | + if (get_class($this) !== 'Error404Controller') |
|
82 | 82 | Loader::loadNew('controller', '/Error404Controller')->activate(); |
83 | 83 | } |
84 | 84 |
@@ -35,7 +35,7 @@ |
||
35 | 35 | Loader::load('collector', 'SiteCollector'); |
36 | 36 | $site_result = SiteCollector::getSitesForMenu(); |
37 | 37 | |
38 | - foreach($site_result as $site) |
|
38 | + foreach ($site_result as $site) |
|
39 | 39 | { |
40 | 40 | $site_array[] = array( |
41 | 41 | 'url' => $site->url, |
@@ -39,12 +39,12 @@ discard block |
||
39 | 39 | 'name' => 'Contact', |
40 | 40 | 'link' => Loader::getRootURL() . 'contact/')); |
41 | 41 | |
42 | - if(!URLDecode::getPiece(1)) |
|
42 | + if (!URLDecode::getPiece(1)) |
|
43 | 43 | $active_page = 'About'; |
44 | 44 | else |
45 | 45 | $active_page = ucfirst(URLDecode::getPiece(1)); |
46 | 46 | |
47 | - foreach($menu as $menu_item) |
|
47 | + foreach ($menu as $menu_item) |
|
48 | 48 | { |
49 | 49 | $menu_item = (object) $menu_item; |
50 | 50 | $menu_item->active = ($menu_item->name == $active_page); |
@@ -59,11 +59,11 @@ discard block |
||
59 | 59 | Loader::load('collector', 'portfolio/PortfolioCollector'); |
60 | 60 | $portfolio_result = PortfolioCollector::getPiecesForCategory($category_id); |
61 | 61 | |
62 | - foreach($portfolio_result as $piece) |
|
62 | + foreach ($portfolio_result as $piece) |
|
63 | 63 | { |
64 | 64 | $piece_obj = new stdclass(); |
65 | 65 | $piece_obj->title = $piece->title; |
66 | - if("{$piece->category}" == 1) |
|
66 | + if ("{$piece->category}" == 1) |
|
67 | 67 | $piece_obj->url = Loader::getRootURL() . "web/{$piece->title_url}/"; |
68 | 68 | else |
69 | 69 | $piece_obj->url = Loader::getRootURL() . "print/{$piece->title_url}/"; |
@@ -71,7 +71,7 @@ discard block |
||
71 | 71 | $piece_array[] = $piece_obj; |
72 | 72 | } |
73 | 73 | |
74 | - switch($category_id) |
|
74 | + switch ($category_id) |
|
75 | 75 | { |
76 | 76 | case 1 : |
77 | 77 | $title = "Sites I've worked on"; |