Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#11 2011-03-31 18:01:31

maruchan
Member
From: Ukiah, California
Registered: 2010-06-12
Posts: 585
Website

Re: adi_mobile - Mobile browser detection

Ah. Yes, there’s a SLIR option for specifying image quality, if that’s what you mean.

Offline

#12 2011-03-31 18:16:52

zero
Member
From: Lancashire
Registered: 2004-04-19
Posts: 1,379
Website

Re: adi_mobile - Mobile browser detection

I’ve been checking and I can’t see any difference at all between smd_thumbnail and SLIR wrt the quality of image they produce. Although I can see an advantage for SLIR for delivering site design images, how do you go about delivering article images that are always changing? Inserting a txp tag into the SLIR path doesn’t work, or have you found a way round this?


Wondrous Healing Wondrous ways to a healthy old age
Safe Reiki Harmless natural healing.
Gud One Blog

Offline

#13 2011-03-31 18:26:03

maruchan
Member
From: Ukiah, California
Registered: 2010-06-12
Posts: 585
Website

Re: adi_mobile - Mobile browser detection

<img src="/slir/w282/<txp:image_url/>" alt='<txp:image_info type="alt"/>' />

That’s from a site where I’m using it now.

Offline

#14 2011-03-31 19:59:33

zero
Member
From: Lancashire
Registered: 2004-04-19
Posts: 1,379
Website

Re: adi_mobile - Mobile browser detection

Well, it’s all working fine and SLIR has more options than smd_thumbnail and Joe Lencioni seems very helpful on the forum, so it looks a good partner for adi_mobile :-) I found this which has a way to get nice URLs for the images and wondered if it was necessary or desirable?


Wondrous Healing Wondrous ways to a healthy old age
Safe Reiki Harmless natural healing.
Gud One Blog

Offline

#15 2011-03-31 20:46:18

maruchan
Member
From: Ukiah, California
Registered: 2010-06-12
Posts: 585
Website

Re: adi_mobile - Mobile browser detection

Looks like the fancy URLs make the code a bit more readable, maybe even easier to remember.

I don’t understand what the point of specifying both parameters like 100×100/1:1 would be though… :-/

Offline

#16 2011-03-31 21:25:41

zero
Member
From: Lancashire
Registered: 2004-04-19
Posts: 1,379
Website

Re: adi_mobile - Mobile browser detection

I’ve never seen urls like the SLIR ones before, but they’re easy enough to understand, so I think I’ll stick with them. You can’t really live without smd plugins though – smd_thumbnail is easier to use if wanting to replace resized images with higher quality images ones. A site I’m working on doesn’t need such high quality so I’ll use SLIR. I also need smd_if because I wanted to cater for 4 viewpoint widths and adi_mobile just has ‘narrow’ and ‘wide’ settings, so the inbetween bit has to be split into 2. Much too daunting for my brain, but Adi very kindly showed me how to do it with smd_if. Someone might find it useful and it brings this thread back on topic, so here it is:

EDIT: I removed the <txp:image_info type="h" /> (and “w”) because I just realised it brings the size of the original image. So now I’m wondering how to use SLIR and put the sizes in when I don’t know them, as pictures have varying widths and heights.

<txp:images break="">
  <txp:adi_if_mobile width="narrow">
    <img src="/slir/w320-q100/<txp:image_url/>" alt="<txp:image_info type="alt"/>" />

<txp:else />

  <txp:adi_if_mobile width="wide">
    <img src="/slir/w480-q100/<txp:image_url/>" alt="<txp:image_info type="alt"/>" />

<txp:else />

  <txp:smd_if field="txpvar:adi_mobile_width" operator="lt" value="768">
    <img src="/slir/w360-q100/<txp:image_url/>" alt="<txp:image_info type="alt"/>" />

<txp:else />

    <img src="/slir/w480-q100/<txp:image_url/>" alt="<txp:image_info type="alt"/>" />

       </txp:smd_if>
    </txp:adi_if_mobile>
  </txp:adi_if_mobile>
</txp:images>

Last edited by zero (2011-03-31 21:44:37)


Wondrous Healing Wondrous ways to a healthy old age
Safe Reiki Harmless natural healing.
Gud One Blog

Offline

#17 2011-10-27 20:09:14

hallstu
Member
From: UK
Registered: 2006-04-18
Posts: 16

Re: adi_mobile - Mobile browser detection

Hi, I’ve asked this question a couple of times but keep asking in the wrong place…

Basically I can’t seem to get this plugin to work (or, in fact, pro_mobile or act_if_mobile) on an Android phone or an iPad. Since they are my only mobile devices I’m assuming the code I’ve used isn’t working. Of course it’s more than likely I just haven’t implemented correctly, but the ‘mobiletest’ demo on the website also shows the ‘You’re not a mobile’ message as well. When viewed on an iPhone it displays as I’d expect and states the viewport etc.

Anyone know of any issues with mobile detection with Android or iPads? Seems odd none of the plugins I’ve tried, or the demos, work.

Thanks again…

Offline

#18 2011-10-27 20:32:06

gomedia
Plugin Author
Registered: 2008-06-01
Posts: 1,265
Website

Re: adi_mobile - Mobile browser detection

Hi Stu,

adi_mobile should pick up Android devices – at least it does when I test it using an Android emulator. WRT to iPads, adi_mobile determines that they’re not mobiles deliberately – because they have big screens & can display normal websites properly. You have to target iPads explicitly if you want to deliver different content for them.

Try using <txp:adi_mobile debug="1" /> and send me the output.

Offline

#19 2011-10-27 21:39:23

hallstu
Member
From: UK
Registered: 2006-04-18
Posts: 16

Re: adi_mobile - Mobile browser detection

Hi Adi thanks for the quick response.

Yeah I thought that may be the case with the iPad; I should have clarified that I targeted it using <txp:adi_if_mobile type="ipad">, though that may not be the correct way.

The output from the debug code is below.

Firefox Windows 7:

USER AGENT

Mozilla/5.0 (Windows NT 6.1; rv:2.0.1) Gecko/20100101 Firefox/4.0.1

ADI_MOBILE GLOBALS

array (

‘isMobile’ => false, ‘isAndroid’ => false, ‘isBlackberry’ => false, ‘isOpera’ => false, ‘isPalm’ => false, ‘isWindows’ => false, ‘isGeneric’ => false, ‘isIphone’ => false, ‘isIpad’ => false, )

—————————

Safari iPad:

USER AGENT

Mozilla/5.0 (iPad; CPU OS 5_0 like Mac OS X) AppleWebKit/534.46 (KHTML, like Gecko) Version/5.1 Mobile/9A334 Safari/7534.48.3

ADI_MOBILE GLOBALS

array (

‘isMobile’ => false, ‘isAndroid’ => false, ‘isBlackberry’ => false, ‘isOpera’ => false, ‘isPalm’ => false, ‘isWindows’ => false, ‘isGeneric’ => false, ‘isIphone’ => false, ‘isIpad’ => true, )

—————————

Android HTC Desire HD:

USER AGENT

Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_3; en-us) AppleWebKit/533.16 (KHTML, like Gecko) Version/5.0 Safari/533.16

ADI_MOBILE GLOBALS

array (

‘isMobile’ => false, ‘isAndroid’ => false, ‘isBlackberry’ => false, ‘isOpera’ => false, ‘isPalm’ => false, ‘isWindows’ => false, ‘isGeneric’ => false, ‘isIphone’ => false, ‘isIpad’ => false, )

So it looks like the iPad is being recognised, just the code isn’t being delivered (though that could be my implementation), but Android not being recognised at all. I also tried <txp:adi_if_mobile type="android">.

Thanks

Offline

#20 2011-10-27 22:02:16

gomedia
Plugin Author
Registered: 2008-06-01
Posts: 1,265
Website

Re: adi_mobile - Mobile browser detection

So when you connect to your website using the Android HTC Desire HD, it’s telling us it’s a Mac running Snow Leopard? Do what?

WRT targetting the iPad it’s an issue I’ve come across recently. I’ll get you a beta to try.

Offline

Board footer

Powered by FluxBB