function fp_screen_is_mobile

6.x fp_screen_is_mobile()
7.x fp_screen_is_mobile()
4.x fp_screen_is_mobile()
5.x fp_screen_is_mobile()

This function will attempt to determine automatically if we are on a mobile device, and should therefor use the mobile theme and layout settings.

1 call to fp_screen_is_mobile()


includes/, line 2314
This file contains misc functions for FlightPath


function fp_screen_is_mobile() {

  depricated_message("calling fp_screen_is_mobile is no longer used in FP6");

  if (isset($GLOBALS ["fp_page_is_mobile"])) {
    return $GLOBALS ["fp_page_is_mobile"];

  $user_agent = $_SERVER ['HTTP_USER_AGENT'];

  $look_for = array(
    "opera mini",
    "(pre\/|palm os|palm|hiptop|avantgo|plucker|xiino|blazer|elaine)",
    "(iris|3g_t|windows ce|opera mobi|windows ce; smartphone;|windows ce; iemobile)",

  $is_mobile = FALSE;

  foreach ($look_for as $test_agent) {
    if (preg_match('/' . $test_agent . '/i', $user_agent)) {
      $is_mobile = TRUE;

  $GLOBALS ["fp_page_is_mobile"] = $is_mobile;
  return $is_mobile;