Location: PHPKode > scripts > Pipho - iPhone optimized image gallery > pipho-iphone-optimized-image-gallery/library/Pipho/DeviceInfo.php
<?php
/******************************************************************************
 *	PIPHO, version 1.01.00
 *	(c) 2009 jaipho.com
 *
 *	PIPHO is freely used under the terms of an FreeBSD license.
 *	For details, see the PIPHO web site: http://www.jaipho.com/pipho/
 ******************************************************************************/

class Pipho_DeviceInfo
{
	public $thumbsSize;
	public $slideMaxSize;
	
	public static function isSupported()
	{
		$user_agent		=	self::getUserAgent();
		
		if (strstr( $user_agent,'iphone') 
 			|| strstr( $user_agent,'ipod'))
 		{
 			return true;
 		}
 		return false;
	}
	
	
	/**
	 * Enter description here...
	 *
	 * @return Pipho_DeviceInfo
	 */
	public static function getDeviceInfo()
	{
	//	if (!self::isSupported())
	//		throw new Exception('Device not supprted ['.self::getUserAgent().']');
			
		$info	=	new Pipho_DeviceInfo();
		$info->thumbsSize		=	75;
		$info->slideMaxSize		=	480;
		return $info;
	}
	
	protected static function getUserAgent()
	{
		return strtolower( $_SERVER['HTTP_USER_AGENT']);
	}	
}
?>
Return current item: Pipho - iPhone optimized image gallery