@@ -34,7 +34,7 @@ |
||
| 34 | 34 | {
|
| 35 | 35 | $query = URLDecode::getPiece(2); |
| 36 | 36 | $query = urldecode($query); |
| 37 | - $query = str_replace('-', ' ', $query);
|
|
| 37 | + $query = str_replace('-', ' ', $query);
|
|
| 38 | 38 | |
| 39 | 39 | $this->query = $query; |
| 40 | 40 | |
@@ -45,7 +45,7 @@ discard block |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 | } |
@@ -49,8 +49,7 @@ discard block |
||
| 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))); |
| 52 | - } |
|
| 53 | - else |
|
| 52 | + } else |
|
| 54 | 53 | {
|
| 55 | 54 | $this->set_title(sprintf(self::$TITLE_PAGINATED, ucwords($this->query), $this->page, $this->total_pages)); |
| 56 | 55 | $this->set_description(sprintf(self::$DESCRIPTION_PAGINATED, $this->page, $this->total_pages, ucwords($this->query))); |
@@ -63,22 +62,24 @@ discard block |
||
| 63 | 62 | |
| 64 | 63 | protected function get_introduction() |
| 65 | 64 | {
|
| 66 | - if($this->total_pages > 1) |
|
| 67 | - return array( |
|
| 65 | + if($this->total_pages > 1) {
|
|
| 66 | + return array( |
|
| 68 | 67 | 'title' => "Posts from search '{$this->query}', page {$this->page} of {$this->total_pages}.");
|
| 69 | - else if($this->total_pages == 1) |
|
| 70 | - return array( |
|
| 68 | + } else if($this->total_pages == 1) {
|
|
| 69 | + return array( |
|
| 71 | 70 | 'title' => "Posts from search '{$this->query}'.");
|
| 72 | - else |
|
| 73 | - return array( |
|
| 71 | + } else {
|
|
| 72 | + return array( |
|
| 74 | 73 | 'title' => "Sorry, '{$this->query}' didn't return any posts.");
|
| 74 | + } |
|
| 75 | 75 | } |
| 76 | 76 | |
| 77 | 77 | protected function get_page_number() |
| 78 | 78 | {
|
| 79 | 79 | $page = URLDecode::getPiece(3); |
| 80 | - if(isset($page) && is_numeric($page)) |
|
| 81 | - return $page; |
|
| 80 | + if(isset($page) && is_numeric($page)) {
|
|
| 81 | + return $page; |
|
| 82 | + } |
|
| 82 | 83 | return 1; |
| 83 | 84 | } |
| 84 | 85 | |
@@ -113,25 +114,29 @@ discard block |
||
| 113 | 114 | |
| 114 | 115 | protected function get_list_next_link() |
| 115 | 116 | {
|
| 116 | - if($this->page == 1) |
|
| 117 | - return; |
|
| 118 | - if($this->page == 2) |
|
| 119 | - return Content::instance('URLSafe', "/search/{$this->query}/")->activate();
|
|
| 117 | + if($this->page == 1) {
|
|
| 118 | + return; |
|
| 119 | + } |
|
| 120 | + if($this->page == 2) {
|
|
| 121 | + return Content::instance('URLSafe', "/search/{$this->query}/")->activate();
|
|
| 122 | + } |
|
| 120 | 123 | return Content::instance('URLSafe', "/search/{$this->query}/" . ($this->page - 1) . '/')->activate();
|
| 121 | 124 | } |
| 122 | 125 | |
| 123 | 126 | protected function get_list_prev_link() |
| 124 | 127 | {
|
| 125 | - if(($this->page * self::$POSTS_PER_PAGE) >= $this->get_total_post_count()) |
|
| 126 | - return; |
|
| 128 | + if(($this->page * self::$POSTS_PER_PAGE) >= $this->get_total_post_count()) {
|
|
| 129 | + return; |
|
| 130 | + } |
|
| 127 | 131 | return Content::instance('URLSafe', "/search/{$this->query}/" . ($this->page + 1) . '/')->activate();
|
| 128 | 132 | } |
| 129 | 133 | |
| 130 | 134 | private $total_post_count; |
| 131 | 135 | protected function get_total_post_count() |
| 132 | 136 | {
|
| 133 | - if(!isset($this->total_post_count)) |
|
| 134 | - $this->total_post_count = count($this->get_search_result()); |
|
| 137 | + if(!isset($this->total_post_count)) {
|
|
| 138 | + $this->total_post_count = count($this->get_search_result()); |
|
| 139 | + } |
|
| 135 | 140 | return $this->total_post_count; |
| 136 | 141 | } |
| 137 | 142 | |
@@ -28,7 +28,7 @@ discard block |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 | } |
@@ -28,8 +28,9 @@ discard block |
||
| 28 | 28 | $tag = str_replace('-', ' ', $tag);
|
| 29 | 29 | |
| 30 | 30 | $tag_result = TagCollector::getSingleTag($tag); |
| 31 | - if($tag_result === false) |
|
| 32 | - $this->eject(); |
|
| 31 | + if($tag_result === false) {
|
|
| 32 | + $this->eject(); |
|
| 33 | + } |
|
| 33 | 34 | |
| 34 | 35 | $this->tag = $tag_result; |
| 35 | 36 | |
@@ -44,8 +45,7 @@ discard block |
||
| 44 | 45 | {
|
| 45 | 46 | $this->set_title(sprintf(self::$TITLE_MAIN, ucwords($this->tag->tag))); |
| 46 | 47 | $this->set_description(sprintf(self::$DESCRIPTION_MAIN, ucwords($this->tag->tag))); |
| 47 | - } |
|
| 48 | - else |
|
| 48 | + } else |
|
| 49 | 49 | {
|
| 50 | 50 | $this->set_title(sprintf(self::$TITLE_PAGINATED, ucwords($this->tag->tag), $this->page, $this->total_pages)); |
| 51 | 51 | $this->set_description(sprintf(self::$DESCRIPTION_PAGINATED, $this->page, $this->total_pages, ucwords($this->tag->tag))); |
@@ -86,8 +86,9 @@ discard block |
||
| 86 | 86 | protected function get_page_number() |
| 87 | 87 | {
|
| 88 | 88 | $page = URLDecode::getPiece(3); |
| 89 | - if(isset($page) && is_numeric($page)) |
|
| 90 | - return $page; |
|
| 89 | + if(isset($page) && is_numeric($page)) {
|
|
| 90 | + return $page; |
|
| 91 | + } |
|
| 91 | 92 | return 1; |
| 92 | 93 | } |
| 93 | 94 | |
@@ -106,25 +107,29 @@ discard block |
||
| 106 | 107 | |
| 107 | 108 | protected function get_list_next_link() |
| 108 | 109 | {
|
| 109 | - if($this->page == 1) |
|
| 110 | - return; |
|
| 111 | - if($this->page == 2) |
|
| 112 | - return Content::instance('URLSafe', "/tag/{$this->tag->tag}/")->activate();
|
|
| 110 | + if($this->page == 1) {
|
|
| 111 | + return; |
|
| 112 | + } |
|
| 113 | + if($this->page == 2) {
|
|
| 114 | + return Content::instance('URLSafe', "/tag/{$this->tag->tag}/")->activate();
|
|
| 115 | + } |
|
| 113 | 116 | return Content::instance('URLSafe', "/tag/{$this->tag->tag}/" . ($this->page - 1) . '/')->activate();
|
| 114 | 117 | } |
| 115 | 118 | |
| 116 | 119 | protected function get_list_prev_link() |
| 117 | 120 | {
|
| 118 | - if(($this->page * self::$POSTS_PER_PAGE) >= $this->get_total_post_count()) |
|
| 119 | - return; |
|
| 121 | + if(($this->page * self::$POSTS_PER_PAGE) >= $this->get_total_post_count()) {
|
|
| 122 | + return; |
|
| 123 | + } |
|
| 120 | 124 | return Content::instance('URLSafe', "/tag/{$this->tag->tag}/" . ($this->page + 1) . '/')->activate();
|
| 121 | 125 | } |
| 122 | 126 | |
| 123 | 127 | private $total_post_count; |
| 124 | 128 | protected function get_total_post_count() |
| 125 | 129 | {
|
| 126 | - if(!isset($this->total_post_count)) |
|
| 127 | - $this->total_post_count = PostCollector::getPostCountForTag($this->tag->id); |
|
| 130 | + if(!isset($this->total_post_count)) {
|
|
| 131 | + $this->total_post_count = PostCollector::getPostCountForTag($this->tag->id); |
|
| 132 | + } |
|
| 128 | 133 | return $this->total_post_count; |
| 129 | 134 | } |
| 130 | 135 | |
@@ -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 | |
@@ -18,12 +18,13 @@ discard block |
||
| 18 | 18 | |
| 19 | 19 | if( |
| 20 | 20 | URLDecode::getSite() == 'images' || |
| 21 | - URLDecode::getExtension() == 'ico') |
|
| 22 | - $file = "/css/{$file}";
|
|
| 23 | - else if(URLDecode::getSite() == 'portfolio') |
|
| 24 | - $file = "/portfolio/{$file}";
|
|
| 25 | - else if(substr($file, 0, 7) == '/photo/') |
|
| 26 | - $file = '/photo/processed/' . substr($file, 7); |
|
| 21 | + URLDecode::getExtension() == 'ico') {
|
|
| 22 | + $file = "/css/{$file}";
|
|
| 23 | + } else if(URLDecode::getSite() == 'portfolio') {
|
|
| 24 | + $file = "/portfolio/{$file}";
|
|
| 25 | + } else if(substr($file, 0, 7) == '/photo/') {
|
|
| 26 | + $file = '/photo/processed/' . substr($file, 7); |
|
| 27 | + } |
|
| 27 | 28 | |
| 28 | 29 | $this->use_old_image_logic($file); |
| 29 | 30 | |
@@ -78,8 +79,9 @@ discard block |
||
| 78 | 79 | |
| 79 | 80 | protected function eject() |
| 80 | 81 | {
|
| 81 | - if(get_class($this) !== 'Error404Controller') |
|
| 82 | - Loader::loadNew('controller', '/Error404Controller')->activate();
|
|
| 82 | + if(get_class($this) !== 'Error404Controller') {
|
|
| 83 | + Loader::loadNew('controller', '/Error404Controller')->activate();
|
|
| 84 | + } |
|
| 83 | 85 | } |
| 84 | 86 | |
| 85 | 87 | } |
@@ -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 | } |
@@ -59,8 +59,9 @@ |
||
| 59 | 59 | {
|
| 60 | 60 | $post_array[] = $this->expand_post($post, 'full'); |
| 61 | 61 | } |
| 62 | - if(count($post_array) < 1 && URLDecode::getPiece(1) !== 'search') |
|
| 63 | - $this->eject(); |
|
| 62 | + if(count($post_array) < 1 && URLDecode::getPiece(1) !== 'search') {
|
|
| 63 | + $this->eject(); |
|
| 64 | + } |
|
| 64 | 65 | return $post_array; |
| 65 | 66 | } |
| 66 | 67 | |
@@ -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 | } |
@@ -38,8 +38,9 @@ discard block |
||
| 38 | 38 | protected function get_page_number() |
| 39 | 39 | {
|
| 40 | 40 | $page = URLDecode::getPiece(2); |
| 41 | - if(isset($page) && is_numeric($page)) |
|
| 42 | - return $page; |
|
| 41 | + if(isset($page) && is_numeric($page)) {
|
|
| 42 | + return $page; |
|
| 43 | + } |
|
| 43 | 44 | return 1; |
| 44 | 45 | } |
| 45 | 46 | |
@@ -58,25 +59,29 @@ discard block |
||
| 58 | 59 | |
| 59 | 60 | protected function get_list_next_link() |
| 60 | 61 | {
|
| 61 | - if($this->page == 1) |
|
| 62 | - return; |
|
| 63 | - if($this->page == 2) |
|
| 64 | - return Loader::getRootUrl('lifestream');
|
|
| 62 | + if($this->page == 1) {
|
|
| 63 | + return; |
|
| 64 | + } |
|
| 65 | + if($this->page == 2) {
|
|
| 66 | + return Loader::getRootUrl('lifestream');
|
|
| 67 | + } |
|
| 65 | 68 | return Loader::getRootUrl('lifestream') . 'page/' . ($this->page - 1) . '/';
|
| 66 | 69 | } |
| 67 | 70 | |
| 68 | 71 | protected function get_list_prev_link() |
| 69 | 72 | {
|
| 70 | - if(($this->page * self::$POSTS_PER_PAGE) >= $this->get_total_post_count()) |
|
| 71 | - return; |
|
| 73 | + if(($this->page * self::$POSTS_PER_PAGE) >= $this->get_total_post_count()) {
|
|
| 74 | + return; |
|
| 75 | + } |
|
| 72 | 76 | return Loader::getRootUrl('lifestream') . 'page/' . ($this->page + 1) . '/';
|
| 73 | 77 | } |
| 74 | 78 | |
| 75 | 79 | private $total_post_count; |
| 76 | 80 | protected function get_total_post_count() |
| 77 | 81 | {
|
| 78 | - if(!isset($this->total_post_count)) |
|
| 79 | - $this->total_post_count = ActivityCollector::getCount(); |
|
| 82 | + if(!isset($this->total_post_count)) {
|
|
| 83 | + $this->total_post_count = ActivityCollector::getCount(); |
|
| 84 | + } |
|
| 80 | 85 | return $this->total_post_count; |
| 81 | 86 | } |
| 82 | 87 | |
@@ -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?'; |
@@ -20,15 +20,18 @@ |
||
| 20 | 20 | parent::__construct(); |
| 21 | 21 | |
| 22 | 22 | $id = URLDecode::getPiece(2); |
| 23 | - if(!$id || !is_numeric($id)) |
|
| 24 | - $this->eject(); |
|
| 23 | + if(!$id || !is_numeric($id)) {
|
|
| 24 | + $this->eject(); |
|
| 25 | + } |
|
| 25 | 26 | |
| 26 | 27 | $post = ActivityCollector::getPost($id); |
| 27 | - if(!$post) |
|
| 28 | - $this->eject(); |
|
| 28 | + if(!$post) {
|
|
| 29 | + $this->eject(); |
|
| 30 | + } |
|
| 29 | 31 | |
| 30 | - if(URLDecode::getPiece(1) != $post->type) |
|
| 31 | - $this->eject(); |
|
| 32 | + if(URLDecode::getPiece(1) != $post->type) {
|
|
| 33 | + $this->eject(); |
|
| 34 | + } |
|
| 32 | 35 | |
| 33 | 36 | $this->post = $post; |
| 34 | 37 | } |
@@ -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 | } |
@@ -97,8 +97,9 @@ discard block |
||
| 97 | 97 | protected function get_page_number() |
| 98 | 98 | {
|
| 99 | 99 | $page = URLDecode::getPiece(3); |
| 100 | - if(isset($page) && is_numeric($page)) |
|
| 101 | - return $page; |
|
| 100 | + if(isset($page) && is_numeric($page)) {
|
|
| 101 | + return $page; |
|
| 102 | + } |
|
| 102 | 103 | return 1; |
| 103 | 104 | } |
| 104 | 105 | |
@@ -117,25 +118,29 @@ discard block |
||
| 117 | 118 | |
| 118 | 119 | protected function get_list_next_link() |
| 119 | 120 | {
|
| 120 | - if($this->page == 1) |
|
| 121 | - return; |
|
| 122 | - if($this->page == 2) |
|
| 123 | - return Loader::getRootUrl('lifestream') . $this->tag . '/';
|
|
| 121 | + if($this->page == 1) {
|
|
| 122 | + return; |
|
| 123 | + } |
|
| 124 | + if($this->page == 2) {
|
|
| 125 | + return Loader::getRootUrl('lifestream') . $this->tag . '/';
|
|
| 126 | + } |
|
| 124 | 127 | return Loader::getRootUrl('lifestream') . $this->tag . '/page/' . ($this->page - 1) . '/';
|
| 125 | 128 | } |
| 126 | 129 | |
| 127 | 130 | protected function get_list_prev_link() |
| 128 | 131 | {
|
| 129 | - if(($this->page * self::$POSTS_PER_PAGE) >= $this->get_total_post_count()) |
|
| 130 | - return; |
|
| 132 | + if(($this->page * self::$POSTS_PER_PAGE) >= $this->get_total_post_count()) {
|
|
| 133 | + return; |
|
| 134 | + } |
|
| 131 | 135 | return Loader::getRootUrl('lifestream') . $this->tag . '/page/' . ($this->page + 1) . '/';
|
| 132 | 136 | } |
| 133 | 137 | |
| 134 | 138 | private $total_post_count; |
| 135 | 139 | protected function get_total_post_count() |
| 136 | 140 | {
|
| 137 | - if(!isset($this->total_post_count)) |
|
| 138 | - $this->total_post_count = ActivityCollector::getCountForTag($this->tag); |
|
| 141 | + if(!isset($this->total_post_count)) {
|
|
| 142 | + $this->total_post_count = ActivityCollector::getCountForTag($this->tag); |
|
| 143 | + } |
|
| 139 | 144 | return $this->total_post_count; |
| 140 | 145 | } |
| 141 | 146 | |
@@ -47,7 +47,7 @@ |
||
| 47 | 47 | |
| 48 | 48 | else |
| 49 | 49 | {
|
| 50 | - global $config; |
|
| 50 | + global $config; |
|
| 51 | 51 | $mail = new Mail(); |
| 52 | 52 | $mail->setToAddress($config->admin_email, 'Jacob Emerick'); |
| 53 | 53 | $mail->setSubject('Portfolio Contact');
|
@@ -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 | |
@@ -28,24 +28,26 @@ |
||
| 28 | 28 | |
| 29 | 29 | private function process_form_data() |
| 30 | 30 | {
|
| 31 | - if(!Request::hasPost()) |
|
| 32 | - return array(); |
|
| 31 | + if(!Request::hasPost()) {
|
|
| 32 | + return array(); |
|
| 33 | + } |
|
| 33 | 34 | |
| 34 | - if(!Validate::checkRequest('post', 'name', 'string'))
|
|
| 35 | - $error_message['name'] = 'Please enter a value for your name.'; |
|
| 36 | - if(!Validate::checkRequest('post', 'email', 'string'))
|
|
| 37 | - $error_message['email'] = 'Please enter a valid email address.'; |
|
| 38 | - if(!Validate::checkRequest('post', 'message', 'string'))
|
|
| 39 | - $error_message['message'] = 'Please enter a message.'; |
|
| 35 | + if(!Validate::checkRequest('post', 'name', 'string')) {
|
|
| 36 | + $error_message['name'] = 'Please enter a value for your name.'; |
|
| 37 | + } |
|
| 38 | + if(!Validate::checkRequest('post', 'email', 'string')) {
|
|
| 39 | + $error_message['email'] = 'Please enter a valid email address.'; |
|
| 40 | + } |
|
| 41 | + if(!Validate::checkRequest('post', 'message', 'string')) {
|
|
| 42 | + $error_message['message'] = 'Please enter a message.'; |
|
| 43 | + } |
|
| 40 | 44 | |
| 41 | 45 | if(!empty($error_message)) |
| 42 | 46 | {
|
| 43 | 47 | return array( |
| 44 | 48 | 'error_message' => $error_message, |
| 45 | 49 | 'value' => Request::getPost()); |
| 46 | - } |
|
| 47 | - |
|
| 48 | - else |
|
| 50 | + } else |
|
| 49 | 51 | {
|
| 50 | 52 | global $config; |
| 51 | 53 | $mail = new Mail(); |
@@ -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"; |
@@ -39,10 +39,11 @@ discard block |
||
| 39 | 39 | 'name' => 'Contact', |
| 40 | 40 | 'link' => Loader::getRootURL() . 'contact/')); |
| 41 | 41 | |
| 42 | - if(!URLDecode::getPiece(1)) |
|
| 43 | - $active_page = 'About'; |
|
| 44 | - else |
|
| 45 | - $active_page = ucfirst(URLDecode::getPiece(1)); |
|
| 42 | + if(!URLDecode::getPiece(1)) {
|
|
| 43 | + $active_page = 'About'; |
|
| 44 | + } else {
|
|
| 45 | + $active_page = ucfirst(URLDecode::getPiece(1)); |
|
| 46 | + } |
|
| 46 | 47 | |
| 47 | 48 | foreach($menu as $menu_item) |
| 48 | 49 | {
|
@@ -63,10 +64,11 @@ discard block |
||
| 63 | 64 | {
|
| 64 | 65 | $piece_obj = new stdclass(); |
| 65 | 66 | $piece_obj->title = $piece->title; |
| 66 | - if("{$piece->category}" == 1)
|
|
| 67 | - $piece_obj->url = Loader::getRootURL() . "web/{$piece->title_url}/";
|
|
| 68 | - else |
|
| 69 | - $piece_obj->url = Loader::getRootURL() . "print/{$piece->title_url}/";
|
|
| 67 | + if("{$piece->category}" == 1) {
|
|
| 68 | + $piece_obj->url = Loader::getRootURL() . "web/{$piece->title_url}/";
|
|
| 69 | + } else {
|
|
| 70 | + $piece_obj->url = Loader::getRootURL() . "print/{$piece->title_url}/";
|
|
| 71 | + } |
|
| 70 | 72 | $piece_obj->image = "/{$piece->image}";
|
| 71 | 73 | $piece_array[] = $piece_obj; |
| 72 | 74 | } |