Example #1
0
 function antiIE() {
    $browser = _get_browser();
    if($browser[browser] == "MSIE") {
       //die("<img src=\"".IMAGES_URL."cuma_firefox.gif\" alt=\"Gunakan Firefox, Skarang!\" />");
       die("Maaf, Sistem Informasi Ini tidak didukung oleh Internet Explorer.<br />Sistem Informasi akan berjalan sempurna dengan Firefox!<br />Download Firefox untuk :<br /><a href=\"".
          URL."Firefox.5.0.1.exe\">windows</a><br /><a href=\"".URL.
          "firefox/firefox-1.5.0.2.tar.gz\">Linux</a>");
    }
 }
Example #2
0
function add_globals($namespace = 'custom')
{
    global $rs;
    $rs["{$namespace}_html_validation"] = 'http://validator.w3.org/check?' . htmlentities(http_build_query(array('doctype' => 'HTML5', 'charset' => 'detect automatically', 'uri' => ''))) . str_replace('http://', '', FULLURL);
    $rs["{$namespace}_css_validation"] = 'http://jigsaw.w3.org/css-validator/validator?' . htmlentities(http_build_query(array('profile' => 'css3', 'warning' => 0, 'uri' => str_replace('http://', '', FULLURL)))) . str_replace('http://', '', FULLURL);
    $rs["{$namespace}_full_url"] = FULLURL;
    $info = _get_browser();
    $rs["{$namespace}_browser"] = strtolower($info['browser']);
    $rs["{$namespace}_browser_and_version"] = strtolower($info['browser']) . $info['majorVersion'];
    $rs["{$namespace}_browser_platform"] = strtolower($info['platform']);
    $rs["{$namespace}_cache_expires"] = gmdate('D, d M Y H:i:s', mktime(0, 0, 0, date('m') + 1, 0, date('y'))) . ' GMT';
    $rs["{$namespace}_current_year"] = date('Y');
}
Example #3
0
 /**
  * @param string user agent string
  * @return array
  **/
 public function stat_getAgent($ua)
 {
     if (function_exists('_get_browser')) {
         $_get_browser_results = _get_browser();
         $browser = array('browser' => $_get_browser_results['browser'], 'platform' => $_get_browser_results['platform']);
         return $browser;
     }
     $browser['platform'] = "Indeterminable";
     $browser['browser'] = "Indeterminable";
     // test for platform
     $platforms = array('Windows' => 'Win', 'Macintosh' => 'Mac', 'Linux' => 'Linux');
     foreach ($platforms as $key => $test) {
         if (strpos($ua, $test) !== false) {
             $browser['platform'] = $key;
         }
     }
     // add AppleWebkit
     $browsers = array(array('Netscape', 'Mozilla/4', 'Mozilla/([[:digit:]\\.]+)'), array('Mozilla', 'Mozilla/5', 'rv(:| )([[:digit:]\\.]+)'), array('Safari', 'Safari', 'Safari/([[:digit:]\\.]+)'), array('Firefox', 'Firefox', 'Firefox/([[:digit:]\\.]+)'), array('Netscape', 'Netscape', 'Netscape[0-9]?/([[:digit:]\\.]+)'), array('Internet Explorer', 'MSIE', 'MSIE ([[:digit:]\\.]+)'), array('Crawler/Search Engine', 'Crawl', 'stop'), array('Crawler/Search Engine', 'bot', 'stop'), array('Crawler/Search Engine', 'slurp', 'stop'), array('Lynx', 'Lynx', 'Lynx/([[:digit:]\\.]+)'), array('Links', 'Links', '\\(([[:digit:]\\.]+)'));
     foreach ($browsers as $test) {
         if (strpos($ua, $test[1]) !== false) {
             $browser['browser'] = $test[0];
         }
     }
     return $browser;
 }
function smarty_function_flash($params, &$smarty)
{  
    $file = 'aa';
    $f_params = '';
    $debug = false;
    $basedir = isset($server_vars['DOCUMENT_ROOT']) ? $server_vars['DOCUMENT_ROOT'] : '';
    
    foreach($params as $_key => $_val) {
        switch($_key) {
            case 'file': $file = $_val; break;
            case 'width': $height = $_val; break;
            case 'height': $width = $_val; break;
            case 'extra': $f_params = $_val; break;
            case 'debug': $debug = $_val; break;
        }
    }

    if (empty($file)) {
        $smarty->trigger_error("flash: missing 'file' parameter", E_USER_NOTICE);
        return;        
    }


        if(!$sizes = @getimagesize($file)) {
            if(!file_exists($file)) {
                if ( $debug ) { $smarty->trigger_error("flash: unable to find '$file'", E_USER_NOTICE);	}
                return;
            } else if(!is_readable($file)) {
                if ( $debug ) { $smarty->trigger_error("flash: unable to read '$file'", E_USER_NOTICE); }
                return;
            } else {
                if ( $debug ) { $smarty->trigger_error("flash: '$file' is not a valid image file", E_USER_NOTICE); }
                return;
            }
        }

    if ( !isset($width) ) {
    	$width = $sizes[0];
    }

    if ( !isset($height) ) {
    	$height = $sizes[1];
    }

    if ( !isset($GLOBALS['smarty_flash_id']) ) {
    	$GLOBALS['smarty_flash_id'] = 0;
    }
    else {
    	$GLOBALS['smarty_flash_id']++;
    }

    $browser = _get_browser();
    if ( $browser['browser'] == 'MSIE' ) {
    	$flash_code='
<object type="application/x-shockwave-flash" width="'.$width.'" height="'.$height.'" id="smarty_flash'.$GLOBALS['smarty_flash_id'].'">
  <param name="movie" value="'.$file.'" />
  <param name="quality" value="high" />
  '.$f_params.'
</object>
<script language="javascript" type="text/javascript">
    show_flash(\'smarty_flash'.$GLOBALS['smarty_flash_id'].'\');
</script>
        ';
    }
    else {
    	$flash_code='
<object type="application/x-shockwave-flash" data="'.$file.'" width="'.$width.'" height="'.$height.'">
  <param name="quality" value="high" />
  '.$f_params.'
</object>
        ';    	
    }

    return $flash_code;
}