@@ -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( |
@@ -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"; |
@@ -28,17 +28,17 @@ discard block |
||
| 28 | 28 | |
| 29 | 29 | private function process_form_data() |
| 30 | 30 | { |
| 31 | - if(!Request::hasPost()) |
|
| 31 | + if (!Request::hasPost()) |
|
| 32 | 32 | return array(); |
| 33 | 33 | |
| 34 | - if(!Validate::checkRequest('post', 'name', 'string')) |
|
| 34 | + if (!Validate::checkRequest('post', 'name', 'string')) |
|
| 35 | 35 | $error_message['name'] = 'Please enter a value for your name.'; |
| 36 | - if(!Validate::checkRequest('post', 'email', 'string')) |
|
| 36 | + if (!Validate::checkRequest('post', 'email', 'string')) |
|
| 37 | 37 | $error_message['email'] = 'Please enter a valid email address.'; |
| 38 | - if(!Validate::checkRequest('post', 'message', 'string')) |
|
| 38 | + if (!Validate::checkRequest('post', 'message', 'string')) |
|
| 39 | 39 | $error_message['message'] = 'Please enter a message.'; |
| 40 | 40 | |
| 41 | - if(!empty($error_message)) |
|
| 41 | + if (!empty($error_message)) |
|
| 42 | 42 | { |
| 43 | 43 | return array( |
| 44 | 44 | 'error_message' => $error_message, |
@@ -58,7 +58,7 @@ discard block |
||
| 58 | 58 | $mail->send(); |
| 59 | 59 | |
| 60 | 60 | return array( |
| 61 | - 'success_message' => "Thank you for your message, ".Request::getPost('name')."! I'll get back to you as soon as possible."); |
|
| 61 | + 'success_message' => "Thank you for your message, " . Request::getPost('name') . "! I'll get back to you as soon as possible."); |
|
| 62 | 62 | } |
| 63 | 63 | } |
| 64 | 64 | |
@@ -36,7 +36,7 @@ discard block |
||
| 36 | 36 | Loader::load('collector', 'portfolio/PortfolioCollector'); |
| 37 | 37 | $portfolio_result = PortfolioCollector::getPieceByURI($this->title_url); |
| 38 | 38 | |
| 39 | - if($portfolio_result === null) |
|
| 39 | + if ($portfolio_result === null) |
|
| 40 | 40 | $this->eject(); |
| 41 | 41 | |
| 42 | 42 | $portfolio_image_result = PortfolioCollector::getImagesForPiece($portfolio_result->id, 2); |
@@ -51,7 +51,7 @@ discard block |
||
| 51 | 51 | $main_image->width = $dimensions[0]; |
| 52 | 52 | $main_image->height = $dimensions[1]; |
| 53 | 53 | |
| 54 | - foreach($portfolio_image_result as $portfolio_image) |
|
| 54 | + foreach ($portfolio_image_result as $portfolio_image) |
|
| 55 | 55 | { |
| 56 | 56 | $thumb = $portfolio_image->name; |
| 57 | 57 | $thumb_array = explode('.', $thumb); |
@@ -72,7 +72,7 @@ discard block |
||
| 72 | 72 | |
| 73 | 73 | $portfolio_tag_result = PortfolioCollector::getTagsForPiece($portfolio_result->id); |
| 74 | 74 | |
| 75 | - foreach($portfolio_tag_result as $portfolio_tag) |
|
| 75 | + foreach ($portfolio_tag_result as $portfolio_tag) |
|
| 76 | 76 | { |
| 77 | 77 | $tag_array[] = $portfolio_tag->name; |
| 78 | 78 | } |