A small mod that uses the code from the MobileESP Project in order to detect if the user visiting your forum is using a mobile device or not.
At the moment in this mod this function is used to allow admins to select a default theme for mobile devices. Going to Admin > Configuration > Themes and Layout > Manage and Install a new dropdown is present where you will be able to select a theme for users with mobile devices.
Note: since the normal detection code would probably be too cumbersome for just define if a user is using a mobile device of not, I'm using a modified (untested in real world) version of the code and for that reason the detection could be not "perfect". Your feedback is highly appreciated!
The complete list of devices is too long to write here and now, look at the code. A short list includes: iPhone, iPad, iPod, Android-based, Symbian OS-based, windows 7 and ce based, blackberry and others.
Once instantiated the class is placed in $context['device'], so that other mods and themes can use the it in order to do change their behaviour depending on the device.
0.2.0: the theme is set based on the function CheckIsMobile (provided by feline and just changed a bit), fixed an undefined index error, few other things. The code from Mobile EPS is still the re if anyone wants to use it.
0.2.1: removed the __contruct function from the class to avoid php errors (Redefining already defined constructor)
0.2.2: removed "tablet" because too generic; added word boundary to the regexp (thanks feline)
You have to register or login to be able to leave a review
There are currently no reviews on this customization