Location: PHPKode > scripts > TinyWebGallery > tinywebgallery/inc/setbrowser.inc.php
<?php
/*************************
  Copyright (c) 2004-2010 TinyWebGallery
  written by Michael Dempfle
 
  This program is free software; you can redistribute it and/or modify 
  it under the terms of the TinyWebGallery license (based on the GNU  
  General Public License as published by the Free Software Foundation;  
  either version 2 of the License, or (at your option) any later version. 
  See license.txt for details.
 
  TWG version: 1.8
 
  $Date: 2009-06-17 22:57:10 +0200 (Mi, 17 Jun 2009) $
  $Revision: 73 $
**********************************************/

defined('_VALID_TWG') or die('Direct Access to this location is not allowed.');

$msie = true;
$opera = false;
$wii = false;
$isns = false;
$safari = false;
$iswindowsServer = false;
$isMac = false;
$opera7 = false;
$twg_mobile = false;

if (isset($_SERVER['HTTP_USER_AGENT'])) {

    $ua = strtolower($_SERVER['HTTP_USER_AGENT']);

    $msie = strstr($ua, 'msie');
	$opera = strstr($ua, 'opera');
	$isns = strstr($ua, 'mozilla') && (!(strstr($ua, 'compatible')));
	$safari = strstr($ua, 'safari');
	$wii = strstr($ua, 'wii');
	$iswindowsServer = stristr(PHP_OS, 'win');
	$iswindows = strstr($ua, 'win');
	$isMac = strstr($ua, 'mac');
	$opera7 = stristr($ua, 'opera/7');
    // we check if a mobile device is using TWG and we remove some stuff.
    $twg_mobile = strstr($ua, 'windows ce') || strstr($ua, 'iphone') || strstr($ua, 'symbian') || strstr($ua, 'opera mini')
               || strstr($ua, 'up.browser') || strstr($ua, 'opera mobi') || strstr($ua, 'blackberry') || strstr($ua, 'nokia')
               ||  strstr($ua, 'sonyericsson')  ||  strstr($ua, 'android') ;
    if ($twg_mobile) {
      $lowbandwidth=true;
      $icon_set = $icon_set_mobile;
    }
}

?>
Return current item: TinyWebGallery