@@ -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( |
@@ -10,10 +10,10 @@ discard block |
||
| 10 | 10 | protected function execute($title = '') |
| 11 | 11 | { |
| 12 | 12 | preg_match_all(self::$MARKUP_DELIMITER, $this->content, $matches); |
| 13 | - if(count($matches[1]) == 0) |
|
| 13 | + if (count($matches[1]) == 0) |
|
| 14 | 14 | return; |
| 15 | 15 | |
| 16 | - foreach($matches[3] as $key => $match) |
|
| 16 | + foreach ($matches[3] as $key => $match) |
|
| 17 | 17 | { |
| 18 | 18 | $replacement = $match; |
| 19 | 19 | $replacement = $this->wrap_in_list($replacement); |
@@ -29,7 +29,7 @@ discard block |
||
| 29 | 29 | { |
| 30 | 30 | $content_array = explode("\n", $content); |
| 31 | 31 | |
| 32 | - foreach($content_array as $key => $row) |
|
| 32 | + foreach ($content_array as $key => $row) |
|
| 33 | 33 | { |
| 34 | 34 | $new_row = ($key % 2 == 0) ? '<li class="even">' : '<li class="odd">'; |
| 35 | 35 | $new_row .= '<p>'; |
@@ -46,7 +46,7 @@ discard block |
||
| 46 | 46 | |
| 47 | 47 | private function highlight_code($content, $type) |
| 48 | 48 | { |
| 49 | - switch($type) |
|
| 49 | + switch ($type) |
|
| 50 | 50 | { |
| 51 | 51 | default : |
| 52 | 52 | return $content; |
@@ -12,9 +12,9 @@ discard block |
||
| 12 | 12 | protected function execute($is_absolute = true) |
| 13 | 13 | { |
| 14 | 14 | preg_match_all(self::$LINK_PLACEHOLDER_MATCH, $this->content, $matches); |
| 15 | - foreach($matches[1] as $key => $match) |
|
| 15 | + foreach ($matches[1] as $key => $match) |
|
| 16 | 16 | { |
| 17 | - if(isset($matches[3][$key])) |
|
| 17 | + if (isset($matches[3][$key])) |
|
| 18 | 18 | $link_content = $this->get_link($match, $is_absolute, $matches[3][$key]); |
| 19 | 19 | else |
| 20 | 20 | $link_content = $this->get_link($match, $is_absolute); |
@@ -29,19 +29,19 @@ discard block |
||
| 29 | 29 | |
| 30 | 30 | $link = ''; |
| 31 | 31 | |
| 32 | - switch($type) |
|
| 32 | + switch ($type) |
|
| 33 | 33 | { |
| 34 | 34 | case 'blog' : |
| 35 | 35 | Loader::load('collector', 'blog/PostCollector'); |
| 36 | 36 | $post = PostCollector::getPostByURI($uri); |
| 37 | 37 | |
| 38 | - if($post === NULL) |
|
| 38 | + if ($post === NULL) |
|
| 39 | 39 | return; |
| 40 | 40 | |
| 41 | 41 | $link .= ($is_absolute) ? Loader::getRootURL('blog') : '/'; |
| 42 | 42 | $link .= "{$post->category}/{$post->path}/"; |
| 43 | 43 | |
| 44 | - if($anchor == '') |
|
| 44 | + if ($anchor == '') |
|
| 45 | 45 | $anchor = $post->title; |
| 46 | 46 | |
| 47 | 47 | break; |
@@ -49,7 +49,7 @@ discard block |
||
| 49 | 49 | $link .= ($is_absolute) ? Loader::getRootURL('blog') : '/'; |
| 50 | 50 | $link .= "tag/{$uri}/"; |
| 51 | 51 | |
| 52 | - if($anchor == '') |
|
| 52 | + if ($anchor == '') |
|
| 53 | 53 | { |
| 54 | 54 | $anchor = $uri; |
| 55 | 55 | $anchor = str_replace('-', ' ', $anchor); |
@@ -61,13 +61,13 @@ discard block |
||
| 61 | 61 | Loader::load('collector', 'waterfall/LogCollector'); |
| 62 | 62 | $log = LogCollector::getByAlias($uri); |
| 63 | 63 | |
| 64 | - if($log === NULL) |
|
| 64 | + if ($log === NULL) |
|
| 65 | 65 | return; |
| 66 | 66 | |
| 67 | 67 | $link .= ($is_absolute) ? Loader::getRootURL('waterfalls') : '/'; |
| 68 | 68 | $link .= "journal/{$log->alias}/"; |
| 69 | 69 | |
| 70 | - if($anchor == '') |
|
| 70 | + if ($anchor == '') |
|
| 71 | 71 | $anchor = $log->title; |
| 72 | 72 | |
| 73 | 73 | break; |
@@ -12,7 +12,7 @@ discard block |
||
| 12 | 12 | protected function execute($is_absolute = false, $size = 'medium') |
| 13 | 13 | { |
| 14 | 14 | preg_match_all(self::$PHOTO_PLACEHOLDER_MATCH, $this->content, $matches); |
| 15 | - foreach($matches[1] as $key => $match) |
|
| 15 | + foreach ($matches[1] as $key => $match) |
|
| 16 | 16 | { |
| 17 | 17 | $photo_content = $this->get_photo_content($match, $size, $is_absolute); |
| 18 | 18 | $this->content = str_replace($matches[0][$key], $photo_content, $this->content); |
@@ -37,7 +37,7 @@ discard block |
||
| 37 | 37 | |
| 38 | 38 | Loader::load('collector', 'image/PhotoCollector'); |
| 39 | 39 | $photo_result = PhotoCollector::fetchRow($category, $photo); |
| 40 | - if($photo_result == false) |
|
| 40 | + if ($photo_result == false) |
|
| 41 | 41 | return ''; |
| 42 | 42 | |
| 43 | 43 | $height = $file_size[1]; |
@@ -49,7 +49,7 @@ discard block |
||
| 49 | 49 | } |
| 50 | 50 | |
| 51 | 51 | $domain = '/'; |
| 52 | - if($is_absolute) |
|
| 52 | + if ($is_absolute) |
|
| 53 | 53 | $domain = Loader::getRootUrl('blog'); |
| 54 | 54 | |
| 55 | 55 | return sprintf(self::$PHOTO_CONTENT, $domain, $category, $photo, $size, $height, $width, $description, $description); |
@@ -10,61 +10,61 @@ |
||
| 10 | 10 | $previous_time = strtotime($this->content); |
| 11 | 11 | $current_time = time(); |
| 12 | 12 | |
| 13 | - if($current_time <= $previous_time) |
|
| 13 | + if ($current_time <= $previous_time) |
|
| 14 | 14 | $this->content = 'few seconds ago'; |
| 15 | - else if(($current_time - $previous_time) < 30) |
|
| 15 | + else if (($current_time - $previous_time) < 30) |
|
| 16 | 16 | $this->content = 'few seconds ago'; |
| 17 | - else if(($current_time - $previous_time) < 1.5 * 60) |
|
| 17 | + else if (($current_time - $previous_time) < 1.5 * 60) |
|
| 18 | 18 | $this->content = 'a minute ago'; |
| 19 | - else if(($current_time - $previous_time) < 4 * 60) |
|
| 19 | + else if (($current_time - $previous_time) < 4 * 60) |
|
| 20 | 20 | $this->content = 'few minutes ago'; |
| 21 | - else if(($current_time - $previous_time) < 7 * 60) |
|
| 21 | + else if (($current_time - $previous_time) < 7 * 60) |
|
| 22 | 22 | $this->content = 'five minutes ago'; |
| 23 | - else if(($current_time - $previous_time) < 12 * 60) |
|
| 23 | + else if (($current_time - $previous_time) < 12 * 60) |
|
| 24 | 24 | $this->content = 'ten minutes ago'; |
| 25 | - else if(($current_time - $previous_time) < 17 * 60) |
|
| 25 | + else if (($current_time - $previous_time) < 17 * 60) |
|
| 26 | 26 | $this->content = 'fifteen minutes ago'; |
| 27 | - else if(($current_time - $previous_time) < 22 * 60) |
|
| 27 | + else if (($current_time - $previous_time) < 22 * 60) |
|
| 28 | 28 | $this->content = 'twenty minutes ago'; |
| 29 | - else if(($current_time - $previous_time) < 37 * 60) |
|
| 29 | + else if (($current_time - $previous_time) < 37 * 60) |
|
| 30 | 30 | $this->content = 'half hour ago'; |
| 31 | - else if(($current_time - $previous_time) < 52 * 60) |
|
| 31 | + else if (($current_time - $previous_time) < 52 * 60) |
|
| 32 | 32 | $this->content = 'forty-five minutes ago'; |
| 33 | - else if(($current_time - $previous_time) < 1.5 * 60 * 60) |
|
| 33 | + else if (($current_time - $previous_time) < 1.5 * 60 * 60) |
|
| 34 | 34 | $this->content = 'an hour ago'; |
| 35 | - else if(($current_time - $previous_time) < 2.5 * 60 * 60) |
|
| 35 | + else if (($current_time - $previous_time) < 2.5 * 60 * 60) |
|
| 36 | 36 | $this->content = 'two hours ago'; |
| 37 | - else if(($current_time - $previous_time) < 3.5 * 60 * 60) |
|
| 37 | + else if (($current_time - $previous_time) < 3.5 * 60 * 60) |
|
| 38 | 38 | $this->content = 'three hours ago'; |
| 39 | - else if(($current_time - $previous_time) < 4.5 * 60 * 60) |
|
| 39 | + else if (($current_time - $previous_time) < 4.5 * 60 * 60) |
|
| 40 | 40 | $this->content = 'few hours ago'; |
| 41 | - else if(($current_time - $previous_time) < 1 * 24 * 60 * 60 && date('j', $current_time) == date('j', $previous_time) && date('a', $previous_time) == 'pm') |
|
| 41 | + else if (($current_time - $previous_time) < 1 * 24 * 60 * 60 && date('j', $current_time) == date('j', $previous_time) && date('a', $previous_time) == 'pm') |
|
| 42 | 42 | $this->content = 'this afternoon'; |
| 43 | - else if(($current_time - $previous_time) < 1 * 24 * 60 * 60 && date('j', $current_time) == date('j', $previous_time) && date('a', $previous_time) == 'am') |
|
| 43 | + else if (($current_time - $previous_time) < 1 * 24 * 60 * 60 && date('j', $current_time) == date('j', $previous_time) && date('a', $previous_time) == 'am') |
|
| 44 | 44 | $this->content = 'this morning'; |
| 45 | - else if(($current_time - $previous_time) < 2 * 24 * 60 * 60 && date('j', $current_time) == date('j', $previous_time) + 1 && date('a', $previous_time) == 'pm' && date('G', $previous_time) >= 17) |
|
| 45 | + else if (($current_time - $previous_time) < 2 * 24 * 60 * 60 && date('j', $current_time) == date('j', $previous_time) + 1 && date('a', $previous_time) == 'pm' && date('G', $previous_time) >= 17) |
|
| 46 | 46 | $this->content = 'yesterday evening'; |
| 47 | - else if(($current_time - $previous_time) < 2 * 24 * 60 * 60 && date('j', $current_time) == date('j', $previous_time) + 1 && date('a', $previous_time) == 'pm') |
|
| 47 | + else if (($current_time - $previous_time) < 2 * 24 * 60 * 60 && date('j', $current_time) == date('j', $previous_time) + 1 && date('a', $previous_time) == 'pm') |
|
| 48 | 48 | $this->content = 'yesterday afternoon'; |
| 49 | - else if(($current_time - $previous_time) < 2 * 24 * 60 * 60 && date('j', $current_time) == date('j', $previous_time) + 1 && date('a', $previous_time) == 'am') |
|
| 49 | + else if (($current_time - $previous_time) < 2 * 24 * 60 * 60 && date('j', $current_time) == date('j', $previous_time) + 1 && date('a', $previous_time) == 'am') |
|
| 50 | 50 | $this->content = 'yesterday morning'; |
| 51 | - else if(($current_time - $previous_time) < 3 * 24 * 60 * 60 && date('j', $current_time) == date('j', $previous_time) + 2) |
|
| 51 | + else if (($current_time - $previous_time) < 3 * 24 * 60 * 60 && date('j', $current_time) == date('j', $previous_time) + 2) |
|
| 52 | 52 | $this->content = 'two days ago'; |
| 53 | - else if(($current_time - $previous_time) < 4 * 24 * 60 * 60 && date('j', $current_time) == date('j', $previous_time) + 3) |
|
| 53 | + else if (($current_time - $previous_time) < 4 * 24 * 60 * 60 && date('j', $current_time) == date('j', $previous_time) + 3) |
|
| 54 | 54 | $this->content = 'three days ago'; |
| 55 | - else if(($current_time - $previous_time) < 1 * 7 * 24 * 60 * 60 && date('W', $current_time) == date('W', $previous_time)) |
|
| 55 | + else if (($current_time - $previous_time) < 1 * 7 * 24 * 60 * 60 && date('W', $current_time) == date('W', $previous_time)) |
|
| 56 | 56 | $this->content = 'earlier this week'; |
| 57 | - else if(($current_time - $previous_time) < 2 * 7 * 24 * 60 * 60 && date('W', $current_time) == date('W', $previous_time) + 1 && date('w', $previous_time) >= 3) |
|
| 57 | + else if (($current_time - $previous_time) < 2 * 7 * 24 * 60 * 60 && date('W', $current_time) == date('W', $previous_time) + 1 && date('w', $previous_time) >= 3) |
|
| 58 | 58 | $this->content = 'late last week'; |
| 59 | - else if(($current_time - $previous_time) < 2 * 7 * 24 * 60 * 60 && date('W', $current_time) == date('W', $previous_time) + 1) |
|
| 59 | + else if (($current_time - $previous_time) < 2 * 7 * 24 * 60 * 60 && date('W', $current_time) == date('W', $previous_time) + 1) |
|
| 60 | 60 | $this->content = 'early last week'; |
| 61 | - else if(($current_time - $previous_time) < 3 * 7 * 24 * 60 * 60) |
|
| 61 | + else if (($current_time - $previous_time) < 3 * 7 * 24 * 60 * 60) |
|
| 62 | 62 | $this->content = 'few weeks ago'; |
| 63 | - else if(($current_time - $previous_time) < 1.25* 4 * 7 * 24 * 60 * 60 && date('n', $current_time) == date('n', $previous_time)) |
|
| 63 | + else if (($current_time - $previous_time) < 1.25 * 4 * 7 * 24 * 60 * 60 && date('n', $current_time) == date('n', $previous_time)) |
|
| 64 | 64 | $this->content = 'earlier this month'; |
| 65 | - else if(($current_time - $previous_time) < 2 * 4 * 7 * 24 * 60 * 60 && date('n', $current_time) == date('n', $previous_time) + 1) |
|
| 65 | + else if (($current_time - $previous_time) < 2 * 4 * 7 * 24 * 60 * 60 && date('n', $current_time) == date('n', $previous_time) + 1) |
|
| 66 | 66 | $this->content = 'last month'; |
| 67 | - else if(($current_time - $previous_time) < 4 * 4 * 7 * 24 * 60 * 60) |
|
| 67 | + else if (($current_time - $previous_time) < 4 * 4 * 7 * 24 * 60 * 60) |
|
| 68 | 68 | $this->content = 'several months ago'; |
| 69 | 69 | else |
| 70 | 70 | $this->content = 'long ago'; |
@@ -11,7 +11,7 @@ discard block |
||
| 11 | 11 | |
| 12 | 12 | protected function execute($is_absolute = false, $size = 'thumb') |
| 13 | 13 | { |
| 14 | - if(preg_match(self::$PHOTO_PLACEHOLDER_MATCH, $this->content, $match) === 1) |
|
| 14 | + if (preg_match(self::$PHOTO_PLACEHOLDER_MATCH, $this->content, $match) === 1) |
|
| 15 | 15 | $this->content = $this->get_thumb($match[1], $is_absolute, $size); |
| 16 | 16 | else |
| 17 | 17 | $this->content = self::$DEFAULT_RETURN; |
@@ -34,7 +34,7 @@ discard block |
||
| 34 | 34 | |
| 35 | 35 | Loader::load('collector', 'image/PhotoCollector'); |
| 36 | 36 | $photo_result = PhotoCollector::fetchRow($category, $photo); |
| 37 | - if($photo_result == false) |
|
| 37 | + if ($photo_result == false) |
|
| 38 | 38 | return ''; |
| 39 | 39 | |
| 40 | 40 | $height = $file_size[1]; |
@@ -42,7 +42,7 @@ discard block |
||
| 42 | 42 | $description = $photo_result->description; |
| 43 | 43 | |
| 44 | 44 | $domain = '/'; |
| 45 | - if($is_absolute) |
|
| 45 | + if ($is_absolute) |
|
| 46 | 46 | $domain = Loader::getRootUrl(); |
| 47 | 47 | |
| 48 | 48 | return sprintf(self::$IMAGE_NODE, $domain, $category, $photo, $size, $extension, $height, $width, $description); |
@@ -11,39 +11,39 @@ discard block |
||
| 11 | 11 | |
| 12 | 12 | public static function isBoolean($value, $strict = false) |
| 13 | 13 | { |
| 14 | - if($strict && ($value === true || $value === false)) |
|
| 14 | + if ($strict && ($value === true || $value === false)) |
|
| 15 | 15 | return true; |
| 16 | - if(!$strict && ((bool) $value === true || (bool) $value === false)) |
|
| 16 | + if (!$strict && ((bool) $value === true || (bool) $value === false)) |
|
| 17 | 17 | return true; |
| 18 | 18 | return false; |
| 19 | 19 | } |
| 20 | 20 | |
| 21 | 21 | public static function isDate($value) |
| 22 | 22 | { |
| 23 | - if(strtotime($value) !== -1) |
|
| 23 | + if (strtotime($value) !== -1) |
|
| 24 | 24 | return true; |
| 25 | - if(date('y', $value) !== false) |
|
| 25 | + if (date('y', $value) !== false) |
|
| 26 | 26 | return true; |
| 27 | 27 | return false; |
| 28 | 28 | } |
| 29 | 29 | |
| 30 | 30 | public static function isInteger($value, $strict = false) |
| 31 | 31 | { |
| 32 | - if($strict) |
|
| 32 | + if ($strict) |
|
| 33 | 33 | return is_int($value); |
| 34 | 34 | return (int) $value == $value; |
| 35 | 35 | } |
| 36 | 36 | |
| 37 | 37 | public static function isIP($value) |
| 38 | 38 | { |
| 39 | - if(self::isInteger(ip2long($value))) |
|
| 39 | + if (self::isInteger(ip2long($value))) |
|
| 40 | 40 | return true; |
| 41 | 41 | return false; |
| 42 | 42 | } |
| 43 | 43 | |
| 44 | 44 | public static function isString($value, $strict = false) |
| 45 | 45 | { |
| 46 | - if($strict) |
|
| 46 | + if ($strict) |
|
| 47 | 47 | return is_string($value); |
| 48 | 48 | return (string) $value == $value; |
| 49 | 49 | } |
@@ -67,14 +67,14 @@ discard block |
||
| 67 | 67 | private static function check_value($pattern, $string) |
| 68 | 68 | { |
| 69 | 69 | preg_match($pattern, $string, $matches); |
| 70 | - if(empty($matches)) |
|
| 70 | + if (empty($matches)) |
|
| 71 | 71 | return false; |
| 72 | 72 | return $matches[0] == $string; |
| 73 | 73 | } |
| 74 | 74 | |
| 75 | 75 | public static function checkRequest($type, $key, $validation, $strict = false) |
| 76 | 76 | { |
| 77 | - switch($type) |
|
| 77 | + switch ($type) |
|
| 78 | 78 | { |
| 79 | 79 | case 'server': |
| 80 | 80 | $value = Request::getServer($key); |
@@ -84,10 +84,10 @@ discard block |
||
| 84 | 84 | break; |
| 85 | 85 | } |
| 86 | 86 | |
| 87 | - if($value == false) |
|
| 87 | + if ($value == false) |
|
| 88 | 88 | return false; |
| 89 | 89 | |
| 90 | - switch($validation) |
|
| 90 | + switch ($validation) |
|
| 91 | 91 | { |
| 92 | 92 | case 'boolean': |
| 93 | 93 | return self::isBoolean($value, $strict); |
@@ -18,9 +18,9 @@ discard block |
||
| 18 | 18 | |
| 19 | 19 | static function getServer($key = null) |
| 20 | 20 | { |
| 21 | - if($key) |
|
| 21 | + if ($key) |
|
| 22 | 22 | { |
| 23 | - if(isset(self::$server[$key])) |
|
| 23 | + if (isset(self::$server[$key])) |
|
| 24 | 24 | return self::$server[$key]; |
| 25 | 25 | return false; |
| 26 | 26 | } |
@@ -29,16 +29,16 @@ discard block |
||
| 29 | 29 | |
| 30 | 30 | static function isAjax() |
| 31 | 31 | { |
| 32 | - if(self::getServer(self::$AJAX_REQUEST)) |
|
| 32 | + if (self::getServer(self::$AJAX_REQUEST)) |
|
| 33 | 33 | return true; |
| 34 | 34 | return false; |
| 35 | 35 | } |
| 36 | 36 | |
| 37 | 37 | static function getGet($key = null) |
| 38 | 38 | { |
| 39 | - if($key) |
|
| 39 | + if ($key) |
|
| 40 | 40 | { |
| 41 | - if(isset(self::$get[$key])) |
|
| 41 | + if (isset(self::$get[$key])) |
|
| 42 | 42 | return self::$get[$key]; |
| 43 | 43 | return false; |
| 44 | 44 | } |
@@ -47,9 +47,9 @@ discard block |
||
| 47 | 47 | |
| 48 | 48 | static function getPost($key = null) |
| 49 | 49 | { |
| 50 | - if($key) |
|
| 50 | + if ($key) |
|
| 51 | 51 | { |
| 52 | - if(isset(self::$post[$key])) |
|
| 52 | + if (isset(self::$post[$key])) |
|
| 53 | 53 | return self::$post[$key]; |
| 54 | 54 | return false; |
| 55 | 55 | } |
@@ -56,11 +56,11 @@ |
||
| 56 | 56 | final private function get_list_posts() |
| 57 | 57 | { |
| 58 | 58 | $post_array = array(); |
| 59 | - foreach($this->get_list_results() as $post) |
|
| 59 | + foreach ($this->get_list_results() as $post) |
|
| 60 | 60 | { |
| 61 | 61 | $post_array[] = $this->format_post($post, true); |
| 62 | 62 | } |
| 63 | - if(count($post_array) < 1 && URLDecode::getPiece(1) !== 'search') |
|
| 63 | + if (count($post_array) < 1 && URLDecode::getPiece(1) !== 'search') |
|
| 64 | 64 | $this->eject(); |
| 65 | 65 | return $post_array; |
| 66 | 66 | } |