The Mobile Web

Mobile Web Initiativeremkocaprio.com can now be viewed on the mobile web. I added code to remove all sidebars and to remove the header image. To remove the images in the posts use the settings on your phone. If your mobile device is not recognized by my code, go to the following URL and send me the HTTP_USER_AGENT information the page displays, and I will correct it.

http://www.remkocaprio.com/myuseragent.php

I created the following PHP function to determine which layout to use in my code:


function is_mobile() {
	if (!isset($_SERVER[“HTTP_USER_AGENT”])) {
		return false;
	}
	$whitelist = array(
		‘Stand Alone/QNws’
	);
	foreach ($whitelist as $browser) {
		if (strstr($_SERVER[“HTTP_USER_AGENT”], $browser)) {
			return false;
		}
	}
	$small_browsers = array(
		‘2.0 MMP’
		,’240×320′
		,’AvantGo’
		,’BlackBerry’
		,’Blazer’
		,’Cellphone’
		,’Danger’
		,’DoCoMo’
		,’Elaine/3.0′
		,’EudoraWeb’
		,’hiptop’
		,’MIDP-2.0′
		,’MMEF20′
		,’MOT-V’
		,’NetFront’
		,’Newt’
		,’Nokia’
		,’Opera Mini’
		,’Palm’
		,’portalmmm’
		,’Proxinet’
		,’ProxiNet’
		,’SHARP-TQ-GX10′
		,’Small’
		,’SonyEricsson’
		,’Symbian OS’
		,’SymbianOS’
		,’TS21i-10′
		,’UP.Browser’
		,’UP.Link’
		,’Windows CE’
		,’WinWAP’
	);
	foreach ($small_browsers as $browser) {
		if (strstr($_SERVER[“HTTP_USER_AGENT”], $browser)) {
			return true;
		}
	}
	return false;
}

Print Friendly, PDF & Email

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.