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


PHP get_user_browser函数代码示例

本文整理汇总了PHP中get_user_browser函数的典型用法代码示例。如果您正苦于以下问题:PHP get_user_browser函数的具体用法?PHP get_user_browser怎么用?PHP get_user_browser使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


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

示例1: visit_stats

 /**
  * 统计访问信息
  *
  * @access  public
  * @return  void
  */
 function visit_stats()
 {
     if (C('visit_stats') == 'off') {
         return;
     }
     $time = gmtime();
     /* 检查客户端是否存在访问统计的cookie */
     $visit_times = !empty($_COOKIE['ECS']['visit_times']) ? intval($_COOKIE['ECS']['visit_times']) + 1 : 1;
     setcookie('ECS[visit_times]', $visit_times, $time + 86400 * 365, '/');
     $browser = get_user_browser();
     $os = get_os();
     $ip = real_ip();
     $area = ecs_geoip($ip);
     /* 语言 */
     if (!empty($_SERVER['HTTP_ACCEPT_LANGUAGE'])) {
         $pos = strpos($_SERVER['HTTP_ACCEPT_LANGUAGE'], ';');
         $lang = addslashes($pos !== false ? substr($_SERVER['HTTP_ACCEPT_LANGUAGE'], 0, $pos) : $_SERVER['HTTP_ACCEPT_LANGUAGE']);
     } else {
         $lang = '';
     }
     /* 来源 */
     if (!empty($_SERVER['HTTP_REFERER']) && strlen($_SERVER['HTTP_REFERER']) > 9) {
         $pos = strpos($_SERVER['HTTP_REFERER'], '/', 9);
         if ($pos !== false) {
             $domain = substr($_SERVER['HTTP_REFERER'], 0, $pos);
             $path = substr($_SERVER['HTTP_REFERER'], $pos);
             /* 来源关键字 */
             if (!empty($domain) && !empty($path)) {
                 save_searchengine_keyword($domain, $path);
             }
         } else {
             $domain = $path = '';
         }
     } else {
         $domain = $path = '';
     }
     $sql = 'INSERT INTO ' . $this->pre . 'stats ( ' . 'ip_address, visit_times, browser, system, language, area, ' . 'referer_domain, referer_path, access_url, access_time' . ') VALUES (' . "'{$ip}', '{$visit_times}', '{$browser}', '{$os}', '{$lang}', '{$area}', " . "'" . addslashes($domain) . "', '" . addslashes($path) . "', '" . addslashes(PHP_SELF) . "', '" . $time . "')";
     $this->query($sql);
 }
开发者ID:noikiy,项目名称:shop-3,代码行数:45,代码来源:CommonModel.class.php

示例2: elseif

    } elseif (preg_match('/Firefox/i', $u_agent)) {
        $ub = "firefox";
    } elseif (preg_match('/Safari/i', $u_agent)) {
        $ub = "safari";
    } elseif (preg_match('/Chrome/i', $u_agent)) {
        $ub = "chrome";
    } elseif (preg_match('/Flock/i', $u_agent)) {
        $ub = "flock";
    } elseif (preg_match('/Opera/i', $u_agent)) {
        $ub = "opera";
    }
    return $ub;
}
?>
    <?php 
$browser = get_user_browser();
if ($browser == "ie") {
    ?>
        <object height="81" width="40%"> <param name="movie" value="https://player.soundcloud.com/player.swf?url=http%3A%2F%2Fapi.soundcloud.com%2Ftracks%2F70191463?&amp;show_comments=false&amp;auto_play=true&amp;color=4f2170"></param> <param name="allowscriptaccess" value="always"></param> <embed allowscriptaccess="always" height="81" src="https://player.soundcloud.com/player.swf?url=http%3A%2F%2Fapi.soundcloud.com%2Ftracks%2F70191463?&amp;show_comments=false&amp;auto_play=true&amp;color=4f2170" type="application/x-shockwave-flash" width="40%"></embed> </object>
    <?php 
} else {
    ?>
  
        <iframe style="float:left; margin-top: 15px;" width="40%" height="166" scrolling="no" frameborder="no" src="http://w.soundcloud.com/player/?url=http%3A%2F%2Fapi.soundcloud.com%2Ftracks%2F70191463?&amp;show_comments=false&amp;auto_play=true&amp;show_artwork=true&amp;color=4f2170"></iframe> 
          <?php 
}
?>
              
       
        </div>
    </div>
开发者ID:briancrocker81,项目名称:xmas_cards,代码行数:31,代码来源:index.php

示例3: min

    $total_posts = $config['max_posts'];
    $percentage = $total_posts ? min(100, $profiledata['user_posts'] / $total_posts * 100) : 0;
} else {
    $percentage = 0;
}
// Mighty Gorgon - Thanks Received - BEGIN
$total_thanks_received = 0;
if ($config['show_thanks_profile'] && empty($config['disable_likes_posts'])) {
    $total_thanks_received = user_get_thanks_received($profiledata['user_id']);
    $template->assign_block_vars('show_thanks_profile', array());
}
// Mighty Gorgon - Thanks Received - END
// Mighty Gorgon - HTTP AGENTS - BEGIN
include IP_ROOT_PATH . 'includes/functions_mg_http.' . PHP_EXT;
$user_os = get_user_os($profiledata['user_browser']);
$user_browser = get_user_browser($profiledata['user_browser']);
// Mighty Gorgon - HTTP AGENTS - END
// Mighty Gorgon - Full Album Pack - BEGIN
if (!empty($config['plugins']['album']['enabled'])) {
    include IP_ROOT_PATH . PLUGINS_PATH . $config['plugins']['album']['dir'] . 'common.' . PHP_EXT;
    include IP_ROOT_PATH . PLUGINS_PATH . $config['plugins']['album']['dir'] . 'includes/album_functions_profile.' . PHP_EXT;
    album_profile_last_pictures($profiledata);
}
// Mighty Gorgon - Full Album Pack - END
$avatar_img = user_get_avatar($profiledata['user_id'], $profiledata['user_level'], $profiledata['user_avatar'], $profiledata['user_avatar_type'], $profiledata['user_allowavatar']);
// Mighty Gorgon - Multiple Ranks - BEGIN
$user_ranks = generate_ranks($profiledata, $ranks_array);
// Mighty Gorgon - Multiple Ranks - END
// ONLINE OFFLINE - BEGIN
$user_online_status = 'offline';
if ($profiledata['user_session_time'] >= time() - $config['online_time']) {
开发者ID:ALTUN69,项目名称:icy_phoenix,代码行数:31,代码来源:usercp_viewprofile.php

示例4: log_request

 function log_request($url, $prev)
 {
     global $session;
     $sql = sprintf("insert into `User Request Dimension` (`User Key`,`Session Key`,`Date`,`URL`,`Previous URL`,`IP`,`OS`,`Browser`) values (%d,%d,%s,%s,%s,%s,%s,%s)", $this->id, $session->data['Session Key'], prepare_mysql(gmdate('Y-m-d H:i:s')), prepare_mysql($url), prepare_mysql($prev), prepare_mysql(ip()), prepare_mysql(get_user_os($_SERVER['HTTP_USER_AGENT'])), prepare_mysql(get_user_browser($_SERVER['HTTP_USER_AGENT'])));
     $this->mysqli->query($sql);
     $this->update_request_data();
 }
开发者ID:inikoo,项目名称:fact,代码行数:7,代码来源:class.User.php

示例5: elseif

    $u_agent = $_SERVER['HTTP_USER_AGENT'];
    $ub = '';
    if (preg_match('/MSIE/i', $u_agent)) {
        $ub = "ie";
    } elseif (preg_match('/Firefox/i', $u_agent)) {
        $ub = "firefox";
    } elseif (preg_match('/Safari/i', $u_agent)) {
        $ub = "safari";
    } elseif (preg_match('/Chrome/i', $u_agent)) {
        $ub = "chrome";
    } elseif (preg_match('/Flock/i', $u_agent)) {
        $ub = "flock";
    } elseif (preg_match('/Opera/i', $u_agent)) {
        $ub = "opera";
    }
    return $ub;
}
echo $_SERVER['PHP_SELF'];
echo $_SERVER['HTTP_USER_AGENT'] . "<br/>";
echo "I know your browser type : " . get_user_browser();
echo "I know your IP address : " . $_SERVER['REMOTE_ADDR'];
echo "I know your IP address : " . $_SERVER['SERVER_SOFTWARE'];
echo '<h2>DEBUG SERVER Reslt</h2><pre>';
print_r($_SERVER);
echo '</pre>';
$query_string = 'file=' . urlencode($_SERVER['PHP_SELF']);
echo '<a href=../userFunctions/viewSource.php?' . htmlentities($query_string) . '>' . 'view source </a>';
?>
    </body>
</html>
开发者ID:jipengxiang,项目名称:phpWebService,代码行数:30,代码来源:browserType.php

示例6: visit_stats

/**
 * 统计访问信息
 *
 * @access  public
 * @return  void
 */
function visit_stats()
{
    if (isset($GLOBALS['_CFG']['visit_stats']) && $GLOBALS['_CFG']['visit_stats'] == 'off')
    {
        return;
    }
    $time = gmtime();
    /* 检查客户端是否存在访问统计的cookie */
    $visit_times = (!empty($_COOKIE['ECS']['visit_times'])) ? intval($_COOKIE['ECS']['visit_times']) + 1 : 1;
    setcookie('ECS[visit_times]', $visit_times, $time + 86400 * 365, '/');

    $browser  = get_user_browser();
    $os       = get_os();
    $ip       = real_ip();
    $area     = ecs_geoip($ip);

    /* 语言 */
    if (!empty($_SERVER['HTTP_ACCEPT_LANGUAGE']))
    {
        $pos  = strpos($_SERVER['HTTP_ACCEPT_LANGUAGE'], ';');
        $lang = addslashes(($pos !== false) ? substr($_SERVER['HTTP_ACCEPT_LANGUAGE'], 0, $pos) : $_SERVER['HTTP_ACCEPT_LANGUAGE']);
    }
    else
    {
        $lang = '';
    }

    /* 来源 */
    if (!empty($_SERVER['HTTP_REFERER']) && strlen($_SERVER['HTTP_REFERER']) > 9)
    {
        $pos = strpos($_SERVER['HTTP_REFERER'], '/', 9);
        if ($pos !== false)
        {
            $domain = substr($_SERVER['HTTP_REFERER'], 0, $pos);
            $path   = substr($_SERVER['HTTP_REFERER'], $pos);

            /* 来源关键字 */
            if (!empty($domain) && !empty($path))
            {
                save_searchengine_keyword($domain, $path);
            }
        }
        else
        {
            $domain = $path = '';
        }
    }
    else
    {
        $domain = $path = '';
    }

    $sql = 'INSERT INTO ' . $GLOBALS['ecs']->table('stats') . ' ( ' .
                'ip_address, visit_times, browser, system, language, area, ' .
                'referer_domain, referer_path, access_url, access_time' .
            ') VALUES (' .
                "'$ip', '$visit_times', '$browser', '$os', '$lang', '$area', ".
                "'" . htmlspecialchars(addslashes($domain)) ."', '" . htmlspecialchars(addslashes($path)) ."', '" . htmlspecialchars(addslashes(PHP_SELF)) ."', '" . $time . "')";
    $GLOBALS['db']->query($sql);
}
开发者ID:xiaoxiaowu007,项目名称:jicai,代码行数:66,代码来源:lib_main.php

示例7: fread

        $currentc = fread($handlec, filesize('chrome.txt'));
        fclose($handlec);
        $currentc_inc = $currentc + 1;
        $handlec = fopen('chrome.txt', 'w');
        fwrite($handlec, $currentc_inc);
        fclose($handlec);
    }
    return $ub;
}
?>
  <script>
    document.cookie="height="+screen.height;
    document.cookie="width="+screen.width;
  </script>
<?php 
echo get_user_browser();
echo "<p>Your screen Height is " . $_COOKIE['height'] . " pixels</p>";
echo "<p>Your screen Width is " . $_COOKIE['width'] . " pixels</p>";
?>
  <h3><u>Comment Section</u></h3>
    <!-- Comments Form -->
        <form action = "" method="POST">
      Name: <input type = "text" name = "name"><br/>
      <br/><textarea rows = "10" cols = "30" name = "commentContent"></textarea><br/>
      <input type = "submit" value = "Post!"><br/>
      <h4><u>Posted Comments</u></h4>
    <?php 
include "comments.html";
?>
    </form>
    <h1>Welcome to the Club!</h1>
开发者ID:rcurnock,项目名称:rcurnock.github.io,代码行数:31,代码来源:welcome.php

示例8: array

$registered_users = 0;
$hidden_users = 0;

$reg_counter = 0;
$guest_counter = 0;
$prev_user = 0;
$session_ip_array = array();
foreach ($online_users as $row)
{
	$view_online = false;
	$is_auth_view = false;
	$forum_id = false;
	$topic_id = false;
	// Mighty Gorgon - HTTP AGENTS - BEGIN
	$user_os = get_user_os($row['session_browser']);
	$user_browser = get_user_browser($row['session_browser']);
	// Mighty Gorgon - HTTP AGENTS - END

	if ($row['session_logged_in'])
	{
		$user_id = $row['user_id'];

		if ($user_id != $prev_user)
		{
			$username = colorize_username($row['user_id'], $row['username'], $row['user_color'], $row['user_active']);

			if (!$row['user_allow_viewonline'])
			{
				$view_online = (($user->data['user_level'] == ADMIN) || ($user->data['user_id'] == $user_id)) ? true : false;
				$hidden_users++;
				$username = '<i>' . $username . '</i>';
开发者ID:ALTUN69,项目名称:icy_phoenix,代码行数:31,代码来源:viewonline.php


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