<div dir="ltr"><div><div>True.....good point.....there is a whole lot more that needs to be done to make this snippit even worth while to be used. This was merely a demonstration of how to detect the OS and platforms. This class has the ability to detect browser info and versions. There are a lot more features that this one class can do to make your application more flexible. I think the original question was how to change the image sizes when displayed to a particular device. The "//Do Something" lines would represent that process.<br><br></div>This snippit would also be best served in a OO format, that way an instance of that session can be re-used throughout the entire application.<br><br><br></div>Michael<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Nov 20, 2014 at 2:38 PM, Kevin Fries <span dir="ltr"><<a href="mailto:kevin@fries-biro.com" target="_blank">kevin@fries-biro.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><p dir="ltr">I would add one thing to that skeleton. Add a link that sets a session variable $req_pc, default it to false. Allow a link that will set it true. Then, anywhere you detect like this, only do the detected behavior when $req_pc is false, otherwise send your default "pc" or "desktop" version.</p>
<p dir="ltr">Kevin</p>
<div class="gmail_quote">On Nov 20, 2014 1:22 PM, "Michael Torres" <<a href="mailto:matorres124@gmail.com" target="_blank">matorres124@gmail.com</a>> wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>Yep, pretty easy if you use php....<br><br>require_once 'Mobile_Detect.php';<br>$detect = new Mobile_Detect;<br><br></div>... you code here ...<br><div> <br>// Any mobile device (phones or tablets).<br>if ( $detect->isMobile() ) {<br> // Do Something<br>}<br> <br>// Any tablet device.<br>if( $detect->isTablet() ){<br> // Do Something<br>}<br> <br>// Exclude tablets.<br>if( $detect->isMobile() && !$detect->isTablet() ){<br> // Do Something<br>}<br> <br>// Check for a specific platform with the help of the magic methods:<br>if( $detect->isiOS() ){<br> // Do Something <br>}<br> <br>if( $detect->isAndroidOS() ){<br></div><div> // Do Something<br></div><div>}<br><br><br>... you code here ...</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Nov 20, 2014 at 1:15 PM, Eric Cope <span dir="ltr"><<a href="mailto:eric.cope@gmail.com" target="_blank">eric.cope@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Bootstrap handles it well, but you still have to implement it properly (think Portrait vs landscape, phone vs. Tablet). Its very difficult to do it properly...<div><br></div><div>Eric</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Nov 20, 2014 at 1:01 PM, Michael Torres <span dir="ltr"><<a href="mailto:matorres124@gmail.com" target="_blank">matorres124@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>If you are using PHP as your server side code, this is a good class that provides that functionality that I need to detect info about different platforms....<br><br><br><a href="http://mobiledetect.net/" target="_blank">http://mobiledetect.net/</a><br><br></div>Mike<br></div><div><div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Nov 20, 2014 at 12:56 PM, Kevin Fries <span dir="ltr"><<a href="mailto:kevin@fries-biro.com" target="_blank">kevin@fries-biro.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Be very careful with this "feature". I can not count the number of sites where they lost my business because it was not done well. Some of these sites will see "Android" or "iOS" and just assume its a phone. Then I hit it on my 10.2" tablet, and it looks stupid. Often, these sites are "auto detecting" and don't just default, so there is no way to ask for the regular site. When done well, its nice when the site is smart enough to offer a good default and also offer to not filter and deliver the regular HTML page. Also, make sure that if you do offer mobile, and you have a link to deliver the full page instead, that this option sticks as you move throughout the site. I have one utility pay site that f's up when I go to it with the tablet, but offers the "pc" page. Click on it, and it will fix the page you are on... click a link, and you are back to the "mobile" version... click on the "pc" link again, and it takes you back the the main page. If this was a business I had an option to not do business with (its our local utility and I am stuck with them), I wouldn't. So as I said, be careful and test, test, test</div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Nov 20, 2014 at 10:52 AM, <span dir="ltr"><<a href="mailto:joe@actionline.com" target="_blank">joe@actionline.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
Thanks Eric and Nathan!<br>
<br>
-----------<br>
> There are many frameworks which do what you want, namely<br>
> bootstrap or Foundation. I think ultimately what you want<br>
> is css @media queries. Do some digging on that and search<br>
> for detecting media type or screen size and displaying<br>
> a specific css for that device.<br>
<br>
-----------<br>
> Joe asked:<br>
>> Is there a way to set up an html page so that it will be<br>
>> displayed at one size on a mobile device, but then make all<br>
>> of the multiple small images that make up the html page scaled<br>
>> down to a different (much smaller) size on a desktop computer?<br>
<br>
<br>
<br>
---------------------------------------------------<br>
PLUG-discuss mailing list - <a href="mailto:PLUG-discuss@lists.phxlinux.org" target="_blank">PLUG-discuss@lists.phxlinux.org</a><br>
To subscribe, unsubscribe, or to change your mail settings:<br>
<a href="http://lists.phxlinux.org/mailman/listinfo/plug-discuss" target="_blank">http://lists.phxlinux.org/mailman/listinfo/plug-discuss</a><span><font color="#888888"><br>
</font></span></blockquote></div><span><font color="#888888"><br><br clear="all"><div><br></div>-- <br><div><div dir="ltr"><h1 style="margin:0px 0px 15px;color:rgb(24,24,24);font-weight:normal;padding:0px;font-size:14px;font-family:georgia,serif;line-height:18px">“Keep away from people who try to belittle your ambitions. Small people always do that, but the really great make you feel that you, too, can become great.”</h1><br style="color:rgb(24,24,24);font-family:georgia,serif;font-size:14px;line-height:18px"><span style="color:rgb(24,24,24);font-family:georgia,serif;font-size:14px;line-height:18px">― </span><a href="http://www.goodreads.com/author/show/1244.Mark_Twain" style="color:rgb(102,102,0);text-decoration:none;font-family:georgia,serif;font-size:14px;line-height:18px" target="_blank">Mark Twain</a><br></div></div>
</font></span></div>
<br>---------------------------------------------------<br>
PLUG-discuss mailing list - <a href="mailto:PLUG-discuss@lists.phxlinux.org" target="_blank">PLUG-discuss@lists.phxlinux.org</a><br>
To subscribe, unsubscribe, or to change your mail settings:<br>
<a href="http://lists.phxlinux.org/mailman/listinfo/plug-discuss" target="_blank">http://lists.phxlinux.org/mailman/listinfo/plug-discuss</a><br></blockquote></div><br></div>
</div></div><br>---------------------------------------------------<br>
PLUG-discuss mailing list - <a href="mailto:PLUG-discuss@lists.phxlinux.org" target="_blank">PLUG-discuss@lists.phxlinux.org</a><br>
To subscribe, unsubscribe, or to change your mail settings:<br>
<a href="http://lists.phxlinux.org/mailman/listinfo/plug-discuss" target="_blank">http://lists.phxlinux.org/mailman/listinfo/plug-discuss</a><br></blockquote></div><br></div>
<br>---------------------------------------------------<br>
PLUG-discuss mailing list - <a href="mailto:PLUG-discuss@lists.phxlinux.org" target="_blank">PLUG-discuss@lists.phxlinux.org</a><br>
To subscribe, unsubscribe, or to change your mail settings:<br>
<a href="http://lists.phxlinux.org/mailman/listinfo/plug-discuss" target="_blank">http://lists.phxlinux.org/mailman/listinfo/plug-discuss</a><br></blockquote></div><br></div>
<br>---------------------------------------------------<br>
PLUG-discuss mailing list - <a href="mailto:PLUG-discuss@lists.phxlinux.org" target="_blank">PLUG-discuss@lists.phxlinux.org</a><br>
To subscribe, unsubscribe, or to change your mail settings:<br>
<a href="http://lists.phxlinux.org/mailman/listinfo/plug-discuss" target="_blank">http://lists.phxlinux.org/mailman/listinfo/plug-discuss</a><br></blockquote></div>
<br>---------------------------------------------------<br>
PLUG-discuss mailing list - <a href="mailto:PLUG-discuss@lists.phxlinux.org">PLUG-discuss@lists.phxlinux.org</a><br>
To subscribe, unsubscribe, or to change your mail settings:<br>
<a href="http://lists.phxlinux.org/mailman/listinfo/plug-discuss" target="_blank">http://lists.phxlinux.org/mailman/listinfo/plug-discuss</a><br></blockquote></div><br></div>