How to load a different skin for a mobile device (smartphone)?

Special forum to share and discuss skins for Pano2VR and Object2VR
Post Reply
Alain
Posts: 46
Joined: Tue Apr 02, 2013 12:08 pm

Hi

How can I load a different skin for a mobile device ?
I've read this instruction, but this detects "only" iPad (tablet) and iPhone (smartphone).

Is there a way to detect any mobile device (but no tablets and desktopcomputers) ?
I found this code, but I don't know mutch enough about implementing php-code into html.
Maybe some of you does know how to implement it ?


Kind regards
Alain
User avatar
Hopki
Gnome
Posts: 13037
Joined: Thu Jan 10, 2008 3:16 pm
Location: Layer de la Haye, Essex UK
Contact:

Hi Alain,
Version 5 has the logic trigger: is Mobile.
This detects iOS and Android.
So for say the directional buttons you can select them all then under the visibility logic block set:

is Mobile = true => Visible: False

Regards,
Hopki
Garden Gnome Support
If you send an e-mail to support please send a link to the forum post for reference.
support@ggnome.com
https://ggnome.com/wiki/documentation/
Alain
Posts: 46
Joined: Tue Apr 02, 2013 12:08 pm

Hi Hopki

Is there a way to do this with version 4.5 ?

Regards,
Alain
User avatar
Hopki
Gnome
Posts: 13037
Joined: Thu Jan 10, 2008 3:16 pm
Location: Layer de la Haye, Essex UK
Contact:

If your hosting is PHP enabled then you can look at this little trick.
Please see the TIP.
Regards,
Hopki
Garden Gnome Support
If you send an e-mail to support please send a link to the forum post for reference.
support@ggnome.com
https://ggnome.com/wiki/documentation/
Alain
Posts: 46
Joined: Tue Apr 02, 2013 12:08 pm

But this detects only Appledevices like iPad and iPhone/iPod.
What I want is to detect any Smartphone (Androidphones, Windowsphones or Applesmartphones).

Is there a trick to do this for Pano2VR 4.5 ?

Kind regards
Alain
CBosch
Posts: 240
Joined: Fri May 23, 2014 11:52 am

You can add any kind of HTTP_USER_AGENT. With google you find all possible user-agents for Android, windows, Apple and you can select what you want

Code: Select all

if ((strpos($_SERVER['HTTP_USER_AGENT'],"iPhone")) || (strpos($_SERVER['HTTP_USER_AGENT'],"iPod"))) 
can be adapted with:

Code: Select all

 || (strpos($_SERVER['HTTP_USER_AGENT'],"HereWhatYouWantToDetect"))
You can add as many as you want.
Have a nice day

Christian
Alain
Posts: 46
Joined: Tue Apr 02, 2013 12:08 pm

Thanks Christian, that's what I wanted to know ;-)

Kind regards
Alain
Post Reply