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


PHP Browser::GetExtAddr方法代码示例

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


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

示例1: updateCurrentOrCreateSession

 function updateCurrentOrCreateSession()
 {
     $session = $this->getCurrentSession();
     $visitorInfo = GetVisitorFromRequestAndSetCookie();
     $fl_login = isset($_SESSION['login']) ? $_SESSION['login'] : '';
     if (empty($session)) {
         $ip = Browser::GetExtAddr();
         $remoteHost = isset($_SERVER['REMOTE_HOST']) ? $_SERVER['REMOTE_HOST'] : null;
         $useragent = isset($_SERVER['HTTP_USER_AGENT']) ? $_SERVER['HTTP_USER_AGENT'] : null;
         $userid = null;
         $sessionId = $this->createVisitSession($ip, $remoteHost, $useragent, $userid, $visitorInfo['id'], $visitorInfo['name'], $fl_login, $visitorInfo['partnerref']);
     } else {
         $sessionId = is_array($session) ? $session['visitsessionid'] : $session;
         $this->UpdateVisitSession($sessionId, array('fl_login' => $fl_login, 'visitorname' => $visitorInfo['name']));
     }
     VisitedPage::GetInstance()->addOrUpdateFromSession($sessionId);
     $_SESSION['WEBIM_VISIT_SESSION_ID'] = $sessionId;
     return $sessionId;
 }
开发者ID:Nikitian,项目名称:fl-ru-damp,代码行数:19,代码来源:class.visitsession.php

示例2: createNewThread

function createNewThread()
{
    $extAddr = Browser::GetExtAddr();
    $remoteHost = !empty($_SERVER['REMOTE_HOST']) ? $_SERVER['REMOTE_HOST'] : $extAddr;
    $visitSessionId = VisitSession::GetInstance()->updateCurrentOrCreateSession();
    $params = array();
    $params['visitsessionid'] = $visitSessionId;
    $params['lastpingvisitor'] = null;
    //    $canChangeName = Visitor::getInstance()->canVisitorChangeName();
    //    if (!empty($_REQUEST['visitorname']) && $canChangeName) {
    //      Visitor::getInstance()->setVisitorNameCookie($_REQUEST['visitorname']);
    //      $params['visitorname'] = $_REQUEST['visitorname'];
    //    }
    $operatorid = verify_param('operatorid', "/^(\\d)\$/");
    $departmentkey = verify_param('departmentkey', "/^\\w+\$/");
    $autoinviteid = verify_param('autoinviteid', "/^\\d+\$/");
    if (!empty($departmentkey)) {
        $department = MapperFactory::getMapper('Department')->getByDepartmentKey($departmentkey);
        $params['departmentid'] = $department['departmentid'];
    }
    //  else {
    //    $departments = MapperFactory::getMapper("Department")->enumDepartments(Resources::getCurrentLocale());
    //
    //    if (count($departments) == 1) {
    //      $params['departmentid'] = $departments[0]['departmentid'];
    //    }
    //  }
    //
    $startThreadState = null;
    if (!empty($operatorid) && ($operator = Operator::GetOperatorById($operatorid))) {
        $params['nextoperatorid'] = $operator['operatorid'];
        $startThreadState = STATE_LOADING_FOR_EXACT_OPERATOR;
    } else {
        $startThreadState = STATE_LOADING;
    }
    $thread = Thread::getInstance()->CreateThread(Resources::getCurrentLocale(), $startThreadState, $params);
    VisitSession::GetInstance()->UpdateVisitSession($visitSessionId, array('hasthread' => 1));
    set_has_threads(HAS_THREADS_FILE);
    // если пользователь не ввел email, то по умолчанию сообщаем email с основной базы
    if (empty($_REQUEST['email']) && !empty($_SESSION['uid'])) {
        $_REQUEST['email'] = $GLOBALS['DB']->val('SELECT email FROM users WHERE uid = ?', $_SESSION['uid']);
    }
    Thread::getInstance()->sendFirstMessageWithVisitorInfo($thread, $_REQUEST);
    if (!empty($autoinviteid)) {
        Thread::getInstance()->sendAutoIniviteTextToOperator($thread, $autoinviteid);
    }
    $visitor = GetVisitorFromRequestAndSetCookie();
    $opener = Thread::getInstance()->getOpenerWithTitle();
    VisitSession::GetInstance()->setVisitSessionCurrentPage($visitor['id'], $opener[0], $opener[1]);
    if (!empty($_REQUEST['message'])) {
        $v = GetVisitorFromRequestAndSetCookie();
        $hash = array();
        $hash['sendername'] = $v['name'];
        $hash['message'] = $_REQUEST['message'];
        ThreadProcessor::getInstance()->ProcessThread($thread['threadid'], 'visitor_message', $hash);
    }
    if (!empty($email) || !empty($phone)) {
        Thread::getInstance()->PostMessage($thread['threadid'], KIND_FOR_AGENT, Resources::get('start.chat.info', array($email, $phone)));
    }
    //  MapperFactory::getMapper("Thread")->incrementVisitorMessageCount($threadid);
    return $thread;
}
开发者ID:kapai69,项目名称:fl-ru-damp,代码行数:62,代码来源:client.php


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