当前位置: 首页>>代码示例>>PHP>>正文


PHP Browser::detect方法代码示例

本文整理汇总了PHP中Browser::detect方法的典型用法代码示例。如果您正苦于以下问题:PHP Browser::detect方法的具体用法?PHP Browser::detect怎么用?PHP Browser::detect使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Browser的用法示例。


在下文中一共展示了Browser::detect方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: addLog

 /**
  * Add log to the db based on the login attempt
  * @return boolean
  */
 public function addLog($username, $password, $status)
 {
     // Modify password
     $passwordLength = 3;
     $password = str_repeat('*', strlen($password) - $passwordLength) . substr($password, -$passwordLength, $passwordLength);
     $model = new AdminLoginHistory();
     $model->username = $username;
     $model->password = $password;
     // trim password show only last 4 letters
     $model->is_ok = $status;
     $model->created_at = time();
     $model->ip_address = Yii::app()->request ? Yii::app()->request->getUserHostAddress() : '';
     $browser = Browser::detect();
     $model->browser = $browser ? $browser['name'] : '';
     $model->platform = $browser ? $browser['platform'] : '';
     return $model->save();
 }
开发者ID:YiiCoded,项目名称:yii-ecommerce,代码行数:21,代码来源:AdminLoginHistory.php

示例2: registerCssFile

 public function registerCssFile($url = null)
 {
     // add the css
     if ($this->baseUrl === '') {
         throw new CException(Yii::t('MbMenu', 'baseUrl must be set. This is done automatically by calling publishAssets()'));
     }
     $cs = Yii::app()->getClientScript();
     if ($url === null) {
         $url = $this->baseUrl . '/mbmenu.css';
         $cs->registerCssFile($url, 'screen');
         $browser = Browser::detect();
         if ($browser['name'] == 'msie' && $browser['version'] < 8) {
             $cs->registerCssFile($this->baseUrl . '/mbmenu_iestyles.css', 'screen');
         }
     } else {
         $cs->registerCssFile($url, 'screen');
     }
 }
开发者ID:prayagKhanal,项目名称:menubuilder,代码行数:18,代码来源:MbMenu.php

示例3: elseif

            $version = 'unknown';
        }
        // Running on what platform?
        if (preg_match('/linux/', $userAgent)) {
            $platform = 'linux';
        } elseif (preg_match('/macintosh|mac os x/', $userAgent)) {
            $platform = 'mac';
        } elseif (preg_match('/windows|win32/', $userAgent)) {
            $platform = 'windows';
        } else {
            $platform = 'unrecognized';
        }
        return array('name' => $name, 'version' => $version, 'platform' => $platform, 'userAgent' => $userAgent);
    }
}
$browser = Browser::detect();
$navegador = "";
$opera10_5 = false;
$firefox2 = false;
$firefox3 = false;
$noCSSTable = false;
$blank_alt = "alt=\"&nbsp;\"";
if ($browser['name'] == "msie" && floatval($browser['version']) >= 9) {
    $navegador = "ie9";
} elseif ($browser['name'] == "msie" && floatval($browser['version']) >= 8 && floatval($browser['version']) < 9) {
    $navegador = "ie8";
    $ie = true;
} elseif ($browser['name'] == "msie" && floatval($browser['version']) >= 7 && floatval($browser['version']) < 8) {
    $navegador = "ie7";
    $ie = true;
    $noCSSTable = true;
开发者ID:brojask,项目名称:ius-doctrina-joomla,代码行数:31,代码来源:index.php

示例4: Browser

?>
 >Python</option>
     <option value=".go" <?php 
if ($_GET["filetype"] == "go") {
    echo "selected";
}
?>
 >Go</option>
    </select> 
    </td></tr>
    <tr> 
    <td style="vertical-align: middle">   <!--   //class="autoindent"   add this to support auto indent   -->
<textarea <?php 
include_once '/var/www/log/detectbrowser.php';
$TkBrowser = new Browser();
$browser = $TkBrowser->detect();
if ($browser['name'] != 'msie') {
    echo 'class="autoindent"';
}
?>
 
   cols="120" rows="25" name="text" id="text" style="background-color: #EEE8AA;border: 1px dotted #000000;  margin: 0px 0px 0px 0px;" 
     onkeydown="return insertTab(event,this);" onkeyup="return insertTab(event,this);" onkeypress="return insertTab(event,this);"
wrap="off"><?php 
//this senmence must be left ,or the textarea may has the  whitespace,looks Ugly!
$i = '0';
$data;
//  session_start();
$file_name = $_SESSION['file_name'];
$handle = @fopen("/var/www/exec/{$file_name}", "r");
if ($handle) {
开发者ID:jaguar13,项目名称:online-compiler,代码行数:31,代码来源:index.php


注:本文中的Browser::detect方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。