@@ -48,9 +48,9 @@ discard block |
||
| 48 | 48 | $this->set_keywords($this->get_post_keywords()); |
| 49 | 49 | $this->set_author(self::$AUTHOR); |
| 50 | 50 | |
| 51 | - $photo = Content::instance('FetchFirstPhoto', $this->post->body)->activate(true); |
|
| 52 | - $photo = preg_match('/^<img src="([a-z-:\.\/]+)" [^>]+>$/', $photo, $matches); |
|
| 53 | - $this->set_head('thumbnail', $matches[1]); |
|
| 51 | + $photo = Content::instance('FetchFirstPhoto', $this->post->body)->activate(true); |
|
| 52 | + $photo = preg_match('/^<img src="([a-z-:\.\/]+)" [^>]+>$/', $photo, $matches); |
|
| 53 | + $this->set_head('thumbnail', $matches[1]); |
|
| 54 | 54 | |
| 55 | 55 | if (array_key_exists($this->post->id, self::$DEPRECATED_BLOGS)) { |
| 56 | 56 | $log_id = self::$DEPRECATED_BLOGS[$this->post->id]; |
@@ -124,13 +124,13 @@ discard block |
||
| 124 | 124 | |
| 125 | 125 | $post = new stdclass(); |
| 126 | 126 | |
| 127 | - if (strpos($post_row->title, 'Rainy Supe Loop') === 0) { |
|
| 128 | - $title = $post_row->title; |
|
| 129 | - $title = explode(':', $title); |
|
| 130 | - $title = array_pop($title); |
|
| 131 | - $title = trim($title); |
|
| 132 | - $post->title = $title; |
|
| 133 | - } else if (strpos($post_row->title, 'Isle Royale') === 0) { |
|
| 127 | + if (strpos($post_row->title, 'Rainy Supe Loop') === 0) { |
|
| 128 | + $title = $post_row->title; |
|
| 129 | + $title = explode(':', $title); |
|
| 130 | + $title = array_pop($title); |
|
| 131 | + $title = trim($title); |
|
| 132 | + $post->title = $title; |
|
| 133 | + } else if (strpos($post_row->title, 'Isle Royale') === 0) { |
|
| 134 | 134 | $title = $post_row->title; |
| 135 | 135 | $title = explode(',', $title); |
| 136 | 136 | $title = array_pop($title); |
@@ -11,10 +11,11 @@ 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) |
|
| 15 | - $this->content = $this->get_thumb($match[1], $is_absolute, $size); |
|
| 16 | - else |
|
| 17 | - $this->content = self::$DEFAULT_RETURN; |
|
| 14 | + if(preg_match(self::$PHOTO_PLACEHOLDER_MATCH, $this->content, $match) === 1) {
|
|
| 15 | + $this->content = $this->get_thumb($match[1], $is_absolute, $size); |
|
| 16 | + } else {
|
|
| 17 | + $this->content = self::$DEFAULT_RETURN; |
|
| 18 | + } |
|
| 18 | 19 | return; |
| 19 | 20 | } |
| 20 | 21 | |
@@ -34,16 +35,18 @@ discard block |
||
| 34 | 35 | |
| 35 | 36 | Loader::load('collector', 'image/PhotoCollector'); |
| 36 | 37 | $photo_result = PhotoCollector::fetchRow($category, $photo); |
| 37 | - if($photo_result == false) |
|
| 38 | - return ''; |
|
| 38 | + if($photo_result == false) {
|
|
| 39 | + return ''; |
|
| 40 | + } |
|
| 39 | 41 | |
| 40 | 42 | $height = $file_size[1]; |
| 41 | 43 | $width = $file_size[0]; |
| 42 | 44 | $description = $photo_result->description; |
| 43 | 45 | |
| 44 | 46 | $domain = '/'; |
| 45 | - if($is_absolute) |
|
| 46 | - $domain = Loader::getRootURL(URLDecode::getSite()); |
|
| 47 | + if($is_absolute) {
|
|
| 48 | + $domain = Loader::getRootURL(URLDecode::getSite()); |
|
| 49 | + } |
|
| 47 | 50 | |
| 48 | 51 | return sprintf(self::$IMAGE_NODE, $domain, $category, $photo, $size, $extension, $height, $width, $description); |
| 49 | 52 | } |