Welcome to the MetaMod and Chameleon Support Forums.

Before posting, please check out the FAQs.

helpme

 

Need extra help with your Joomla site? Consider paid Joomla support by the developer of Chameleon and MetaMod.

 

[solved] Not switching for Android if Samsung s4 or HTC one

[solved] Not switching for Android if Samsung s4 or HTC one

Hi,
I am trying to show a module which contains a flash movie on Desktop but an html5 version of the movie on all mobile, tablet devices.

The issue is, it works fine for iphone etc however, when viewing on the newer Samsung and HTC phones / tablets, the switch is not being made. Those still try and show the Flash movie.

Here is my code (Please notice there is also a replay module)

if (!isset($_GET["replay"])) {
  session_start();
  $instance_name = "shown_module_1"; /* use a different name for each module that you want to show only once */
  if (!isset($_SESSION[$instance_name]) ||
      $_SESSION[$instance_name] == false) {
    $_SESSION[$instance_name] = true;
// detect iphones, ipods and ipads. You can stack several browsers together like this:
if ( $core_genius->check( "browsertype == iphone, ipod, ipad, android" ) ) return 97;

//by default return flash version
return 132;
  }

return 210;/* the module you want to display on the 2nd, 3rd... showing */
}

else {
// detect iphones, ipods and ipads. You can stack several browsers together like this:
if ( $core_genius->check( "browser_type == iphone, ipod, ipad, android" ) ) return 97;

//by default return flash version
return 132;}

Any help would be appreciated.

indivo
Beginner Modder
ranks
useravatar
Offline
6 Posts
Administrator has disabled public posting

Re: [solved] Not switching for Android if Samsung s4 or HTC one

Hi,

can you please help me to isolate why this is going on? At the top of your MetaMod PHP code can you please put the following:

echo "User agent: " . $_SERVER['HTTP_USER_AGENT'] . '<br>';

Then can you view this on the Samsung s4 and HTC phones and post the results of the user agent string? Then I can check that in the MetaMod browser detection code and see what's going on there.

Thanks,
Stephen

Stephen Brandon
MetaMod / Chameleon developer
If you use MetaMod or Chameleon, please post a rating and a review at the Joomla! Extensions Directory: Chameleon | MetaMod

metamodguy
useravatar
Offline
3329 Posts
User info in posts
Administrator has disabled public posting

Re: [solved] Not switching for Android if Samsung s4 or HTC one

From the S4:
Regular browser -
User agent: Mozilla/5.0 (Linux; Android 4.4.2; en-us; SAMSUNG SPH-L720 Build/KOT49H) AppleWebKit/537.36 (KHTML, like Gecko) Version/1.5 Chrome/28.0.1500.94 Mobile Safari/537.36

Chrome Browser on S4
User agent: Mozilla/5.0 (Linux; Android 4.4.2; SPH-L720 Build/KOT49H) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/35.0.1916.141 Mobile Safari/537.36

Here are the screen caps
http://williamslover.com/metascreens/screenshot1.png
http://williamslover.com/metascreens/screenshot2.png

Thanks for your help,
Bill

indivo
Beginner Modder
ranks
useravatar
Offline
6 Posts
Administrator has disabled public posting

Re: [solved] Not switching for Android if Samsung s4 or HTC one

Thanks, working on this now...

Stephen Brandon
MetaMod / Chameleon developer
If you use MetaMod or Chameleon, please post a rating and a review at the Joomla! Extensions Directory: Chameleon | MetaMod

metamodguy
useravatar
Offline
3329 Posts
User info in posts
Administrator has disabled public posting

Re: [solved] Not switching for Android if Samsung s4 or HTC one

Thanks Stephen

indivo
Beginner Modder
ranks
useravatar
Offline
6 Posts
Administrator has disabled public posting

Re: [solved] Not switching for Android if Samsung s4 or HTC one

I sent you an e-mail with a new version of MetaMod in it - did you get that?

Stephen Brandon
MetaMod / Chameleon developer
If you use MetaMod or Chameleon, please post a rating and a review at the Joomla! Extensions Directory: Chameleon | MetaMod

metamodguy
useravatar
Offline
3329 Posts
User info in posts
Administrator has disabled public posting

Re: [solved] Not switching for Android if Samsung s4 or HTC one

I did, trying now.
Will let you know.

Thanks again,
Bill

indivo
Beginner Modder
ranks
useravatar
Offline
6 Posts
Administrator has disabled public posting

Re: [solved] Not switching for Android if Samsung s4 or HTC one

Working great, appreciate your help!

indivo
Beginner Modder
ranks
useravatar
Offline
6 Posts
Administrator has disabled public posting

Board Info

Board Stats:
 
Total Topics:
1684
Total Polls:
6
Total Posts:
5940
Posts this week:
1
User Info:
 
Total Users:
5161
Newest User:
kbmgkey234q
Members Online:
0
Guests Online:
134

Online: 
There are no members online

Forum Legend:

 Topic
 New
 Locked
 Sticky
 Active
 New/Active
 New/Locked
 New Sticky
 Locked/Active
 Active/Sticky
 Sticky/Locked
 Sticky/Active/Locked