Mobile 'Theme' Loading on MacBook Pro (?)

Rate this topic: Evaluations: 1, 1.00 on the average.Evaluations: 1, 1.00 on the average.Evaluations: 1, 1.00 on the average.Evaluations: 1, 1.00 on the average.Evaluations: 1, 1.00 on the average.Evaluations: 1, 1.00 on the average.1.00 out of 6 based on 1 vote(s)
GK User
Thu Nov 08, 2012 3:03 am
Reply with quote
Report this post
When I load my site on my MacBook Pro, using the Safari web browser, the mobile theme of the site is loading. Any idea why this would be? When I load the site using Safari on my Desktop PC the site loads fine.

Any help/ideas are appreciated.
Thanks!

http://www.thesearchers.org/
User avatar
Junior Boarder

GK User
Thu Nov 08, 2012 9:57 am
Reply with quote
Report this post
Hi,

Please change in the lib/framework/helper.layout.php file this fragment:

Code: Select all
// it is iPad, iPod or iPhone?
       $iPod = stripos($_SERVER['HTTP_USER_AGENT'],"iPod");
       $iPhone = stripos($_SERVER['HTTP_USER_AGENT'],"iPhone");
       $iPad = stripos($_SERVER['HTTP_USER_AGENT'],"iPad");
       
       
       //// set media query for the tablet.css
       if($iPod || $iPhone || $iPad) {
      $this->API->addCSS($this->API->URLtemplate() . '/css/tablet.css','text/css','only screen and (max-width: '.$tablet_width.'px), only screen and (max-device-width: '.$tablet_width.'px)');   
      } else {
         $this->API->addCSS($this->API->URLtemplate() . '/css/tablet.css','text/css','only screen and (max-width: '.$tablet_width.'px), only screen and (max-device-width: '.$tablet_width.'px) and (-moz-max-device-pixel-ratio: 1.5), only screen and (max-device-width: '.$tablet_width.'px) and (-o-max-device-pixel-ratio: 1.5/1), only screen  and (max-device-width: '.$tablet_width.'px) and (-webkit-max-device-pixel-ratio: 1.5), only screen and (max-device-width: '.$tablet_width.'px) and (max-device-pixel-ratio: 1.5), only screen and (max-device-width: '.($tablet_width * 2).'px) and (-moz-min-device-pixel-ratio: 2), only screen and (max-device-width: '.($tablet_width * 2).'px) and (-o-min-device-pixel-ratio: 2/1), only screen and (max-device-width: '.($tablet_width * 2).'px) and (-webkit-min-device-pixel-ratio: 2), only screen and (max-device-width: '.($tablet_width * 2).'px) and (min-device-pixel-ratio: 2)');
      }
      // set media query for the mobile.css
      if($iPod || $iPhone || $iPad) {
         $this->API->addCSS($this->API->URLtemplate() . '/css/mobile.css','text/css','
         only screen and (max-width: '.$mobile_width.'px), only screen and (max-device-width: '.$mobile_width.'px)');
      } else {
          $this->API->addCSS($this->API->URLtemplate() . '/css/mobile.css','text/css','
          only screen and (max-width: '.$mobile_width.'px),
          only screen and (max-device-width: '.$mobile_width.'px) and (-moz-max-device-pixel-ratio: 1.5),
          only screen and (max-device-width: '.$mobile_width.'px) and (-o-max-device-pixel-ratio: 1.5/1),
          only screen and (max-device-width: '.$mobile_width.'px) and (-webkit-max-device-pixel-ratio: 1.5),
          only screen and (max-device-width: '.$mobile_width.'px) and (max-device-pixel-ratio: 1.5),
          only screen and (max-device-width: '.($mobile_width * 2).'px) and (-webkit-min-device-pixel-ratio: 2),
          only screen and (max-device-width: '.($mobile_width * 2).'px) and (-moz-min-device-pixel-ratio: 2),
          only screen and (max-device-width: '.($mobile_width * 2).'px) and (-o-min-device-pixel-ratio: 2/1),
          only screen and (max-device-width: '.($mobile_width * 2).'px) and (min-device-pixel-ratio: 2)');
      }


to:
Code: Select all
// set media query for the tablet.css
$this->API->addCSS($this->API->URLtemplate() . '/css/tablet.css','text/css','(max-width: '.$tablet_width.'px)');   
// set media query for the mobile.css
$this->API->addCSS($this->API->URLtemplate() . '/css/mobile.css','text/css','(max-width: '.$mobile_width.'px)');
User avatar
Administrator


cron