Code Duplication    Length = 23-24 lines in 2 locations

utility/content/FetchFirstPhotoContent.class.inc.php 1 location

@@ 27-49 (lines=23) @@
24
		return Loader::getImagePath('photo', $path);
25
	}
26
27
	private function get_thumb($string, $is_absolute, $size)
28
	{
29
		list($category, $file_name) = explode('/', $string);
30
		list($photo, $extension) = explode('.', $file_name);
31
		
32
		$file_path = $this->get_file_path($category, $photo, $size, $extension);
33
		$file_size = getimagesize($file_path);
34
		
35
		Loader::load('collector', 'image/PhotoCollector');
36
		$photo_result = PhotoCollector::fetchRow($category, $photo);
37
		if($photo_result == false)
38
			return '';
39
		
40
		$height = $file_size[1];
41
		$width = $file_size[0];
42
		$description = $photo_result->description;
43
		
44
		$domain = '/';
45
		if($is_absolute)
46
			$domain = Loader::getRootUrl();
47
		
48
		return sprintf(self::$IMAGE_NODE, $domain, $category, $photo, $size, $extension, $height, $width, $description);
49
	}
50
51
}
52

utility/content/FixPhotoContent.class.inc.php 1 location

@@ 29-52 (lines=24) @@
26
		return Loader::getImagePath('photo', $path);
27
	}
28
29
	private function get_photo_content($string, $size, $is_absolute)
30
	{
31
		list($category, $file_name) = explode('/', $string);
32
		list($photo, $extension) = explode('.', $file_name);
33
		
34
		$file_path = $this->get_file_path($category, $photo, $size, $extension);
35
		
36
		$file_size = getimagesize($file_path);
37
		
38
		Loader::load('collector', 'image/PhotoCollector');
39
		$photo_result = PhotoCollector::fetchRow($category, $photo);
40
		if($photo_result == false)
41
			return '';
42
		
43
		$height = $file_size[1];
44
		$width = $file_size[0];
45
		$description = $photo_result->description;
46
        
47
		$domain = '/';
48
		if($is_absolute)
49
			$domain = Loader::getRootUrl('blog');
50
		
51
		return sprintf(self::$PHOTO_CONTENT, $domain, $category, $photo, $size, $height, $width, $description, $description);
52
	}
53
54
}
55