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


PHP session::is_search_engine方法代码示例

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


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

示例1: update_visitor_log

 public static function update_visitor_log($uid, $force_update = false)
 {
     $http_referer = session::$db->escape(session::get_http_referer());
     $user_agent = session::$db->escape(session::get_user_agent());
     $ip_address = session::$db->escape(get_ip_address());
     if (!($forum_fid = get_forum_fid())) {
         $forum_fid = 0;
     }
     $current_datetime = date(MYSQL_DATETIME, time());
     $uid = is_numeric($uid) && $uid > 0 ? session::$db->escape($uid) : 'NULL';
     if (!($search_id = session::is_search_engine())) {
         $search_id = 'NULL';
     }
     if (!$force_update) {
         $sql = "SELECT UNIX_TIMESTAMP(MAX(LAST_LOGON)) FROM VISITOR_LOG WHERE FORUM = {$forum_fid} ";
         $sql .= "AND ((UID = {$uid} AND {$uid} IS NOT NULL) OR (SID = {$search_id} AND {$search_id} IS NOT NULL) ";
         $sql .= "OR (IPADDRESS = '{$ip_address}' AND {$uid} IS NULL AND {$search_id} IS NULL))";
         if (!($result = session::$db->query($sql))) {
             return false;
         }
         list($last_logon) = $result->fetch_row();
     }
     if (!isset($last_logon) || $last_logon < time() - HOUR_IN_SECONDS) {
         $sql = "REPLACE INTO VISITOR_LOG (FORUM, UID, LAST_LOGON, IPADDRESS, REFERER, USER_AGENT, SID) ";
         $sql .= "VALUES ('{$forum_fid}', {$uid}, CAST('{$current_datetime}' AS DATETIME), '{$ip_address}', ";
         $sql .= "'{$http_referer}', '{$user_agent}', {$search_id})";
         if (!session::$db->query($sql)) {
             return false;
         }
     }
     return true;
 }
开发者ID:DeannaG65,项目名称:BeehiveForum,代码行数:32,代码来源:session.inc.php

示例2: light_html_draw_bottom

function light_html_draw_bottom()
{
    static $called = false;
    if ($called) {
        return;
    }
    $called = true;
    $webtag = get_webtag();
    forum_check_webtag_available($webtag);
    echo "</div>\n";
    echo "<div id=\"footer\">\n";
    if (!session::is_search_engine()) {
        echo "  <div id=\"footer_links\">\n";
        echo "    <a href=\"#top\">", gettext("Top"), "</a> &middot; <a href=\"index.php?webtag={$webtag}&amp;view=full\">", gettext("Desktop Version"), "</a>\n";
        echo "  </div>\n";
    }
    echo "  <h6><a href=\"http://www.beehiveforum.co.uk/\" target=\"_blank\">Beehive Forum ", BEEHIVE_VERSION, "<br />&copy; ", strftime('%Y'), " Project Beehive Forum</a></h6>\n";
    echo "</div>\n";
    echo "</body>\n";
    echo "</html>\n";
}
开发者ID:DeannaG65,项目名称:BeehiveForum,代码行数:21,代码来源:light.inc.php

示例3: light_html_draw_top

                        $mode = ALL_DISCUSSIONS;
                    }
                }
            }
            if (browser_mobile()) {
                light_html_draw_top(array('js' => array('js/thread_list.js')));
            }
            if (forums_get_available_count() > 1 || !forum_get_default()) {
                light_navigation_bar(array('back' => "lforums.php?webtag={$webtag}"));
            } else {
                light_navigation_bar();
            }
            light_draw_thread_list($mode, $folder, $start_from);
        }
    }
} else {
    if (browser_mobile()) {
        light_html_draw_top();
    }
    light_navigation_bar();
    light_draw_my_forums();
}
if (!browser_mobile() && !session::is_search_engine()) {
    echo "</div>\n";
    echo "</body>\n";
    echo "</noframes>\n";
    echo "</frameset>\n";
    html_draw_bottom(true);
} else {
    light_html_draw_bottom();
}
开发者ID:DeannaG65,项目名称:BeehiveForum,代码行数:31,代码来源:index.php

示例4: browser_mobile

function browser_mobile()
{
    $mobile_browser = 0;
    if (isset($_SERVER['HTTP_ACCEPT']) && strpos(strtolower($_SERVER['HTTP_ACCEPT']), 'application/vnd.wap.xhtml+xml') !== false) {
        $mobile_browser++;
    }
    if (isset($_SERVER['HTTP_X_WAP_PROFILE'])) {
        $mobile_browser++;
    }
    if (isset($_SERVER['HTTP_PROFILE'])) {
        $mobile_browser++;
    }
    // User Agent from https://code.google.com/p/the-devices-detection/source/list
    $mobile_agents = array('iPhone', 'iPad', 'iPod', 'incognito', 'webmate', 'dream', 'CUPCAKE', 'webOS', 's8000', 'Googlebot-Mobile', 'Palm', 'EudoraWeb', 'Blazer', 'AvantGo', 'Android', 'Windows CE', 'Cellphone', 'Small', 'MMEF20', 'Danger', 'hiptop', 'Proxinet', 'ProxiNet', 'Newt', 'PalmOS', 'NetFront', 'SHARP-TQ-GX10', 'SonyEricsson', 'SymbianOS', 'UP.Browser', 'UP.Link', 'TS21i-10', 'MOT-V', 'portalmmm', 'DoCoMo', 'Opera Mini', 'Palm', 'Handspring', 'Nokia', 'Kyocera', 'Samsung', 'Motorola', 'Mot', 'Smartphone', 'Blackberry', 'WAP', 'SonyEricsson', 'PlayStation Portable', 'LG', 'MMP', 'OPWV', 'Symbian', 'EPOC');
    $mobile_agents_preg = implode('|', array_map('preg_quote_callback', $mobile_agents));
    if (isset($_SERVER['HTTP_USER_AGENT']) && preg_match("/({$mobile_agents_preg})/u", $_SERVER['HTTP_USER_AGENT'])) {
        $mobile_browser++;
    }
    if (isset($_SERVER['ALL_HTTP']) && strpos(strtolower($_SERVER['ALL_HTTP']), 'operamini') !== false) {
        $mobile_browser++;
    }
    // Exclude Windows desktop browsers
    if (isset($_SERVER['ALL_HTTP']) && strpos(strtolower($_SERVER['HTTP_USER_AGENT']), 'windows') !== false) {
        $mobile_browser = 0;
    }
    // Windows Phone 7
    if (isset($_SERVER['ALL_HTTP']) && strpos(strtolower($_SERVER['HTTP_USER_AGENT']), 'windows phone') !== false) {
        $mobile_browser++;
    }
    if (html_get_cookie('view', 'full')) {
        $mobile_browser = 0;
    }
    if (session::is_search_engine() || html_get_cookie('view', 'mobile')) {
        $mobile_browser++;
    }
    return $mobile_browser > 0;
}
开发者ID:DeannaG65,项目名称:BeehiveForum,代码行数:37,代码来源:browser.inc.php

示例5: update_visitor_log

 public static function update_visitor_log($uid, $forum_fid)
 {
     $ip_address = get_ip_address();
     $http_referer = session::$db->escape(session::get_http_referer());
     $user_agent = session::$db->escape(session::get_user_agent());
     $ip_address = session::$db->escape($ip_address);
     $current_datetime = date(MYSQL_DATETIME, time());
     $uid = is_numeric($uid) && $uid > 0 ? $uid : 'NULL';
     if (!($search_id = session::is_search_engine())) {
         $search_id = 'NULL';
     }
     $sql = "REPLACE INTO VISITOR_LOG (FORUM, UID, LAST_LOGON, IPADDRESS, REFERER, USER_AGENT, SID) ";
     $sql .= "VALUES ('{$forum_fid}', {$uid}, CAST('{$current_datetime}' AS DATETIME), '{$ip_address}', ";
     $sql .= "'{$http_referer}', '{$user_agent}', {$search_id})";
     if (!session::$db->query($sql)) {
         return false;
     }
     return true;
 }
开发者ID:richstokoe,项目名称:BeehiveForum,代码行数:19,代码来源:session.inc.php


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