Hi,

mobile_tools.module has the follow line in the code

    case (eregi('ipod', $user_agent)||eregi('iphone', $user_agent)); // we find the words iphone or ipod in the user agent
      $mobile_browser = $iphone; // mobile browser is either TRUE or FALSE depending on the setting of iphone when calling the function
      if (substr($iphone, 0, 4)=='http') { // does the value of iphone resemble a url
        $mobileredirect = $iphone; // set the mobile redirect url to the url value stored in the iphone value
      } // ends the if for iphone being a url
    break; // break out and skip the rest if we've had a match on the iphone or ipod
    case (eregi('android',$user_agent));  // we find android in the user agent
      $mobile_browser = $android; // mobile browser is either TRUE or FALSE depending on the setting of android when calling the function
      if (substr($android, 0, 4)=='http') { // does the value of android resemble a url
        $mobileredirect = $android; // set the mobile redirect url to the url value stored in the android value
      } // ends the if for android being a url
    break; // break out and skip the rest if we've had a match on android

Unfortunatly neither $android nor $iphone are set so nothing happens with those phones...

Comments

twom’s picture

I'll try make this configurable in a next version.
The question is what you want to do with these variables?

e.g. :
- configure different behavior for iphone and androids then for other handset? (this becomes more complex then needed.)
- treat iphone and/or androids as desktop browsers? (I'll implement this)

any suggestions?

PGiro’s picture

Errr... well, I'm not trying to do anything with those variables, they were there when I downloaded the module :) So the question is what did you intend to do with them ?

As far as I'm concerned, I do not treat android/iphone as desktop phones, more like their own breed of devices since they are very different from both WAP devices and desktop devices.

So my suggestion would be to treat that big switch statement with a config
i) group phones into groups using rules (the ones you provide look sufficient to me)
ii) assign themes to phone groups

That way I could do
- android => theme 1
- iphone => theme 2
- all others mobile phones => WAP theme
- everything => web theme

My 2 cents...

twom’s picture

To be honest, I took some non-licensed code and tested that. The code had some swiches for iphone and android with the purpose of treating them as non-mobile device, because of their high capabilities.

I like the idea of assigning different themes to different groups of phones.

I'll take a look at this.

I just released a new WURFL module (http://drupal.org/project/wurfl). I'll try to integrate this module also in the game.

twom’s picture

Status: Active » Fixed

I see now that I misunderstood your question a bit :)
I fixed the code, now $mobile_browser is set to TRUE in all cases.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.