Grea extension. Seriously.
But I had a problem after upgrading to 1.38.2 from 1.37.x. This just didn't work when I used this code provided in the instructions.
wfLoadExtension( 'MobileDetect' );
$mobile = wfMobileDetect();
if ( $mobile ) {
$wgDefaultSkin = "chick"; # If mobile
} else {
$wgDefaultSkin = "vector"; # If not mobile
}
But when I use the beta code I was using before the upgrade...
$mobile = mobiledetect();
if ( $mobile === true ) {
$wgDefaultSkin = "chick"; # If mobile
} else {
$wgDefaultSkin = "vector"; # If not mobile
}
...it works.
I also have to use
require_once "$IP/extensions/MobileDetect/MobileDetect.php";
because
wfLoadExtension( 'MobileFrontend' );
breaks the site.
What am I doing wrong?
I'm using version 2.1 (b50b1d0), which is the one that downloads for 1.38.