|
Cookbook /
DetectMobileSummary: Determines whether the browser is a mobile device.
Version: 31-Dec-2008 (2.0.1)
Prerequisites: None
Status: Active
Maintainer: DaveG
Download: detect_mobile.zipΔ
License: SHARED SOURCE LICENSE
Discussion: DetectMobile-Talk
DescriptionProvides a means of detecting whether the user browsing a wiki is using a mobile device. Can be used within PmWiki (or PHP in general) to either load mobile specific skins, or perform mobile related actions. Download and Installation
Warning: the script contains some long lines, so if you open it in a text editor, be sure not to save the files with word-wrap on.
include_once("$FarmD/cookbook/detect_mobile.php");
Using the ScriptSimply call the function from within PHP: detect_mobile_device(); For example, you might use it in
if(detect_mobile_device()) {
$Skin = 'skidoo/PDA';
} else {
$Skin = 'skidoo';
}
Optional ParametersThe function has five parameters that can be passed to it which define the way it handles different scenarios. These parameters are:
Known Issues
Change Log31-Dec-2008 (2.0.1)Contributors: DaveG
30-Dec-2008 (2.0.0)Contributors: DaveG
7-Oct-2007 (1.0.0)Contributors: DaveG
Credit
User notes: If you use, used or reviewed this recipe, you can add your name. The following format is recognized:
* (+) Optional positive comment. Name, date * (-) Optional negative comment. Name, date These statistics appear in the Cookbook listings and will help newcomers browsing through the wiki. |