Location: PHPKode > scripts > phpFlickrSynch > phpflickrsynch/_classes/class_FlickrUtils.php
<?php
	class FlickrUtils {

		public function getSizeField($size = 'Medium') {
			$sizes = array(
				'square' => '_s',
				'thumbnail' => 'size_thumbnail',
				'small' => 'size_small',
				'medium' => 'size_medium',
				'large' => 'size_large',
				'original' => 'size_original'
			);
			$size = strtolower($size);
			if (!array_key_exists($size, $sizes)) {
				$size = 'medium';
			}
			return $sizes[$size];
		}

		/**
		  * Inspired from the buildPhotoURL method in phpFlickr API.
		  */
		public function buildPhotoURL ($farm, $server, $id, $secret, $originalsecret, $originalformat, $size = 'Medium', $photosize) {
			$sizes = array(
				'square' => '_s',
				'thumbnail' => '_t',
				'small' => '_m',
				'medium' => '',
				'large' => '_b',
				'original' => '_o'
			);			
			$size = strtolower($size);
			if (!array_key_exists($size, $sizes)) {
				$size = 'medium';
			}
			
			if ($size == 'original') {
				$url = 'http://farm' . $farm . '.static.flickr.com/' . $server . '/' . $id . '_' . $originalsecret . '_o' . '.' . $originalformat;
			} else {
				$url = 'http://farm' . $farm . '.static.flickr.com/' . $server . '/' . $id . '_' . $secret . $sizes[$size] . '.jpg';
			}
			
			$tab = explode(';', $photosize);
			
			return array(
				'source' => $url,
				'width' => $tab[0],
				'height' => $tab[1]
			);
		}	
	}
?>
Return current item: phpFlickrSynch