Recent Changes - Search:

Cookbook

PmWiki

pmwiki.org

DetectMobile

Summary: Determines whether the browser is a mobile device.
Version: 7-Oct-2007 (1.0.0)
Prerequisites: None
Status: Active
Maintainer: DaveG
Categories: Mobile, PDA, Cookbook
License: SHARED SOURCE LICENSE

Description

Provides 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

  1. Download the script. (detect_mobile.zipΔ)
  2. Unzip it into your cookbook directory (usually pmwiki/cookbook/).
  3. Add the following to your local configuration file:
include_once("$FarmD/cookbook/detect_mobile.php");

Using the Script

Simply call the function from within PHP:

detect_mobile_device()

For example, you might use it in config.php to use a different skin if a mobile device is detected.

if(detect_mobile_device()) {
   $Skin = 'skidoo/PDA';
} else {
   $Skin = 'skidoo';
}

Known Issues

Also refer to the todo list for know issues that have a planned fix date.

  • None so far...

Change Log

Release Notes

  • 7-Oct-2007 (1.0.0) ''Contributors: DaveG

Credit

  • Mobile device detection is performed by the PHP script available from Andy Moore.

Comments

I'd love to know if you use this recipe -- edit this page and leave a comment below!

Edit - History - Print - Recent Changes - Search
Page last modified on October 07, 2007, at 02:54 PM