<?xml version="1.0"?>
<rss version="2.0">
	<channel>
		<title>Page comments</title>
		<link>http://www.ssbits.com/home/</link>
		

		
		<item>
			<title>Comment by 'tiffany Earrings' on Detecting Mobile Browsers to Re-Theme Your Site</title>
			<link>http://www.ssbits.com/detecting-mobile-browsers-to-re-theme-your-site/#PageComment_811</link>
			<description>
I was just doing some web browsing on my Garmin Phone during my break at my work place, and I came across something I thought was interesting . It linked over to your website so I clicked over. I can’t really find the relevance between your site and the one I came from, but your site good none the less.thanks for sharing thoes  informations , It is interesting, i like it!</description>
			<pubDate>Wed, 18 Aug 2010 00:23:49 -0500</pubDate>
			<author>tiffany Earrings</author>
			<guid>http://www.ssbits.com/detecting-mobile-browsers-to-re-theme-your-site/#PageComment_811</guid>
		</item>
		
		<item>
			<title>Comment by 'Anatol' on Detecting Mobile Browsers to Re-Theme Your Site</title>
			<link>http://www.ssbits.com/detecting-mobile-browsers-to-re-theme-your-site/#PageComment_800</link>
			<description>Hi,

thank you! This post helped a lot! I used the same class in a previous project but in a much more complicated way. This works better.

One thing you should mention because it's crucial to make the class work properly is that when you rename the class from uagent_info to uagentinfo you also need to rename the constructor, i.e. rename

function uagent_info() to
function uagentinfo()

If not the class will never detect any mobile device because it won't read the user agent string.

This is the way I use the class: Instead of creating an entirely new theme I simply apply a different CSS file for e.g. smartphones. I just added a method to /mysite/code/Page.php to the Page class:

function isSmartPhone() {
	$uagent = new uagentinfo();
	return $uagent-&gt;DetectSmartphone();
}

I can call this from the template, e.g.:

&lt;% if isSmartPhone %&gt;
	&lt;link rel=&quot;stylesheet&quot; type&quot;text/css&quot;  media=&quot;screen,handheld&quot; href=&quot;http://www.ssbits.com/css/mobile.css&quot; /&gt;
&lt;% else %&gt;
	&lt;link rel=&quot;stylesheet&quot; type=&quot;text/css&quot; media=&quot;screen,projection,tv&quot; href=&quot;http://www.ssbits.com/css/layout.css&quot; /&gt;
	&lt;link rel=&quot;stylesheet&quot; type=&quot;text/css&quot; media=&quot;handheld&quot; href=&quot;http://www.ssbits.com/css/mobile.css&quot; /&gt;
&lt;% end_if %&gt;

Thanks for your post, Richard. It's very useful.

Cheers!
Anatol</description>
			<pubDate>Sat, 14 Aug 2010 03:43:01 -0500</pubDate>
			<author>Anatol</author>
			<guid>http://www.ssbits.com/detecting-mobile-browsers-to-re-theme-your-site/#PageComment_800</guid>
		</item>
		
		<item>
			<title>Comment by 'replica bags' on Detecting Mobile Browsers to Re-Theme Your Site</title>
			<link>http://www.ssbits.com/detecting-mobile-browsers-to-re-theme-your-site/#PageComment_762</link>
			<description>This looks great but when you try to download the top link its an empty file. </description>
			<pubDate>Mon, 02 Aug 2010 03:47:41 -0500</pubDate>
			<author>replica bags</author>
			<guid>http://www.ssbits.com/detecting-mobile-browsers-to-re-theme-your-site/#PageComment_762</guid>
		</item>
		
		<item>
			<title>Comment by 'Nic' on Detecting Mobile Browsers to Re-Theme Your Site</title>
			<link>http://www.ssbits.com/detecting-mobile-browsers-to-re-theme-your-site/#PageComment_748</link>
			<description>Really nice! Can't wait to try it out... anyone have a working example? Would love to see it in action before I start playing with it.</description>
			<pubDate>Mon, 19 Jul 2010 13:53:39 -0500</pubDate>
			<author>Nic</author>
			<guid>http://www.ssbits.com/detecting-mobile-browsers-to-re-theme-your-site/#PageComment_748</guid>
		</item>
		
		<item>
			<title>Comment by 'Marc Jansen' on Detecting Mobile Browsers to Re-Theme Your Site</title>
			<link>http://www.ssbits.com/detecting-mobile-browsers-to-re-theme-your-site/#PageComment_670</link>
			<description>Amazing !! This solves the problem with multiple themes. Thanks a billion. Was trying to figure it out by myself. But was getting nowhere. I will try to delevope a page where it actually works and post it here. Silverstripe is definitly becoming a powerful CMS. And with your help it even gets strong.

with many kind regard from Germany 

Marc</description>
			<pubDate>Sat, 22 May 2010 06:16:39 -0500</pubDate>
			<author>Marc Jansen</author>
			<guid>http://www.ssbits.com/detecting-mobile-browsers-to-re-theme-your-site/#PageComment_670</guid>
		</item>
		
		<item>
			<title>Comment by 'Jeroen' on Detecting Mobile Browsers to Re-Theme Your Site</title>
			<link>http://www.ssbits.com/detecting-mobile-browsers-to-re-theme-your-site/#PageComment_605</link>
			<description>There is a typo in a part of your code. 
case &quot;iphone&quot;:

it should be 
case &quot;iPhone&quot;; instead. 

Anyway, this code is great and works fine! Thanks!</description>
			<pubDate>Tue, 23 Mar 2010 06:04:20 -0500</pubDate>
			<author>Jeroen</author>
			<guid>http://www.ssbits.com/detecting-mobile-browsers-to-re-theme-your-site/#PageComment_605</guid>
		</item>
		
		<item>
			<title>Comment by 'Don' on Detecting Mobile Browsers to Re-Theme Your Site</title>
			<link>http://www.ssbits.com/detecting-mobile-browsers-to-re-theme-your-site/#PageComment_493</link>
			<description>has anyone tried any of the web services out there like atlas or handsetdetection.com? Can anyone recommend any?</description>
			<pubDate>Mon, 30 Nov 2009 18:34:21 -0600</pubDate>
			<author>Don</author>
			<guid>http://www.ssbits.com/detecting-mobile-browsers-to-re-theme-your-site/#PageComment_493</guid>
		</item>
		
		<item>
			<title>Comment by 'software development Surrey' on Detecting Mobile Browsers to Re-Theme Your Site</title>
			<link>http://www.ssbits.com/detecting-mobile-browsers-to-re-theme-your-site/#PageComment_492</link>
			<description>Hey, that was interesting,

This is a great idea,

Keep up the good work,

Thanks for writing, most people don't bother.</description>
			<pubDate>Mon, 30 Nov 2009 07:03:12 -0600</pubDate>
			<author>software development Surrey</author>
			<guid>http://www.ssbits.com/detecting-mobile-browsers-to-re-theme-your-site/#PageComment_492</guid>
		</item>
		
		<item>
			<title>Comment by 'Aram' on Detecting Mobile Browsers to Re-Theme Your Site</title>
			<link>http://www.ssbits.com/detecting-mobile-browsers-to-re-theme-your-site/#PageComment_483</link>
			<description>Hi Bezerk, thanks for pointing that out, I have replaced the file with a zip that should work now :)

Aram</description>
			<pubDate>Mon, 23 Nov 2009 21:08:21 -0600</pubDate>
			<author>Aram</author>
			<guid>http://www.ssbits.com/detecting-mobile-browsers-to-re-theme-your-site/#PageComment_483</guid>
		</item>
		
		<item>
			<title>Comment by 'Berzerk Development' on Detecting Mobile Browsers to Re-Theme Your Site</title>
			<link>http://www.ssbits.com/detecting-mobile-browsers-to-re-theme-your-site/#PageComment_482</link>
			<description>This looks great but when you try to download the top link its an empty file.  Could you please fix the link?</description>
			<pubDate>Sun, 22 Nov 2009 20:12:11 -0600</pubDate>
			<author>Berzerk Development</author>
			<guid>http://www.ssbits.com/detecting-mobile-browsers-to-re-theme-your-site/#PageComment_482</guid>
		</item>
		

	</channel>
</rss>
