@@ -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 | } |
@@ -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 | } |
@@ -36,8 +36,9 @@ |
||
| 36 | 36 | Loader::load('collector', 'portfolio/PortfolioCollector');
|
| 37 | 37 | $portfolio_result = PortfolioCollector::getPieceByURI($this->title_url); |
| 38 | 38 | |
| 39 | - if($portfolio_result === null) |
|
| 40 | - $this->eject(); |
|
| 39 | + if($portfolio_result === null) {
|
|
| 40 | + $this->eject(); |
|
| 41 | + } |
|
| 41 | 42 | |
| 42 | 43 | $portfolio_image_result = PortfolioCollector::getImagesForPiece($portfolio_result->id, 2); |
| 43 | 44 | $image = new ImageOld("portfolio/{$portfolio_image_result[0]->name}");
|
@@ -5,9 +5,9 @@ |
||
| 5 | 5 | class WaterfallsRobotController extends RobotController |
| 6 | 6 | {
|
| 7 | 7 | |
| 8 | - protected function set_data() |
|
| 9 | - {
|
|
| 10 | - $this->disallow_for_all_robots('/search/');
|
|
| 11 | - } |
|
| 8 | + protected function set_data() |
|
| 9 | + {
|
|
| 10 | + $this->disallow_for_all_robots('/search/');
|
|
| 11 | + } |
|
| 12 | 12 | |
| 13 | 13 | } |
@@ -26,7 +26,7 @@ |
||
| 26 | 26 | {
|
| 27 | 27 | $post_result = PostCollector::getMainList(250); |
| 28 | 28 | |
| 29 | - foreach($post_result as $post) |
|
| 29 | + foreach ($post_result as $post) |
|
| 30 | 30 | {
|
| 31 | 31 | $this->addItem( |
| 32 | 32 | $post->title, |
@@ -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( |
@@ -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,15 +29,19 @@ |
||
| 29 | 29 | |
| 30 | 30 | private function get_form_results() |
| 31 | 31 | {
|
| 32 | - if(!Request::hasPost()) |
|
| 33 | - return array(); |
|
| 32 | + if(!Request::hasPost()) {
|
|
| 33 | + return array(); |
|
| 34 | + } |
|
| 34 | 35 | |
| 35 | - if(!Validate::checkRequest('post', 'name', 'string'))
|
|
| 36 | - $error_message['name'] = 'Please enter a value for your name.'; |
|
| 37 | - if(!Validate::checkRequest('post', 'email', 'string'))
|
|
| 38 | - $error_message['email'] = 'Please enter a valid email address.'; |
|
| 39 | - if(!Validate::checkRequest('post', 'message', 'string'))
|
|
| 40 | - $error_message['message'] = 'Please enter a message.'; |
|
| 36 | + if(!Validate::checkRequest('post', 'name', 'string')) {
|
|
| 37 | + $error_message['name'] = 'Please enter a value for your name.'; |
|
| 38 | + } |
|
| 39 | + if(!Validate::checkRequest('post', 'email', 'string')) {
|
|
| 40 | + $error_message['email'] = 'Please enter a valid email address.'; |
|
| 41 | + } |
|
| 42 | + if(!Validate::checkRequest('post', 'message', 'string')) {
|
|
| 43 | + $error_message['message'] = 'Please enter a message.'; |
|
| 44 | + } |
|
| 41 | 45 | |
| 42 | 46 | if(!empty($error_message)) |
| 43 | 47 | {
|
@@ -12,7 +12,7 @@ |
||
| 12 | 12 | |
| 13 | 13 | public function __construct() |
| 14 | 14 | {
|
| 15 | - global $config; |
|
| 15 | + global $config; |
|
| 16 | 16 | $this->headers['From'] = self::$FROM; |
| 17 | 17 | $this->headers['Reply-To'] = "Jacob <{$config->admin_email}>";
|
| 18 | 18 | $this->headers['Bcc'] = "Jacob <{$config->admin_email}>";
|
@@ -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 | |
@@ -56,14 +56,16 @@ |
||
| 56 | 56 | {
|
| 57 | 57 | $current_uri = URLDecode::getPiece(1); |
| 58 | 58 | |
| 59 | - if(!isset($current_uri)) |
|
| 60 | - return 'About'; |
|
| 59 | + if(!isset($current_uri)) {
|
|
| 60 | + return 'About'; |
|
| 61 | + } |
|
| 61 | 62 | |
| 62 | 63 | $menu = self::$MENU; |
| 63 | 64 | foreach($menu as $link) |
| 64 | 65 | {
|
| 65 | - if($link['uri'] == $current_uri) |
|
| 66 | - return $link['name']; |
|
| 66 | + if($link['uri'] == $current_uri) {
|
|
| 67 | + return $link['name']; |
|
| 68 | + } |
|
| 67 | 69 | } |
| 68 | 70 | |
| 69 | 71 | return 'About'; |
@@ -9,19 +9,19 @@ discard block |
||
| 9 | 9 | final class BlogSitemapController extends SitemapController |
| 10 | 10 | {
|
| 11 | 11 | |
| 12 | - private static $HOME_PAGE_RANK = .9; |
|
| 13 | - private static $CATEGORY_PAGE_RANK = .3; |
|
| 14 | - private static $TAG_PAGE_RANK = .2; |
|
| 15 | - private static $PAGINATED_PAGE_RANK = .1; |
|
| 16 | - private static $POST_PAGE_RANK = .8; |
|
| 12 | + private static $HOME_PAGE_RANK = .9; |
|
| 13 | + private static $CATEGORY_PAGE_RANK = .3; |
|
| 14 | + private static $TAG_PAGE_RANK = .2; |
|
| 15 | + private static $PAGINATED_PAGE_RANK = .1; |
|
| 16 | + private static $POST_PAGE_RANK = .8; |
|
| 17 | 17 | |
| 18 | 18 | private static $HOME_PAGE_CHANGEFREQ = 'daily'; |
| 19 | - private static $CATEGORY_PAGE_CHANGEFREQ = 'weekly'; |
|
| 19 | + private static $CATEGORY_PAGE_CHANGEFREQ = 'weekly'; |
|
| 20 | 20 | private static $TAG_PAGE_CHANGEFREQ = 'monthly'; |
| 21 | - private static $PAGINATED_PAGE_CHANGEFREQ = 'monthly'; |
|
| 21 | + private static $PAGINATED_PAGE_CHANGEFREQ = 'monthly'; |
|
| 22 | 22 | private static $POST_PAGE_CHANGEFREQ = 'weekly'; |
| 23 | 23 | |
| 24 | - private static $POSTS_PER_PAGE = 10; |
|
| 24 | + private static $POSTS_PER_PAGE = 10; |
|
| 25 | 25 | |
| 26 | 26 | private static $CATEGORY_ARRAY = array( |
| 27 | 27 | 'hiking', |
@@ -50,7 +50,7 @@ discard block |
||
| 50 | 50 | {
|
| 51 | 51 | $categories = self::$CATEGORY_ARRAY; |
| 52 | 52 | |
| 53 | - foreach($categories as $category) |
|
| 53 | + foreach ($categories as $category) |
|
| 54 | 54 | {
|
| 55 | 55 | $post_count = PostCollector::getPostCountForCategory($category); |
| 56 | 56 | |
@@ -63,7 +63,7 @@ discard block |
||
| 63 | 63 | {
|
| 64 | 64 | $tags = TagCollector::getAllTags(); |
| 65 | 65 | |
| 66 | - foreach($tags as $tag) |
|
| 66 | + foreach ($tags as $tag) |
|
| 67 | 67 | {
|
| 68 | 68 | $post_count = PostCollector::getPostCountForTag($tag->id); |
| 69 | 69 | |
@@ -76,7 +76,7 @@ discard block |
||
| 76 | 76 | {
|
| 77 | 77 | $posts = PostCollector::getMainList(500); |
| 78 | 78 | |
| 79 | - foreach($posts as $post) |
|
| 79 | + foreach ($posts as $post) |
|
| 80 | 80 | {
|
| 81 | 81 | $base_url = "{$post->category}/{$post->path}/";
|
| 82 | 82 | $this->addURL($base_url, date('Y-m-d', strtotime('last Monday')), self::$POST_PAGE_CHANGEFREQ, self::$POST_PAGE_RANK);
|
@@ -85,7 +85,7 @@ discard block |
||
| 85 | 85 | |
| 86 | 86 | private function add_paginated_pages($post_count, $base_url, $changefreq, $rank) |
| 87 | 87 | {
|
| 88 | - switch($changefreq) |
|
| 88 | + switch ($changefreq) |
|
| 89 | 89 | {
|
| 90 | 90 | case 'daily' : |
| 91 | 91 | $lastmod = date('Y-m-d');
|
@@ -99,7 +99,7 @@ discard block |
||
| 99 | 99 | } |
| 100 | 100 | |
| 101 | 101 | $this->addURL($base_url, $lastmod, $changefreq, $rank); |
| 102 | - for($i = 2; (($i - 1) * self::$POSTS_PER_PAGE) < $post_count; $i++) |
|
| 102 | + for ($i = 2; (($i - 1) * self::$POSTS_PER_PAGE) < $post_count; $i++) |
|
| 103 | 103 | {
|
| 104 | 104 | $this->addURL("{$base_url}{$i}/", date('Y-m-01'), self::$PAGINATED_PAGE_CHANGEFREQ, self::$PAGINATED_PAGE_RANK);
|
| 105 | 105 | } |
@@ -64,6 +64,9 @@ |
||
| 64 | 64 | } |
| 65 | 65 | } |
| 66 | 66 | |
| 67 | + /** |
|
| 68 | + * @param string $changefreq |
|
| 69 | + */ |
|
| 67 | 70 | private function add_paginated_pages($posts, $base_url, $changefreq, $rank) |
| 68 | 71 | {
|
| 69 | 72 | switch($changefreq) |
@@ -16,9 +16,9 @@ |
||
| 16 | 16 | |
| 17 | 17 | $pieces = PortfolioCollector::getAllPieces(); |
| 18 | 18 | |
| 19 | - foreach($pieces as $piece) |
|
| 19 | + foreach ($pieces as $piece) |
|
| 20 | 20 | {
|
| 21 | - if($piece->category == 1) |
|
| 21 | + if ($piece->category == 1) |
|
| 22 | 22 | $this->addURL("web/{$piece->title_url}/", date('Y-01-01'), 'yearly', .7);
|
| 23 | 23 | else |
| 24 | 24 | $this->addURL("print/{$piece->title_url}/", date('Y-01-01'), 'yearly', .7);
|
@@ -18,10 +18,11 @@ |
||
| 18 | 18 | |
| 19 | 19 | foreach($pieces as $piece) |
| 20 | 20 | {
|
| 21 | - if($piece->category == 1) |
|
| 22 | - $this->addURL("web/{$piece->title_url}/", date('Y-01-01'), 'yearly', .7);
|
|
| 23 | - else |
|
| 24 | - $this->addURL("print/{$piece->title_url}/", date('Y-01-01'), 'yearly', .7);
|
|
| 21 | + if($piece->category == 1) {
|
|
| 22 | + $this->addURL("web/{$piece->title_url}/", date('Y-01-01'), 'yearly', .7);
|
|
| 23 | + } else {
|
|
| 24 | + $this->addURL("print/{$piece->title_url}/", date('Y-01-01'), 'yearly', .7);
|
|
| 25 | + } |
|
| 25 | 26 | } |
| 26 | 27 | } |
| 27 | 28 | |