@@ -5,19 +5,19 @@ discard block |
||
5 | 5 | abstract class DefaultPageController extends PageController |
6 | 6 | { |
7 | 7 | |
8 | - protected static $WEBSITE_TITLE = 'Waterfalls of the Keweenaw'; |
|
9 | - protected static $PAGE_DESCRIPTION_LIMIT = 250; |
|
8 | + protected static $WEBSITE_TITLE = 'Waterfalls of the Keweenaw'; |
|
9 | + protected static $PAGE_DESCRIPTION_LIMIT = 250; |
|
10 | 10 | |
11 | - protected static $WATERFALL_SITE_ID = 5; |
|
11 | + protected static $WATERFALL_SITE_ID = 5; |
|
12 | 12 | |
13 | 13 | protected $parent_navigation_item = ''; |
14 | 14 | |
15 | - protected function set_head_data() |
|
16 | - { |
|
17 | - $this->set_head('google_verification', 'm9ua4n8lp4FUYYa2UOh51UyZYfdivl-kRTtXKwaH0-s'); |
|
18 | - $this->add_css('normalize'); |
|
19 | - $this->add_css('waterfalls'); |
|
20 | - } |
|
15 | + protected function set_head_data() |
|
16 | + { |
|
17 | + $this->set_head('google_verification', 'm9ua4n8lp4FUYYa2UOh51UyZYfdivl-kRTtXKwaH0-s'); |
|
18 | + $this->add_css('normalize'); |
|
19 | + $this->add_css('waterfalls'); |
|
20 | + } |
|
21 | 21 | |
22 | 22 | protected function add_waterfall_js() |
23 | 23 | { |
@@ -26,9 +26,9 @@ discard block |
||
26 | 26 | $this->add_js('waterfalls'); |
27 | 27 | } |
28 | 28 | |
29 | - protected function set_body_data($page_type = 'normal') |
|
30 | - { |
|
31 | - $this->set_body('activity_array', $this->get_recent_activity()); |
|
29 | + protected function set_body_data($page_type = 'normal') |
|
30 | + { |
|
31 | + $this->set_body('activity_array', $this->get_recent_activity()); |
|
32 | 32 | |
33 | 33 | $this->set_body('main_navigation', array( |
34 | 34 | (object) array( |
@@ -6,109 +6,109 @@ |
||
6 | 6 | final class WatercourseListController extends DefaultWaterfallListController |
7 | 7 | { |
8 | 8 | |
9 | - private static $DEFAULT_TITLE = 'Hiking with %s, Page %d of %d'; |
|
10 | - private static $DEFAULT_DESCRIPTION = 'Page %d of %d of legendary hiking stories with %s written by Jacob Emerick, all about his adventures hunting waterfalls in the Upper Peninsula of Michigan'; |
|
11 | - private static $DEFAULT_HEADER = 'Page %d of Legendary Hiking Stories with %s'; |
|
9 | + private static $DEFAULT_TITLE = 'Hiking with %s, Page %d of %d'; |
|
10 | + private static $DEFAULT_DESCRIPTION = 'Page %d of %d of legendary hiking stories with %s written by Jacob Emerick, all about his adventures hunting waterfalls in the Upper Peninsula of Michigan'; |
|
11 | + private static $DEFAULT_HEADER = 'Page %d of Legendary Hiking Stories with %s'; |
|
12 | 12 | |
13 | - private static $KEYWORD_ARRAY = array( |
|
14 | - 'hiking companions', |
|
15 | - 'journal', |
|
16 | - 'stories', |
|
17 | - 'blog', |
|
18 | - 'waterfalls'); |
|
13 | + private static $KEYWORD_ARRAY = array( |
|
14 | + 'hiking companions', |
|
15 | + 'journal', |
|
16 | + 'stories', |
|
17 | + 'blog', |
|
18 | + 'waterfalls'); |
|
19 | 19 | |
20 | - private static $NAVIGATION_DESCRIPTION = 'displaying %d ~ %d of %d waterfalls in %COUNTY%'; |
|
21 | - private static $LINK_ROOT = '/%s/'; |
|
20 | + private static $NAVIGATION_DESCRIPTION = 'displaying %d ~ %d of %d waterfalls in %COUNTY%'; |
|
21 | + private static $LINK_ROOT = '/%s/'; |
|
22 | 22 | |
23 | - protected static $ITEM_COUNT_PER_PAGE = 12; |
|
23 | + protected static $ITEM_COUNT_PER_PAGE = 12; |
|
24 | 24 | |
25 | - private $watercourse; |
|
25 | + private $watercourse; |
|
26 | 26 | |
27 | - public function __construct() |
|
28 | - { |
|
29 | - $path = URLDecode::getPiece(1); |
|
30 | - $this->watercourse = WatercourseCollector::getByAlias($path); |
|
27 | + public function __construct() |
|
28 | + { |
|
29 | + $path = URLDecode::getPiece(1); |
|
30 | + $this->watercourse = WatercourseCollector::getByAlias($path); |
|
31 | 31 | |
32 | - if(!$this->watercourse) |
|
33 | - $this->eject(); |
|
32 | + if(!$this->watercourse) |
|
33 | + $this->eject(); |
|
34 | 34 | |
35 | - parent::__construct(); |
|
36 | - } |
|
35 | + parent::__construct(); |
|
36 | + } |
|
37 | 37 | |
38 | - protected function get_initial_meta() |
|
39 | - { |
|
40 | - $meta_array = array(); |
|
38 | + protected function get_initial_meta() |
|
39 | + { |
|
40 | + $meta_array = array(); |
|
41 | 41 | |
42 | - $meta_array['title'] = "{$this->watercourse->name} | " . self::$WEBSITE_TITLE; |
|
43 | - $meta_array['description'] = $this->watercourse->description; |
|
44 | - $meta_array['keywords'] = $this->get_keyword_array(); |
|
42 | + $meta_array['title'] = "{$this->watercourse->name} | " . self::$WEBSITE_TITLE; |
|
43 | + $meta_array['description'] = $this->watercourse->description; |
|
44 | + $meta_array['keywords'] = $this->get_keyword_array(); |
|
45 | 45 | |
46 | - return $meta_array; |
|
47 | - } |
|
46 | + return $meta_array; |
|
47 | + } |
|
48 | 48 | |
49 | - protected function get_subsequent_meta() |
|
50 | - { |
|
51 | - $meta_array = array(); |
|
49 | + protected function get_subsequent_meta() |
|
50 | + { |
|
51 | + $meta_array = array(); |
|
52 | 52 | |
53 | - $meta_array['title'] = sprintf(self::$DEFAULT_TITLE . ' | ' . self::$WEBSITE_TITLE, $this->watercourse->name, $this->page, $this->page_count); |
|
54 | - $meta_array['description'] = sprintf(self::$DEFAULT_DESCRIPTION, $this->page, $this->page_count, $this->watercourse->name); |
|
55 | - $meta_array['keywords'] = $this->get_keyword_array(); |
|
53 | + $meta_array['title'] = sprintf(self::$DEFAULT_TITLE . ' | ' . self::$WEBSITE_TITLE, $this->watercourse->name, $this->page, $this->page_count); |
|
54 | + $meta_array['description'] = sprintf(self::$DEFAULT_DESCRIPTION, $this->page, $this->page_count, $this->watercourse->name); |
|
55 | + $meta_array['keywords'] = $this->get_keyword_array(); |
|
56 | 56 | |
57 | - return $meta_array; |
|
58 | - } |
|
59 | - |
|
60 | - private function get_keyword_array() |
|
61 | - { |
|
62 | - $keyword_array = self::$KEYWORD_ARRAY; |
|
63 | - array_unshift($keyword_array, strtolower($this->watercourse->name)); |
|
64 | - return $keyword_array; |
|
65 | - } |
|
66 | - |
|
67 | - protected function get_initial_introduction() |
|
68 | - { |
|
69 | - $introduction = array(); |
|
57 | + return $meta_array; |
|
58 | + } |
|
59 | + |
|
60 | + private function get_keyword_array() |
|
61 | + { |
|
62 | + $keyword_array = self::$KEYWORD_ARRAY; |
|
63 | + array_unshift($keyword_array, strtolower($this->watercourse->name)); |
|
64 | + return $keyword_array; |
|
65 | + } |
|
66 | + |
|
67 | + protected function get_initial_introduction() |
|
68 | + { |
|
69 | + $introduction = array(); |
|
70 | 70 | |
71 | - $introduction['title'] = $this->watercourse->header; |
|
72 | - $introduction['description'] = Content::instance('FixInternalLink', $this->watercourse->introduction)->activate(); |
|
73 | - $introduction['image'] = $this->get_image_element($this->watercourse->photo_category, $this->watercourse->photo, $this->watercourse->photo_description, 'medium'); |
|
71 | + $introduction['title'] = $this->watercourse->header; |
|
72 | + $introduction['description'] = Content::instance('FixInternalLink', $this->watercourse->introduction)->activate(); |
|
73 | + $introduction['image'] = $this->get_image_element($this->watercourse->photo_category, $this->watercourse->photo, $this->watercourse->photo_description, 'medium'); |
|
74 | 74 | |
75 | - return $introduction; |
|
76 | - } |
|
77 | - |
|
78 | - protected function get_subsequent_introduction() |
|
79 | - { |
|
80 | - return array( |
|
81 | - 'title' => sprintf(self::$DEFAULT_HEADER, $this->page, $this->watercourse->name)); |
|
82 | - } |
|
83 | - |
|
84 | - protected function get_item_count_per_page() |
|
85 | - { |
|
86 | - return self::$ITEM_COUNT_PER_PAGE; |
|
87 | - } |
|
88 | - |
|
89 | - protected function get_page_number_piece() |
|
90 | - { |
|
91 | - return URLDecode::getPiece(2); |
|
92 | - } |
|
93 | - |
|
94 | - protected function get_item_result($total, $offset) |
|
95 | - { |
|
96 | - return WatercourseCollector::getLogListForWatercourse($this->watercourse->id, $total, $offset); |
|
97 | - } |
|
98 | - |
|
99 | - protected function get_item_count_result() |
|
100 | - { |
|
101 | - return WatercourseCollector::getLogCountForWatercourse($this->watercourse->id); |
|
102 | - } |
|
103 | - |
|
104 | - protected function get_list_description_pattern() |
|
105 | - { |
|
106 | - return str_replace('%COUNTY%', $this->watercourse->name, self::$NAVIGATION_DESCRIPTION); |
|
107 | - } |
|
108 | - |
|
109 | - protected function get_list_link_root() |
|
110 | - { |
|
111 | - return sprintf(self::$LINK_ROOT, $this->watercourse->alias); |
|
112 | - } |
|
75 | + return $introduction; |
|
76 | + } |
|
77 | + |
|
78 | + protected function get_subsequent_introduction() |
|
79 | + { |
|
80 | + return array( |
|
81 | + 'title' => sprintf(self::$DEFAULT_HEADER, $this->page, $this->watercourse->name)); |
|
82 | + } |
|
83 | + |
|
84 | + protected function get_item_count_per_page() |
|
85 | + { |
|
86 | + return self::$ITEM_COUNT_PER_PAGE; |
|
87 | + } |
|
88 | + |
|
89 | + protected function get_page_number_piece() |
|
90 | + { |
|
91 | + return URLDecode::getPiece(2); |
|
92 | + } |
|
93 | + |
|
94 | + protected function get_item_result($total, $offset) |
|
95 | + { |
|
96 | + return WatercourseCollector::getLogListForWatercourse($this->watercourse->id, $total, $offset); |
|
97 | + } |
|
98 | + |
|
99 | + protected function get_item_count_result() |
|
100 | + { |
|
101 | + return WatercourseCollector::getLogCountForWatercourse($this->watercourse->id); |
|
102 | + } |
|
103 | + |
|
104 | + protected function get_list_description_pattern() |
|
105 | + { |
|
106 | + return str_replace('%COUNTY%', $this->watercourse->name, self::$NAVIGATION_DESCRIPTION); |
|
107 | + } |
|
108 | + |
|
109 | + protected function get_list_link_root() |
|
110 | + { |
|
111 | + return sprintf(self::$LINK_ROOT, $this->watercourse->alias); |
|
112 | + } |
|
113 | 113 | |
114 | 114 | } |
115 | 115 | \ No newline at end of file |
@@ -5,71 +5,71 @@ |
||
5 | 5 | final class ContactController extends DefaultPageController |
6 | 6 | { |
7 | 7 | |
8 | - private static $TITLE = 'Contact Jacob Emerick | Waterfalls of the Keweenaw'; |
|
9 | - private static $DESCRIPTION = 'Contact page to reach Jacob Emerick by email or social networks'; |
|
8 | + private static $TITLE = 'Contact Jacob Emerick | Waterfalls of the Keweenaw'; |
|
9 | + private static $DESCRIPTION = 'Contact page to reach Jacob Emerick by email or social networks'; |
|
10 | 10 | |
11 | - private static $KEYWORD_ARRAY = array( |
|
12 | - 'contact', |
|
13 | - 'email', |
|
14 | - 'waterfalls', |
|
15 | - 'Jacob Emerick'); |
|
11 | + private static $KEYWORD_ARRAY = array( |
|
12 | + 'contact', |
|
13 | + 'email', |
|
14 | + 'waterfalls', |
|
15 | + 'Jacob Emerick'); |
|
16 | 16 | |
17 | - protected function set_head_data() |
|
18 | - { |
|
19 | - $this->set_title(self::$TITLE); |
|
20 | - $this->set_description(self::$DESCRIPTION); |
|
21 | - $this->set_keywords(self::$KEYWORD_ARRAY); |
|
17 | + protected function set_head_data() |
|
18 | + { |
|
19 | + $this->set_title(self::$TITLE); |
|
20 | + $this->set_description(self::$DESCRIPTION); |
|
21 | + $this->set_keywords(self::$KEYWORD_ARRAY); |
|
22 | 22 | |
23 | - parent::set_head_data(); |
|
24 | - } |
|
23 | + parent::set_head_data(); |
|
24 | + } |
|
25 | 25 | |
26 | - protected function set_body_data() |
|
27 | - { |
|
28 | - $this->set_body('form_container', $this->process_form()); |
|
29 | - $this->set_body('view', 'Contact'); |
|
26 | + protected function set_body_data() |
|
27 | + { |
|
28 | + $this->set_body('form_container', $this->process_form()); |
|
29 | + $this->set_body('view', 'Contact'); |
|
30 | 30 | |
31 | - parent::set_body_data(); |
|
32 | - } |
|
31 | + parent::set_body_data(); |
|
32 | + } |
|
33 | 33 | |
34 | - private function process_form() |
|
35 | - { |
|
36 | - if(!Request::hasPost() || Request::getPost('submit') != 'Send Message!') |
|
37 | - return (object) array('display' => 'normal'); |
|
34 | + private function process_form() |
|
35 | + { |
|
36 | + if(!Request::hasPost() || Request::getPost('submit') != 'Send Message!') |
|
37 | + return (object) array('display' => 'normal'); |
|
38 | 38 | |
39 | - Loader::load('utility', 'Validate'); |
|
40 | - $error_result = array(); |
|
41 | - if(!Validate::checkRequest('post', 'name', 'string')) |
|
42 | - $error_result['name'] = 'please enter your name'; |
|
43 | - if(!Validate::checkRequest('post', 'email', 'string')) |
|
44 | - $error_result['email'] = 'please enter a valid email'; |
|
45 | - if(!Validate::checkRequest('post', 'message', 'string')) |
|
46 | - $error_result['message'] = 'please write a message'; |
|
39 | + Loader::load('utility', 'Validate'); |
|
40 | + $error_result = array(); |
|
41 | + if(!Validate::checkRequest('post', 'name', 'string')) |
|
42 | + $error_result['name'] = 'please enter your name'; |
|
43 | + if(!Validate::checkRequest('post', 'email', 'string')) |
|
44 | + $error_result['email'] = 'please enter a valid email'; |
|
45 | + if(!Validate::checkRequest('post', 'message', 'string')) |
|
46 | + $error_result['message'] = 'please write a message'; |
|
47 | 47 | |
48 | - $values = (object) array( |
|
49 | - 'name' => Request::getPost('name'), |
|
50 | - 'email' => Request::getPost('email'), |
|
51 | - 'message' => Request::getPost('message')); |
|
48 | + $values = (object) array( |
|
49 | + 'name' => Request::getPost('name'), |
|
50 | + 'email' => Request::getPost('email'), |
|
51 | + 'message' => Request::getPost('message')); |
|
52 | 52 | |
53 | - if(count($error_result) > 0) |
|
54 | - { |
|
55 | - return (object) array( |
|
56 | - 'display' => 'error', |
|
57 | - 'messages' => $error_result, |
|
58 | - 'values' => $values); |
|
59 | - } |
|
53 | + if(count($error_result) > 0) |
|
54 | + { |
|
55 | + return (object) array( |
|
56 | + 'display' => 'error', |
|
57 | + 'messages' => $error_result, |
|
58 | + 'values' => $values); |
|
59 | + } |
|
60 | 60 | |
61 | 61 | global $container; |
62 | 62 | $sent = $container['mail'] |
63 | - ->addTo($container['config']->admin_email) |
|
64 | - ->setSubject('Waterfall Site Contact') |
|
65 | - ->setPlainMessage( |
|
63 | + ->addTo($container['config']->admin_email) |
|
64 | + ->setSubject('Waterfall Site Contact') |
|
65 | + ->setPlainMessage( |
|
66 | 66 | "Name: {$values->name}\n" . |
67 | 67 | "Email: {$values->email}\n" . |
68 | 68 | "Message: {$values->message}" |
69 | - ) |
|
70 | - ->send(); |
|
69 | + ) |
|
70 | + ->send(); |
|
71 | 71 | |
72 | - return (object) array('display' => 'success'); |
|
73 | - } |
|
72 | + return (object) array('display' => 'success'); |
|
73 | + } |
|
74 | 74 | |
75 | 75 | } |
@@ -5,62 +5,62 @@ |
||
5 | 5 | final class SearchListController extends DefaultListController |
6 | 6 | { |
7 | 7 | |
8 | - private static $TITLE = 'Search Listing'; |
|
9 | - private static $DESCRIPTION = ''; |
|
8 | + private static $TITLE = 'Search Listing'; |
|
9 | + private static $DESCRIPTION = ''; |
|
10 | 10 | |
11 | - private static $KEYWORD_ARRAY = array(); |
|
11 | + private static $KEYWORD_ARRAY = array(); |
|
12 | 12 | |
13 | - protected function set_head_data() |
|
14 | - { |
|
15 | - parent::set_head_data(); |
|
13 | + protected function set_head_data() |
|
14 | + { |
|
15 | + parent::set_head_data(); |
|
16 | 16 | |
17 | - $this->set_title(self::$TITLE); |
|
18 | - $this->set_description(self::$DESCRIPTION); |
|
19 | - $this->set_keywords(self::$KEYWORD_ARRAY); |
|
20 | - } |
|
17 | + $this->set_title(self::$TITLE); |
|
18 | + $this->set_description(self::$DESCRIPTION); |
|
19 | + $this->set_keywords(self::$KEYWORD_ARRAY); |
|
20 | + } |
|
21 | 21 | |
22 | - protected function get_introduction() |
|
23 | - { |
|
24 | - return; |
|
25 | - } |
|
22 | + protected function get_introduction() |
|
23 | + { |
|
24 | + return; |
|
25 | + } |
|
26 | 26 | |
27 | - protected function get_page_number() |
|
28 | - { |
|
29 | - $page = URLDecode::getPiece(2); |
|
30 | - if(isset($page) && is_numeric($page)) |
|
31 | - return $page; |
|
32 | - return 1; |
|
33 | - } |
|
27 | + protected function get_page_number() |
|
28 | + { |
|
29 | + $page = URLDecode::getPiece(2); |
|
30 | + if(isset($page) && is_numeric($page)) |
|
31 | + return $page; |
|
32 | + return 1; |
|
33 | + } |
|
34 | 34 | |
35 | - protected function get_items() |
|
36 | - { |
|
37 | - return array(); |
|
38 | - } |
|
35 | + protected function get_items() |
|
36 | + { |
|
37 | + return array(); |
|
38 | + } |
|
39 | 39 | |
40 | - protected function get_list_description() |
|
41 | - { |
|
42 | - return 'yay cloud'; |
|
43 | - } |
|
40 | + protected function get_list_description() |
|
41 | + { |
|
42 | + return 'yay cloud'; |
|
43 | + } |
|
44 | 44 | |
45 | - protected function get_list_next_link() |
|
46 | - { |
|
47 | - return '/'; |
|
48 | - } |
|
45 | + protected function get_list_next_link() |
|
46 | + { |
|
47 | + return '/'; |
|
48 | + } |
|
49 | 49 | |
50 | - protected function get_list_prev_link() |
|
51 | - { |
|
52 | - return '/'; |
|
53 | - } |
|
50 | + protected function get_list_prev_link() |
|
51 | + { |
|
52 | + return '/'; |
|
53 | + } |
|
54 | 54 | |
55 | - private $total_post_count; |
|
56 | - protected function get_item_count() |
|
57 | - { |
|
58 | - return 20; |
|
59 | - } |
|
55 | + private $total_post_count; |
|
56 | + protected function get_item_count() |
|
57 | + { |
|
58 | + return 20; |
|
59 | + } |
|
60 | 60 | |
61 | - protected function get_item_count_per_page() |
|
62 | - { |
|
63 | - return 20; |
|
64 | - } |
|
61 | + protected function get_item_count_per_page() |
|
62 | + { |
|
63 | + return 20; |
|
64 | + } |
|
65 | 65 | |
66 | 66 | } |
67 | 67 | \ No newline at end of file |
@@ -6,108 +6,108 @@ |
||
6 | 6 | final class CountyListController extends DefaultWaterfallListController |
7 | 7 | { |
8 | 8 | |
9 | - private static $DEFAULT_TITLE = '%s Waterfalls, Page %d of %d'; |
|
10 | - private static $DEFAULT_DESCRIPTION = 'Page %d of %d of awesome waterfalls in %s, located in the northwestern wilds of Micigan\'s Upper Peninsula.'; |
|
11 | - private static $DEFAULT_HEADER = 'Page %d of Awesome %s Waterfalls'; |
|
9 | + private static $DEFAULT_TITLE = '%s Waterfalls, Page %d of %d'; |
|
10 | + private static $DEFAULT_DESCRIPTION = 'Page %d of %d of awesome waterfalls in %s, located in the northwestern wilds of Micigan\'s Upper Peninsula.'; |
|
11 | + private static $DEFAULT_HEADER = 'Page %d of Awesome %s Waterfalls'; |
|
12 | 12 | |
13 | - private static $KEYWORD_ARRAY = array( |
|
14 | - 'upper peninsula', |
|
15 | - 'michigan', |
|
16 | - 'keweenaw', |
|
17 | - 'waterfalls'); |
|
13 | + private static $KEYWORD_ARRAY = array( |
|
14 | + 'upper peninsula', |
|
15 | + 'michigan', |
|
16 | + 'keweenaw', |
|
17 | + 'waterfalls'); |
|
18 | 18 | |
19 | - private static $NAVIGATION_DESCRIPTION = 'displaying %d ~ %d of %d waterfalls in %COUNTY%'; |
|
20 | - private static $LINK_ROOT = '/%s/'; |
|
19 | + private static $NAVIGATION_DESCRIPTION = 'displaying %d ~ %d of %d waterfalls in %COUNTY%'; |
|
20 | + private static $LINK_ROOT = '/%s/'; |
|
21 | 21 | |
22 | - protected static $ITEM_COUNT_PER_PAGE = 12; |
|
22 | + protected static $ITEM_COUNT_PER_PAGE = 12; |
|
23 | 23 | |
24 | - private $county; |
|
24 | + private $county; |
|
25 | 25 | |
26 | - public function __construct() |
|
27 | - { |
|
28 | - $path = URLDecode::getPiece(1); |
|
29 | - $this->county = CountyCollector::getByAlias($path); |
|
26 | + public function __construct() |
|
27 | + { |
|
28 | + $path = URLDecode::getPiece(1); |
|
29 | + $this->county = CountyCollector::getByAlias($path); |
|
30 | 30 | |
31 | - if(!$this->county) |
|
32 | - $this->eject(); |
|
31 | + if(!$this->county) |
|
32 | + $this->eject(); |
|
33 | 33 | |
34 | - parent::__construct(); |
|
35 | - } |
|
34 | + parent::__construct(); |
|
35 | + } |
|
36 | 36 | |
37 | - protected function get_initial_meta() |
|
38 | - { |
|
39 | - $meta_array = array(); |
|
37 | + protected function get_initial_meta() |
|
38 | + { |
|
39 | + $meta_array = array(); |
|
40 | 40 | |
41 | - $meta_array['title'] = "{$this->county->name} Waterfalls | " . self::$WEBSITE_TITLE; |
|
42 | - $meta_array['description'] = $this->county->description; |
|
43 | - $meta_array['keywords'] = $this->get_keyword_array(); |
|
41 | + $meta_array['title'] = "{$this->county->name} Waterfalls | " . self::$WEBSITE_TITLE; |
|
42 | + $meta_array['description'] = $this->county->description; |
|
43 | + $meta_array['keywords'] = $this->get_keyword_array(); |
|
44 | 44 | |
45 | - return $meta_array; |
|
46 | - } |
|
45 | + return $meta_array; |
|
46 | + } |
|
47 | 47 | |
48 | - protected function get_subsequent_meta() |
|
49 | - { |
|
50 | - $meta_array = array(); |
|
48 | + protected function get_subsequent_meta() |
|
49 | + { |
|
50 | + $meta_array = array(); |
|
51 | 51 | |
52 | - $meta_array['title'] = sprintf(self::$DEFAULT_TITLE . ' | ' . self::$WEBSITE_TITLE, $this->county->name, $this->page, $this->page_count); |
|
53 | - $meta_array['description'] = sprintf(self::$DEFAULT_DESCRIPTION, $this->page, $this->page_count, $this->county->name); |
|
54 | - $meta_array['keywords'] = $this->get_keyword_array(); |
|
52 | + $meta_array['title'] = sprintf(self::$DEFAULT_TITLE . ' | ' . self::$WEBSITE_TITLE, $this->county->name, $this->page, $this->page_count); |
|
53 | + $meta_array['description'] = sprintf(self::$DEFAULT_DESCRIPTION, $this->page, $this->page_count, $this->county->name); |
|
54 | + $meta_array['keywords'] = $this->get_keyword_array(); |
|
55 | 55 | |
56 | - return $meta_array; |
|
57 | - } |
|
58 | - |
|
59 | - private function get_keyword_array() |
|
60 | - { |
|
61 | - $keyword_array = self::$KEYWORD_ARRAY; |
|
62 | - array_unshift($keyword_array, strtolower($this->county->name)); |
|
63 | - return $keyword_array; |
|
64 | - } |
|
65 | - |
|
66 | - protected function get_initial_introduction() |
|
67 | - { |
|
68 | - $introduction = array(); |
|
56 | + return $meta_array; |
|
57 | + } |
|
58 | + |
|
59 | + private function get_keyword_array() |
|
60 | + { |
|
61 | + $keyword_array = self::$KEYWORD_ARRAY; |
|
62 | + array_unshift($keyword_array, strtolower($this->county->name)); |
|
63 | + return $keyword_array; |
|
64 | + } |
|
65 | + |
|
66 | + protected function get_initial_introduction() |
|
67 | + { |
|
68 | + $introduction = array(); |
|
69 | 69 | |
70 | - $introduction['title'] = $this->county->title; |
|
71 | - $introduction['description'] = Content::instance('FixInternalLink', $this->county->introduction)->activate(); |
|
72 | - $introduction['image'] = $this->get_image_element($this->county->photo_category, $this->county->photo, $this->county->photo_description, 'medium'); |
|
70 | + $introduction['title'] = $this->county->title; |
|
71 | + $introduction['description'] = Content::instance('FixInternalLink', $this->county->introduction)->activate(); |
|
72 | + $introduction['image'] = $this->get_image_element($this->county->photo_category, $this->county->photo, $this->county->photo_description, 'medium'); |
|
73 | 73 | |
74 | - return $introduction; |
|
75 | - } |
|
76 | - |
|
77 | - protected function get_subsequent_introduction() |
|
78 | - { |
|
79 | - return array( |
|
80 | - 'title' => sprintf(self::$DEFAULT_HEADER, $this->page, $this->county->name)); |
|
81 | - } |
|
82 | - |
|
83 | - protected function get_item_count_per_page() |
|
84 | - { |
|
85 | - return self::$ITEM_COUNT_PER_PAGE; |
|
86 | - } |
|
87 | - |
|
88 | - protected function get_page_number_piece() |
|
89 | - { |
|
90 | - return URLDecode::getPiece(2); |
|
91 | - } |
|
92 | - |
|
93 | - protected function get_item_result($total, $offset) |
|
94 | - { |
|
95 | - return CountyCollector::getLogListForCounty($this->county->id, $total, $offset); |
|
96 | - } |
|
97 | - |
|
98 | - protected function get_item_count_result() |
|
99 | - { |
|
100 | - return CountyCollector::getLogCountForCounty($this->county->id); |
|
101 | - } |
|
102 | - |
|
103 | - protected function get_list_description_pattern() |
|
104 | - { |
|
105 | - return str_replace('%COUNTY%', $this->county->name, self::$NAVIGATION_DESCRIPTION); |
|
106 | - } |
|
107 | - |
|
108 | - protected function get_list_link_root() |
|
109 | - { |
|
110 | - return sprintf(self::$LINK_ROOT, $this->county->alias); |
|
111 | - } |
|
74 | + return $introduction; |
|
75 | + } |
|
76 | + |
|
77 | + protected function get_subsequent_introduction() |
|
78 | + { |
|
79 | + return array( |
|
80 | + 'title' => sprintf(self::$DEFAULT_HEADER, $this->page, $this->county->name)); |
|
81 | + } |
|
82 | + |
|
83 | + protected function get_item_count_per_page() |
|
84 | + { |
|
85 | + return self::$ITEM_COUNT_PER_PAGE; |
|
86 | + } |
|
87 | + |
|
88 | + protected function get_page_number_piece() |
|
89 | + { |
|
90 | + return URLDecode::getPiece(2); |
|
91 | + } |
|
92 | + |
|
93 | + protected function get_item_result($total, $offset) |
|
94 | + { |
|
95 | + return CountyCollector::getLogListForCounty($this->county->id, $total, $offset); |
|
96 | + } |
|
97 | + |
|
98 | + protected function get_item_count_result() |
|
99 | + { |
|
100 | + return CountyCollector::getLogCountForCounty($this->county->id); |
|
101 | + } |
|
102 | + |
|
103 | + protected function get_list_description_pattern() |
|
104 | + { |
|
105 | + return str_replace('%COUNTY%', $this->county->name, self::$NAVIGATION_DESCRIPTION); |
|
106 | + } |
|
107 | + |
|
108 | + protected function get_list_link_root() |
|
109 | + { |
|
110 | + return sprintf(self::$LINK_ROOT, $this->county->alias); |
|
111 | + } |
|
112 | 112 | |
113 | 113 | } |
114 | 114 | \ No newline at end of file |
@@ -6,96 +6,96 @@ |
||
6 | 6 | final class LogTagListController extends DefaultLogListController |
7 | 7 | { |
8 | 8 | |
9 | - private static $DEFAULT_TITLE = 'Hiking with %s, Page %d of %d'; |
|
10 | - private static $DEFAULT_DESCRIPTION = 'Page %d of %d of legendary hiking stories with %s written by Jacob Emerick, all about his adventures hunting waterfalls in the Upper Peninsula of Michigan'; |
|
11 | - private static $DEFAULT_HEADER = 'Page %d of Legendary Hiking Stories with %s'; |
|
12 | - |
|
13 | - private static $KEYWORD_ARRAY = array( |
|
14 | - 'hiking companions', |
|
15 | - 'journal', |
|
16 | - 'stories', |
|
17 | - 'blog', |
|
18 | - 'waterfalls'); |
|
19 | - |
|
20 | - private static $NAVIGATION_DESCRIPTION = 'displaying %d ~ %d of journal entries with %TAG%'; |
|
21 | - private static $LINK_ROOT = '/journal/tag/%s/'; |
|
22 | - |
|
23 | - private $tag; |
|
24 | - |
|
25 | - public function __construct() |
|
26 | - { |
|
27 | - $alias = URLDecode::getPiece(3); |
|
28 | - $this->tag = LogTagCollector::getTag($alias); |
|
9 | + private static $DEFAULT_TITLE = 'Hiking with %s, Page %d of %d'; |
|
10 | + private static $DEFAULT_DESCRIPTION = 'Page %d of %d of legendary hiking stories with %s written by Jacob Emerick, all about his adventures hunting waterfalls in the Upper Peninsula of Michigan'; |
|
11 | + private static $DEFAULT_HEADER = 'Page %d of Legendary Hiking Stories with %s'; |
|
12 | + |
|
13 | + private static $KEYWORD_ARRAY = array( |
|
14 | + 'hiking companions', |
|
15 | + 'journal', |
|
16 | + 'stories', |
|
17 | + 'blog', |
|
18 | + 'waterfalls'); |
|
19 | + |
|
20 | + private static $NAVIGATION_DESCRIPTION = 'displaying %d ~ %d of journal entries with %TAG%'; |
|
21 | + private static $LINK_ROOT = '/journal/tag/%s/'; |
|
22 | + |
|
23 | + private $tag; |
|
24 | + |
|
25 | + public function __construct() |
|
26 | + { |
|
27 | + $alias = URLDecode::getPiece(3); |
|
28 | + $this->tag = LogTagCollector::getTag($alias); |
|
29 | 29 | |
30 | - if(!$this->tag) |
|
31 | - $this->eject(); |
|
30 | + if(!$this->tag) |
|
31 | + $this->eject(); |
|
32 | 32 | |
33 | - parent::__construct(); |
|
34 | - } |
|
33 | + parent::__construct(); |
|
34 | + } |
|
35 | 35 | |
36 | - protected function get_initial_meta() |
|
37 | - { |
|
38 | - $meta_array = array(); |
|
36 | + protected function get_initial_meta() |
|
37 | + { |
|
38 | + $meta_array = array(); |
|
39 | 39 | |
40 | - $meta_array['title'] = "{$this->tag->name} | " . self::$WEBSITE_TITLE; |
|
41 | - $meta_array['description'] = $this->tag->name; |
|
42 | - $meta_array['keywords'] = $this->get_keyword_array(); |
|
40 | + $meta_array['title'] = "{$this->tag->name} | " . self::$WEBSITE_TITLE; |
|
41 | + $meta_array['description'] = $this->tag->name; |
|
42 | + $meta_array['keywords'] = $this->get_keyword_array(); |
|
43 | 43 | |
44 | - return $meta_array; |
|
45 | - } |
|
44 | + return $meta_array; |
|
45 | + } |
|
46 | 46 | |
47 | - protected function get_subsequent_meta() |
|
48 | - { |
|
49 | - $meta_array = array(); |
|
47 | + protected function get_subsequent_meta() |
|
48 | + { |
|
49 | + $meta_array = array(); |
|
50 | 50 | |
51 | - $meta_array['title'] = sprintf(self::$DEFAULT_TITLE . ' | ' . self::$WEBSITE_TITLE, $this->companion->name, $this->page, $this->page_count); |
|
52 | - $meta_array['description'] = sprintf(self::$DEFAULT_DESCRIPTION, $this->page, $this->page_count, $this->tag->name); |
|
53 | - $meta_array['keywords'] = $this->get_keyword_array(); |
|
51 | + $meta_array['title'] = sprintf(self::$DEFAULT_TITLE . ' | ' . self::$WEBSITE_TITLE, $this->companion->name, $this->page, $this->page_count); |
|
52 | + $meta_array['description'] = sprintf(self::$DEFAULT_DESCRIPTION, $this->page, $this->page_count, $this->tag->name); |
|
53 | + $meta_array['keywords'] = $this->get_keyword_array(); |
|
54 | 54 | |
55 | - return $meta_array; |
|
56 | - } |
|
57 | - |
|
58 | - private function get_keyword_array() |
|
59 | - { |
|
60 | - $keyword_array = self::$KEYWORD_ARRAY; |
|
61 | - array_unshift($keyword_array, strtolower($this->tag->name)); |
|
62 | - return $keyword_array; |
|
63 | - } |
|
64 | - |
|
65 | - protected function get_initial_introduction() |
|
66 | - { |
|
67 | - return array( |
|
68 | - 'title' => sprintf(self::$DEFAULT_HEADER, $this->page, $this->tag->name)); |
|
69 | - } |
|
70 | - |
|
71 | - protected function get_subsequent_introduction() |
|
72 | - { |
|
73 | - return $this->get_initial_introduction(); |
|
74 | - } |
|
75 | - |
|
76 | - protected function get_page_number_piece() |
|
77 | - { |
|
78 | - return URLDecode::getPiece(3); |
|
79 | - } |
|
80 | - |
|
81 | - protected function get_item_result($total, $offset) |
|
82 | - { |
|
83 | - return LogTagCollector::getLogListForTag($this->tag->id, $total, $offset); |
|
84 | - } |
|
85 | - |
|
86 | - protected function get_item_count_result() |
|
87 | - { |
|
88 | - return LogTagCollector::getLogCountForTag($this->tag->id); |
|
89 | - } |
|
90 | - |
|
91 | - protected function get_list_description_pattern() |
|
92 | - { |
|
93 | - return str_replace('%TAG%', $this->tag->name, self::$NAVIGATION_DESCRIPTION); |
|
94 | - } |
|
95 | - |
|
96 | - protected function get_list_link_root() |
|
97 | - { |
|
98 | - return sprintf(self::$LINK_ROOT, $this->tag->alias); |
|
99 | - } |
|
55 | + return $meta_array; |
|
56 | + } |
|
57 | + |
|
58 | + private function get_keyword_array() |
|
59 | + { |
|
60 | + $keyword_array = self::$KEYWORD_ARRAY; |
|
61 | + array_unshift($keyword_array, strtolower($this->tag->name)); |
|
62 | + return $keyword_array; |
|
63 | + } |
|
64 | + |
|
65 | + protected function get_initial_introduction() |
|
66 | + { |
|
67 | + return array( |
|
68 | + 'title' => sprintf(self::$DEFAULT_HEADER, $this->page, $this->tag->name)); |
|
69 | + } |
|
70 | + |
|
71 | + protected function get_subsequent_introduction() |
|
72 | + { |
|
73 | + return $this->get_initial_introduction(); |
|
74 | + } |
|
75 | + |
|
76 | + protected function get_page_number_piece() |
|
77 | + { |
|
78 | + return URLDecode::getPiece(3); |
|
79 | + } |
|
80 | + |
|
81 | + protected function get_item_result($total, $offset) |
|
82 | + { |
|
83 | + return LogTagCollector::getLogListForTag($this->tag->id, $total, $offset); |
|
84 | + } |
|
85 | + |
|
86 | + protected function get_item_count_result() |
|
87 | + { |
|
88 | + return LogTagCollector::getLogCountForTag($this->tag->id); |
|
89 | + } |
|
90 | + |
|
91 | + protected function get_list_description_pattern() |
|
92 | + { |
|
93 | + return str_replace('%TAG%', $this->tag->name, self::$NAVIGATION_DESCRIPTION); |
|
94 | + } |
|
95 | + |
|
96 | + protected function get_list_link_root() |
|
97 | + { |
|
98 | + return sprintf(self::$LINK_ROOT, $this->tag->alias); |
|
99 | + } |
|
100 | 100 | |
101 | 101 | } |
102 | 102 | \ No newline at end of file |
@@ -1,97 +1,97 @@ |
||
1 | 1 | <? |
2 | 2 | |
3 | 3 | Loader::load('collector', array( |
4 | - 'image/PhotoCollector', |
|
5 | - 'waterfall/WaterfallCollector')); |
|
4 | + 'image/PhotoCollector', |
|
5 | + 'waterfall/WaterfallCollector')); |
|
6 | 6 | Loader::load('controller', 'waterfalls/DefaultWaterfallListController'); |
7 | 7 | |
8 | 8 | final class WaterfallListController extends DefaultWaterfallListController |
9 | 9 | { |
10 | 10 | |
11 | - private static $PRIMARY_TITLE = 'Full Listing of Falls'; |
|
12 | - private static $PRIMARY_DESCRIPTION = 'List of waterfalls found in the general Keweenaw Area, complete with photos, descriptions, directions, and maps.'; |
|
13 | - private static $PRIMARY_INTRODUCTION_HEADER = 'A Giant List of Waterfalls'; |
|
14 | - private static $PRIMARY_INTRODUCTION_IMAGE = 2212; |
|
15 | - private static $PRIMARY_INTRODUCTION_DESCRIPTION = "Jacob has been to a lot of waterfalls. From the sandstone drops of Ontonagon to the volcanic plunges of the Huron Mountains to Keweenaw Ridge's craggy slides, he's gotten around. Some of the falls end up being surprising finds, numerous drops that are not documented anywhere else, while others end up being huge disappointments that barely warrant the long searches and planning stages."; |
|
16 | - |
|
17 | - private static $SECONDARY_TITLE = 'Falls Listing, Page %d of %d'; |
|
18 | - private static $SECONDARY_DESCRIPTION = 'Page %d of %d of waterfalls found in the general Keweenaw area.'; |
|
19 | - private static $SECONDARY_INTRODUCTION_HEADER = 'Page %d of %d of the full waterfall listing'; |
|
20 | - |
|
21 | - private static $KEYWORD_ARRAY = array( |
|
22 | - 'journal', |
|
23 | - 'stories', |
|
24 | - 'blog', |
|
25 | - 'waterfalls', |
|
26 | - 'hiking companions'); |
|
27 | - |
|
28 | - private static $NAVIGATION_DESCRIPTION = 'displaying %d ~ %d of %d total waterfalls'; |
|
29 | - private static $LINK_ROOT = '/falls/'; |
|
30 | - |
|
31 | - protected function get_initial_meta() |
|
32 | - { |
|
33 | - $meta_array = array(); |
|
11 | + private static $PRIMARY_TITLE = 'Full Listing of Falls'; |
|
12 | + private static $PRIMARY_DESCRIPTION = 'List of waterfalls found in the general Keweenaw Area, complete with photos, descriptions, directions, and maps.'; |
|
13 | + private static $PRIMARY_INTRODUCTION_HEADER = 'A Giant List of Waterfalls'; |
|
14 | + private static $PRIMARY_INTRODUCTION_IMAGE = 2212; |
|
15 | + private static $PRIMARY_INTRODUCTION_DESCRIPTION = "Jacob has been to a lot of waterfalls. From the sandstone drops of Ontonagon to the volcanic plunges of the Huron Mountains to Keweenaw Ridge's craggy slides, he's gotten around. Some of the falls end up being surprising finds, numerous drops that are not documented anywhere else, while others end up being huge disappointments that barely warrant the long searches and planning stages."; |
|
16 | + |
|
17 | + private static $SECONDARY_TITLE = 'Falls Listing, Page %d of %d'; |
|
18 | + private static $SECONDARY_DESCRIPTION = 'Page %d of %d of waterfalls found in the general Keweenaw area.'; |
|
19 | + private static $SECONDARY_INTRODUCTION_HEADER = 'Page %d of %d of the full waterfall listing'; |
|
20 | + |
|
21 | + private static $KEYWORD_ARRAY = array( |
|
22 | + 'journal', |
|
23 | + 'stories', |
|
24 | + 'blog', |
|
25 | + 'waterfalls', |
|
26 | + 'hiking companions'); |
|
27 | + |
|
28 | + private static $NAVIGATION_DESCRIPTION = 'displaying %d ~ %d of %d total waterfalls'; |
|
29 | + private static $LINK_ROOT = '/falls/'; |
|
30 | + |
|
31 | + protected function get_initial_meta() |
|
32 | + { |
|
33 | + $meta_array = array(); |
|
34 | 34 | |
35 | - $meta_array['title'] = self::$PRIMARY_TITLE . ' | ' . self::$WEBSITE_TITLE; |
|
36 | - $meta_array['description'] = self::$PRIMARY_DESCRIPTION; |
|
37 | - $meta_array['keywords'] = self::$KEYWORD_ARRAY; |
|
35 | + $meta_array['title'] = self::$PRIMARY_TITLE . ' | ' . self::$WEBSITE_TITLE; |
|
36 | + $meta_array['description'] = self::$PRIMARY_DESCRIPTION; |
|
37 | + $meta_array['keywords'] = self::$KEYWORD_ARRAY; |
|
38 | 38 | |
39 | - return $meta_array; |
|
40 | - } |
|
39 | + return $meta_array; |
|
40 | + } |
|
41 | 41 | |
42 | - protected function get_subsequent_meta() |
|
43 | - { |
|
44 | - $meta_array = array(); |
|
42 | + protected function get_subsequent_meta() |
|
43 | + { |
|
44 | + $meta_array = array(); |
|
45 | 45 | |
46 | - $meta_array['title'] = sprintf(self::$SECONDARY_TITLE . ' | ' . self::$WEBSITE_TITLE, $this->page, $this->page_count); |
|
47 | - $meta_array['description'] = sprintf(self::$SECONDARY_DESCRIPTION, $this->page, $this->page_count); |
|
48 | - $meta_array['keywords'] = self::$KEYWORD_ARRAY; |
|
46 | + $meta_array['title'] = sprintf(self::$SECONDARY_TITLE . ' | ' . self::$WEBSITE_TITLE, $this->page, $this->page_count); |
|
47 | + $meta_array['description'] = sprintf(self::$SECONDARY_DESCRIPTION, $this->page, $this->page_count); |
|
48 | + $meta_array['keywords'] = self::$KEYWORD_ARRAY; |
|
49 | 49 | |
50 | - return $meta_array; |
|
51 | - } |
|
50 | + return $meta_array; |
|
51 | + } |
|
52 | 52 | |
53 | - protected function get_initial_introduction() |
|
54 | - { |
|
55 | - $introduction = array(); |
|
53 | + protected function get_initial_introduction() |
|
54 | + { |
|
55 | + $introduction = array(); |
|
56 | 56 | |
57 | - $introduction['title'] = self::$PRIMARY_INTRODUCTION_HEADER; |
|
58 | - $introduction['description'] = self::$PRIMARY_INTRODUCTION_DESCRIPTION; |
|
57 | + $introduction['title'] = self::$PRIMARY_INTRODUCTION_HEADER; |
|
58 | + $introduction['description'] = self::$PRIMARY_INTRODUCTION_DESCRIPTION; |
|
59 | 59 | |
60 | - $image = PhotoCollector::getRow(self::$PRIMARY_INTRODUCTION_IMAGE); |
|
61 | - $introduction['image'] = $this->get_image_element($image->category, $image->name, $image->description, 'medium'); |
|
60 | + $image = PhotoCollector::getRow(self::$PRIMARY_INTRODUCTION_IMAGE); |
|
61 | + $introduction['image'] = $this->get_image_element($image->category, $image->name, $image->description, 'medium'); |
|
62 | 62 | |
63 | - return $introduction; |
|
64 | - } |
|
65 | - |
|
66 | - protected function get_subsequent_introduction() |
|
67 | - { |
|
68 | - return array( |
|
69 | - 'title' => sprintf(self::$SECONDARY_INTRODUCTION_HEADER, $this->page, $this->page_count)); |
|
70 | - } |
|
71 | - |
|
72 | - protected function get_page_number_piece() |
|
73 | - { |
|
74 | - return URLDecode::getPiece(2); |
|
75 | - } |
|
76 | - |
|
77 | - protected function get_item_result($total, $offset) |
|
78 | - { |
|
79 | - return WaterfallCollector::getList($total, $offset); |
|
80 | - } |
|
81 | - |
|
82 | - protected function get_item_count_result() |
|
83 | - { |
|
84 | - return WaterfallCollector::getListCount(); |
|
85 | - } |
|
86 | - |
|
87 | - protected function get_list_description_pattern() |
|
88 | - { |
|
89 | - return self::$NAVIGATION_DESCRIPTION; |
|
90 | - } |
|
91 | - |
|
92 | - protected function get_list_link_root() |
|
93 | - { |
|
94 | - return self::$LINK_ROOT; |
|
95 | - } |
|
63 | + return $introduction; |
|
64 | + } |
|
65 | + |
|
66 | + protected function get_subsequent_introduction() |
|
67 | + { |
|
68 | + return array( |
|
69 | + 'title' => sprintf(self::$SECONDARY_INTRODUCTION_HEADER, $this->page, $this->page_count)); |
|
70 | + } |
|
71 | + |
|
72 | + protected function get_page_number_piece() |
|
73 | + { |
|
74 | + return URLDecode::getPiece(2); |
|
75 | + } |
|
76 | + |
|
77 | + protected function get_item_result($total, $offset) |
|
78 | + { |
|
79 | + return WaterfallCollector::getList($total, $offset); |
|
80 | + } |
|
81 | + |
|
82 | + protected function get_item_count_result() |
|
83 | + { |
|
84 | + return WaterfallCollector::getListCount(); |
|
85 | + } |
|
86 | + |
|
87 | + protected function get_list_description_pattern() |
|
88 | + { |
|
89 | + return self::$NAVIGATION_DESCRIPTION; |
|
90 | + } |
|
91 | + |
|
92 | + protected function get_list_link_root() |
|
93 | + { |
|
94 | + return self::$LINK_ROOT; |
|
95 | + } |
|
96 | 96 | |
97 | 97 | } |
@@ -5,144 +5,144 @@ |
||
5 | 5 | final class TagController extends DefaultListController |
6 | 6 | { |
7 | 7 | |
8 | - private static $TITLE = "%s Activity | Jacob Emerick's Lifestream"; |
|
9 | - private static $DESCRIPTION = "%s activity on Jacob Emerick's lifestream, all nice and paginated in one awesome website."; |
|
8 | + private static $TITLE = "%s Activity | Jacob Emerick's Lifestream"; |
|
9 | + private static $DESCRIPTION = "%s activity on Jacob Emerick's lifestream, all nice and paginated in one awesome website."; |
|
10 | 10 | |
11 | - private static $KEYWORD_ARRAY = array( |
|
12 | - 'lifestream', |
|
13 | - 'activity stream', |
|
14 | - 'Jacob Emerick'); |
|
11 | + private static $KEYWORD_ARRAY = array( |
|
12 | + 'lifestream', |
|
13 | + 'activity stream', |
|
14 | + 'Jacob Emerick'); |
|
15 | 15 | |
16 | - private static $LIST_DESCRIPTION = 'viewing %d - %d of %d %s activities'; |
|
16 | + private static $LIST_DESCRIPTION = 'viewing %d - %d of %d %s activities'; |
|
17 | 17 | |
18 | - private $tag; |
|
18 | + private $tag; |
|
19 | 19 | |
20 | - public function __construct() |
|
21 | - { |
|
22 | - parent::__construct(); |
|
20 | + public function __construct() |
|
21 | + { |
|
22 | + parent::__construct(); |
|
23 | 23 | |
24 | - $this->tag = URLDecode::getPiece(1); |
|
25 | - } |
|
24 | + $this->tag = URLDecode::getPiece(1); |
|
25 | + } |
|
26 | 26 | |
27 | - protected function set_head_data() |
|
28 | - { |
|
29 | - $this->set_title(sprintf(self::$TITLE, ucwords($this->tag))); |
|
30 | - $this->set_description(sprintf(self::$DESCRIPTION, ucwords($this->tag))); |
|
27 | + protected function set_head_data() |
|
28 | + { |
|
29 | + $this->set_title(sprintf(self::$TITLE, ucwords($this->tag))); |
|
30 | + $this->set_description(sprintf(self::$DESCRIPTION, ucwords($this->tag))); |
|
31 | 31 | |
32 | - $keyword_array = self::$KEYWORD_ARRAY; |
|
33 | - array_unshift($keyword_array, $this->tag); |
|
34 | - $this->set_keywords($keyword_array); |
|
32 | + $keyword_array = self::$KEYWORD_ARRAY; |
|
33 | + array_unshift($keyword_array, $this->tag); |
|
34 | + $this->set_keywords($keyword_array); |
|
35 | 35 | |
36 | - parent::set_head_data(); |
|
37 | - } |
|
36 | + parent::set_head_data(); |
|
37 | + } |
|
38 | 38 | |
39 | - protected function set_body_data() |
|
40 | - { |
|
41 | - $this->set_body('title', $this->get_title()); |
|
42 | - $this->set_body('description', $this->get_description()); |
|
39 | + protected function set_body_data() |
|
40 | + { |
|
41 | + $this->set_body('title', $this->get_title()); |
|
42 | + $this->set_body('description', $this->get_description()); |
|
43 | 43 | |
44 | - parent::set_body_data(); |
|
45 | - } |
|
46 | - |
|
47 | - private function get_title() |
|
48 | - { |
|
49 | - switch($this->tag) |
|
50 | - { |
|
51 | - case 'blog' : |
|
52 | - return 'Jacob has a Blog'; |
|
53 | - break; |
|
54 | - case 'book' : |
|
55 | - return 'Jacob reads Books'; |
|
56 | - break; |
|
57 | - case 'distance' : |
|
58 | - return 'Run, Jacob, and Hike'; |
|
59 | - break; |
|
60 | - case 'github' : |
|
44 | + parent::set_body_data(); |
|
45 | + } |
|
46 | + |
|
47 | + private function get_title() |
|
48 | + { |
|
49 | + switch($this->tag) |
|
50 | + { |
|
51 | + case 'blog' : |
|
52 | + return 'Jacob has a Blog'; |
|
53 | + break; |
|
54 | + case 'book' : |
|
55 | + return 'Jacob reads Books'; |
|
56 | + break; |
|
57 | + case 'distance' : |
|
58 | + return 'Run, Jacob, and Hike'; |
|
59 | + break; |
|
60 | + case 'github' : |
|
61 | 61 | return 'Jacob, Code Monkey'; |
62 | - break; |
|
63 | - case 'hulu' : |
|
64 | - return 'Jacob watches Hulu'; |
|
65 | - break; |
|
66 | - case 'twitter' : |
|
67 | - return 'Jacob likes to Tweet'; |
|
68 | - break; |
|
69 | - case 'youtube' : |
|
70 | - return 'Videos Jacob Likes'; |
|
71 | - break; |
|
72 | - } |
|
73 | - } |
|
74 | - |
|
75 | - private function get_description() |
|
76 | - { |
|
77 | - switch($this->tag) |
|
78 | - { |
|
79 | - case 'blog' : |
|
80 | - return 'Yeah, Jacob has a blog. Check out his posting activity.'; |
|
81 | - break; |
|
82 | - case 'book' : |
|
83 | - return "Outside of building websites, hiking, and <em>being awesome</em>, Jacob reads books. Check out what he's been reading."; |
|
84 | - break; |
|
85 | - case 'distance' : |
|
86 | - return 'All the cool kids like to be in shape. Jacob goes running and hiking.'; |
|
87 | - break; |
|
88 | - case 'github' : |
|
62 | + break; |
|
63 | + case 'hulu' : |
|
64 | + return 'Jacob watches Hulu'; |
|
65 | + break; |
|
66 | + case 'twitter' : |
|
67 | + return 'Jacob likes to Tweet'; |
|
68 | + break; |
|
69 | + case 'youtube' : |
|
70 | + return 'Videos Jacob Likes'; |
|
71 | + break; |
|
72 | + } |
|
73 | + } |
|
74 | + |
|
75 | + private function get_description() |
|
76 | + { |
|
77 | + switch($this->tag) |
|
78 | + { |
|
79 | + case 'blog' : |
|
80 | + return 'Yeah, Jacob has a blog. Check out his posting activity.'; |
|
81 | + break; |
|
82 | + case 'book' : |
|
83 | + return "Outside of building websites, hiking, and <em>being awesome</em>, Jacob reads books. Check out what he's been reading."; |
|
84 | + break; |
|
85 | + case 'distance' : |
|
86 | + return 'All the cool kids like to be in shape. Jacob goes running and hiking.'; |
|
87 | + break; |
|
88 | + case 'github' : |
|
89 | 89 | return 'Since he is trying to be a developer, Jacob codes. Here is some code that he pushed around on the Githubs.'; |
90 | - break; |
|
91 | - case 'hulu' : |
|
92 | - return 'Occasionally Jacob chills and watches some Hulu. Well, used to, anyways.'; |
|
93 | - break; |
|
94 | - case 'twitter' : |
|
95 | - return 'All the cool kids are on Twitter. The cool kids and Jacob. Check his tweets, yo.'; |
|
96 | - break; |
|
97 | - case 'youtube' : |
|
98 | - return 'Jacob watches videos on YouTube. Some videos he likes more than others.'; |
|
99 | - break; |
|
100 | - } |
|
101 | - } |
|
102 | - |
|
103 | - protected function get_page_number() |
|
104 | - { |
|
105 | - $page = URLDecode::getPiece(3); |
|
106 | - if(isset($page) && is_numeric($page)) |
|
107 | - return $page; |
|
108 | - return 1; |
|
109 | - } |
|
110 | - |
|
111 | - protected function get_list_results() |
|
112 | - { |
|
113 | - return $this->activityRepository->getActivitiesByType($this->tag, self::$POSTS_PER_PAGE, $this->offset); |
|
114 | - } |
|
115 | - |
|
116 | - protected function get_list_description() |
|
117 | - { |
|
118 | - $start = $this->offset + 1; |
|
119 | - $end = min($this->offset + self::$POSTS_PER_PAGE, $this->get_total_post_count()); |
|
90 | + break; |
|
91 | + case 'hulu' : |
|
92 | + return 'Occasionally Jacob chills and watches some Hulu. Well, used to, anyways.'; |
|
93 | + break; |
|
94 | + case 'twitter' : |
|
95 | + return 'All the cool kids are on Twitter. The cool kids and Jacob. Check his tweets, yo.'; |
|
96 | + break; |
|
97 | + case 'youtube' : |
|
98 | + return 'Jacob watches videos on YouTube. Some videos he likes more than others.'; |
|
99 | + break; |
|
100 | + } |
|
101 | + } |
|
102 | + |
|
103 | + protected function get_page_number() |
|
104 | + { |
|
105 | + $page = URLDecode::getPiece(3); |
|
106 | + if(isset($page) && is_numeric($page)) |
|
107 | + return $page; |
|
108 | + return 1; |
|
109 | + } |
|
110 | + |
|
111 | + protected function get_list_results() |
|
112 | + { |
|
113 | + return $this->activityRepository->getActivitiesByType($this->tag, self::$POSTS_PER_PAGE, $this->offset); |
|
114 | + } |
|
115 | + |
|
116 | + protected function get_list_description() |
|
117 | + { |
|
118 | + $start = $this->offset + 1; |
|
119 | + $end = min($this->offset + self::$POSTS_PER_PAGE, $this->get_total_post_count()); |
|
120 | 120 | |
121 | - return sprintf(self::$LIST_DESCRIPTION, $start, $end, $this->get_total_post_count(), $this->tag); |
|
122 | - } |
|
123 | - |
|
124 | - protected function get_list_next_link() |
|
125 | - { |
|
126 | - if($this->page == 1) |
|
127 | - return; |
|
128 | - if($this->page == 2) |
|
129 | - return Loader::getRootUrl('lifestream') . $this->tag . '/'; |
|
130 | - return Loader::getRootUrl('lifestream') . $this->tag . '/page/' . ($this->page - 1) . '/'; |
|
131 | - } |
|
132 | - |
|
133 | - protected function get_list_prev_link() |
|
134 | - { |
|
135 | - if(($this->page * self::$POSTS_PER_PAGE) >= $this->get_total_post_count()) |
|
136 | - return; |
|
137 | - return Loader::getRootUrl('lifestream') . $this->tag . '/page/' . ($this->page + 1) . '/'; |
|
138 | - } |
|
139 | - |
|
140 | - private $total_post_count; |
|
141 | - protected function get_total_post_count() |
|
142 | - { |
|
143 | - if(!isset($this->total_post_count)) |
|
144 | - $this->total_post_count = $this->activityRepository->getActivitiesByTypeCount($this->tag); |
|
145 | - return $this->total_post_count; |
|
146 | - } |
|
121 | + return sprintf(self::$LIST_DESCRIPTION, $start, $end, $this->get_total_post_count(), $this->tag); |
|
122 | + } |
|
123 | + |
|
124 | + protected function get_list_next_link() |
|
125 | + { |
|
126 | + if($this->page == 1) |
|
127 | + return; |
|
128 | + if($this->page == 2) |
|
129 | + return Loader::getRootUrl('lifestream') . $this->tag . '/'; |
|
130 | + return Loader::getRootUrl('lifestream') . $this->tag . '/page/' . ($this->page - 1) . '/'; |
|
131 | + } |
|
132 | + |
|
133 | + protected function get_list_prev_link() |
|
134 | + { |
|
135 | + if(($this->page * self::$POSTS_PER_PAGE) >= $this->get_total_post_count()) |
|
136 | + return; |
|
137 | + return Loader::getRootUrl('lifestream') . $this->tag . '/page/' . ($this->page + 1) . '/'; |
|
138 | + } |
|
139 | + |
|
140 | + private $total_post_count; |
|
141 | + protected function get_total_post_count() |
|
142 | + { |
|
143 | + if(!isset($this->total_post_count)) |
|
144 | + $this->total_post_count = $this->activityRepository->getActivitiesByTypeCount($this->tag); |
|
145 | + return $this->total_post_count; |
|
146 | + } |
|
147 | 147 | |
148 | 148 | } |
@@ -5,112 +5,112 @@ |
||
5 | 5 | final class PostController extends DefaultPageController |
6 | 6 | { |
7 | 7 | |
8 | - private static $TITLE = "Post %d | %s Activity | Jacob Emerick's Lifestream"; |
|
9 | - private static $DESCRIPTION = "Post %d of %s activity on Jacob Emerick's Lifestream."; |
|
8 | + private static $TITLE = "Post %d | %s Activity | Jacob Emerick's Lifestream"; |
|
9 | + private static $DESCRIPTION = "Post %d of %s activity on Jacob Emerick's Lifestream."; |
|
10 | 10 | |
11 | - private static $KEYWORD_ARRAY = array( |
|
12 | - 'lifestream', |
|
13 | - 'activity stream', |
|
14 | - 'Jacob Emerick'); |
|
11 | + private static $KEYWORD_ARRAY = array( |
|
12 | + 'lifestream', |
|
13 | + 'activity stream', |
|
14 | + 'Jacob Emerick'); |
|
15 | 15 | |
16 | - private $post; |
|
16 | + private $post; |
|
17 | 17 | |
18 | - public function __construct() |
|
19 | - { |
|
20 | - parent::__construct(); |
|
18 | + public function __construct() |
|
19 | + { |
|
20 | + parent::__construct(); |
|
21 | 21 | |
22 | - $id = URLDecode::getPiece(2); |
|
23 | - if(!$id || !is_numeric($id)) |
|
24 | - $this->eject(); |
|
22 | + $id = URLDecode::getPiece(2); |
|
23 | + if(!$id || !is_numeric($id)) |
|
24 | + $this->eject(); |
|
25 | 25 | |
26 | - $post = $this->activityRepository->getActivityById($id); |
|
27 | - if(!$post) |
|
28 | - $this->eject(); |
|
26 | + $post = $this->activityRepository->getActivityById($id); |
|
27 | + if(!$post) |
|
28 | + $this->eject(); |
|
29 | 29 | |
30 | - if(URLDecode::getPiece(1) != $post['type']) |
|
31 | - $this->eject(); |
|
30 | + if(URLDecode::getPiece(1) != $post['type']) |
|
31 | + $this->eject(); |
|
32 | 32 | |
33 | - $this->post = $post; |
|
34 | - } |
|
33 | + $this->post = $post; |
|
34 | + } |
|
35 | 35 | |
36 | - protected function set_head_data() |
|
37 | - { |
|
38 | - $this->set_title(sprintf(self::$TITLE, $this->post['id'], ucwords($this->post['type']))); |
|
39 | - $this->set_description(sprintf(self::$DESCRIPTION, $this->post['id'], ucwords($this->post['type']))); |
|
36 | + protected function set_head_data() |
|
37 | + { |
|
38 | + $this->set_title(sprintf(self::$TITLE, $this->post['id'], ucwords($this->post['type']))); |
|
39 | + $this->set_description(sprintf(self::$DESCRIPTION, $this->post['id'], ucwords($this->post['type']))); |
|
40 | 40 | |
41 | - $keyword_array = self::$KEYWORD_ARRAY; |
|
42 | - array_unshift($keyword_array, $this->post['type']); |
|
43 | - $this->set_keywords($keyword_array); |
|
41 | + $keyword_array = self::$KEYWORD_ARRAY; |
|
42 | + array_unshift($keyword_array, $this->post['type']); |
|
43 | + $this->set_keywords($keyword_array); |
|
44 | 44 | |
45 | - parent::set_head_data(); |
|
46 | - } |
|
45 | + parent::set_head_data(); |
|
46 | + } |
|
47 | 47 | |
48 | - protected function set_body_data() |
|
49 | - { |
|
50 | - $this->set_body('title', $this->get_title()); |
|
51 | - $this->set_body('description', $this->get_description()); |
|
48 | + protected function set_body_data() |
|
49 | + { |
|
50 | + $this->set_body('title', $this->get_title()); |
|
51 | + $this->set_body('description', $this->get_description()); |
|
52 | 52 | |
53 | - $this->set_body('post', $this->expand_post($this->post, 'full')); |
|
54 | - $this->set_body('type', 'single'); |
|
55 | - $this->set_body('view', 'Post'); |
|
53 | + $this->set_body('post', $this->expand_post($this->post, 'full')); |
|
54 | + $this->set_body('type', 'single'); |
|
55 | + $this->set_body('view', 'Post'); |
|
56 | 56 | |
57 | - parent::set_body_data(); |
|
58 | - } |
|
57 | + parent::set_body_data(); |
|
58 | + } |
|
59 | 59 | |
60 | - private function get_title() |
|
61 | - { |
|
62 | - switch($this->post['type']) |
|
63 | - { |
|
64 | - case 'blog' : |
|
65 | - return 'Jacob blogged'; |
|
66 | - break; |
|
67 | - case 'book' : |
|
68 | - return 'Jacob read again'; |
|
69 | - break; |
|
70 | - case 'distance' : |
|
71 | - return 'Jacob ran xor hiked'; |
|
72 | - break; |
|
73 | - case 'github' : |
|
60 | + private function get_title() |
|
61 | + { |
|
62 | + switch($this->post['type']) |
|
63 | + { |
|
64 | + case 'blog' : |
|
65 | + return 'Jacob blogged'; |
|
66 | + break; |
|
67 | + case 'book' : |
|
68 | + return 'Jacob read again'; |
|
69 | + break; |
|
70 | + case 'distance' : |
|
71 | + return 'Jacob ran xor hiked'; |
|
72 | + break; |
|
73 | + case 'github' : |
|
74 | 74 | return 'Jacob did code'; |
75 | - break; |
|
76 | - case 'hulu' : |
|
77 | - return 'What Jacob watched'; |
|
78 | - break; |
|
79 | - case 'twitter' : |
|
80 | - return 'What Jacob tweeted'; |
|
81 | - break; |
|
82 | - case 'youtube' : |
|
83 | - return 'Jacob Liked a Video'; |
|
84 | - break; |
|
85 | - } |
|
86 | - } |
|
75 | + break; |
|
76 | + case 'hulu' : |
|
77 | + return 'What Jacob watched'; |
|
78 | + break; |
|
79 | + case 'twitter' : |
|
80 | + return 'What Jacob tweeted'; |
|
81 | + break; |
|
82 | + case 'youtube' : |
|
83 | + return 'Jacob Liked a Video'; |
|
84 | + break; |
|
85 | + } |
|
86 | + } |
|
87 | 87 | |
88 | - private function get_description() |
|
89 | - { |
|
90 | - switch($this->post['type']) |
|
91 | - { |
|
92 | - case 'blog' : |
|
93 | - return 'Another awesome blog post from Jacob. Did I mention it was awesome?'; |
|
94 | - break; |
|
95 | - case 'book' : |
|
96 | - return "Yup, Jacob read another book. Don't tell his parents."; |
|
97 | - break; |
|
98 | - case 'distance' : |
|
99 | - return 'Well, it might have been both at the same time if there was a bear.'; |
|
100 | - break; |
|
101 | - case 'github' : |
|
88 | + private function get_description() |
|
89 | + { |
|
90 | + switch($this->post['type']) |
|
91 | + { |
|
92 | + case 'blog' : |
|
93 | + return 'Another awesome blog post from Jacob. Did I mention it was awesome?'; |
|
94 | + break; |
|
95 | + case 'book' : |
|
96 | + return "Yup, Jacob read another book. Don't tell his parents."; |
|
97 | + break; |
|
98 | + case 'distance' : |
|
99 | + return 'Well, it might have been both at the same time if there was a bear.'; |
|
100 | + break; |
|
101 | + case 'github' : |
|
102 | 102 | return 'An epic code change by Jacob on the Githubs.'; |
103 | - break; |
|
104 | - case 'hulu' : |
|
105 | - return 'It was a cold, dark night, so Jacob watched something on Hulu.'; |
|
106 | - break; |
|
107 | - case 'twitter' : |
|
108 | - return 'Just another awesome insight/thought/RT/random from Jacob.'; |
|
109 | - break; |
|
110 | - case 'youtube' : |
|
111 | - return "This is a video that Jacob liked on Youtube. It's probably awesome. You should check it out."; |
|
112 | - break; |
|
113 | - } |
|
114 | - } |
|
103 | + break; |
|
104 | + case 'hulu' : |
|
105 | + return 'It was a cold, dark night, so Jacob watched something on Hulu.'; |
|
106 | + break; |
|
107 | + case 'twitter' : |
|
108 | + return 'Just another awesome insight/thought/RT/random from Jacob.'; |
|
109 | + break; |
|
110 | + case 'youtube' : |
|
111 | + return "This is a video that Jacob liked on Youtube. It's probably awesome. You should check it out."; |
|
112 | + break; |
|
113 | + } |
|
114 | + } |
|
115 | 115 | |
116 | 116 | } |