本文整理汇总了PHP中Visitor::getInstance方法的典型用法代码示例。如果您正苦于以下问题:PHP Visitor::getInstance方法的具体用法?PHP Visitor::getInstance怎么用?PHP Visitor::getInstance使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Visitor
的用法示例。
在下文中一共展示了Visitor::getInstance方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: setupChatViewForVisitor
function setupChatViewForVisitor($thread, $level)
{
$visitSession = VisitSession::GetInstance()->GetVisitSessionById($thread['visitsessionid']);
$page['agent'] = false;
$page['visitor'] = true;
$page['canpost'] = true;
$nameisset = Resources::Get('chat.default.visitorname') != $visitSession['visitorname'];
$page['displ1'] = $nameisset ? 'none' : 'inline';
$page['displ2'] = $nameisset ? 'inline' : 'none';
$page['level'] = $level;
$page['ct_chatThreadId'] = $thread['threadid'];
$page['ct_token'] = $thread['token'];
$page['ct_visitor_name'] = $visitSession['visitorname'];
$page['canChangeName'] = Visitor::getInstance()->canVisitorChangeName();
$page['ct_company_name'] = Settings::Get('company_name');
$page['ct_company_chatLogoURL'] = Settings::Get('logo');
$page['webimHost'] = Settings::Get('hosturl');
$page['send_shortcut'] = 'Enter';
$params = 'thread=' . $thread['threadid'] . '&token=' . $thread['token'];
$page['selfLink'] = WEBIM_ROOT . '/client.php?' . $params . '&level=' . $level;
$page['isOpera95'] = is_agent_opera95();
$page['displayrate'] = !empty($thread['rate']) ? 'none' : 'inline';
$page['rateList'] = explode('|', Resources::Get('chat.operator_rates'));
if (!empty($res)) {
foreach ($res as $k => $v) {
$page[$k] = $v;
}
}
$page['viewonly'] = '0';
return $page;
}
示例2: updateContacts
function updateContacts($name, $email, $phone, $threadid, $visitsessionid)
{
$visitSession = MapperFactory::getMapper("VisitSession")->getById($visitsessionid);
if ($visitSession['visitorname'] != $name) {
Thread::getInstance()->RenameVisitor(array("threadid" => $threadid), $name);
Visitor::getInstance()->setVisitorNameCookie($name);
MapperFactory::getMapper("VisitSession")->save(array('visitsessionid' => $visitsessionid, 'visitorname' => $name));
}
}
示例3: rand
$TML->assign('RAND', rand(1000, 9999));
$args = array();
foreach ($_GET as $key => $item) {
if ($key != 'action') {
$args[] = "{$key}={$item}";
}
}
$TML->assign('chaturi', "./?a=5" . join('&', $args));
$TML->assign('MAX_FILES', feedback::MAX_FILES);
$TML->assign('u_token_key', $_SESSION['rand']);
if ($has_errors) {
echo "Error:{$errors[0]};{$errors['1']}" . ($errors[2] ? ';' . $errors[2] : '');
exit;
}
$visitSessionId = VisitSession::GetInstance()->updateCurrentOrCreateSession();
$params = array();
$params['visitsessionid'] = $visitSessionId;
$params['lastpingvisitor'] = null;
$params['offline'] = 1;
$threads_count = MapperFactory::getMapper("Thread")->getNonEmptyThreadsCountByVisitorId($visitorid);
$thread = Thread::getInstance()->CreateThread(WEBIM_CURRENT_LOCALE, STATE_CLOSED, $params);
VisitSession::GetInstance()->UpdateVisitSession($visitSessionId, array('hasthread' => 1));
Thread::getInstance()->sendFirstMessageWithVisitorInfo($thread);
Visitor::getInstance()->setVisitorNameCookie($visitor_name);
$feedback = new feedback();
$uid = get_uid(false);
$login = $_SESSION['webim_uname'];
$email = $_SESSION['webim_email'];
$feedback->Add($uid, $login, $email, $department, iconv("UTF-8", "WINDOWS-1251//IGNORE", $message), $attach);
echo "Success: ok";
exit;
示例4: die
$visitSession = VisitSession::GetInstance()->GetVisitSessionById($thread['visitsessionid']);
if (!$thread || !isset($thread['token']) || $token != $thread['token']) {
die("wrong thread");
}
$TML = new SmartyClass();
setupChatViewForOperator($thread, $visitSession, $operator, $viewonly, $TML);
Browser::SendHtmlHeaders();
$pparam = verify_param("act", "/^(mailthread_c)\$/", "default");
if ($pparam == "mailthread_c") {
$TML->assignCompanyInfoAndTheme();
$TML->assign('threadid', $thread['threadid']);
$TML->assign('token', $thread['token']);
$TML->assign('level', $_REQUEST['level']);
$theme = Browser::getCurrentTheme();
$TML->assign('theme', $theme);
$TML->assign('email_from', Visitor::getInstance()->getEmail($threadid));
$TML->assign('email', 'info@free-lance.ru');
// отделы службы поддержки free-lance ---
$aDetps = array();
foreach ($aDkoOrder as $nOrder) {
$aDetps[] = array('value' => $nOrder, 'title' => $aDko[$nOrder]['option']);
}
$TML->assign('depts', $aDetps);
//---------------------------------------
$TML->display('send-history-c.tpl');
} else {
$snd_uri = '/webim/operator/agent.php?thread=' . $threadid . '&token=' . $token . '&act=mailthread_c';
$TML->assign('snd_uri', $snd_uri);
$TML->display('chat_ajaxed.tpl');
}
function preparePredefinedAnswers($locale)
示例5: array
Thread::getInstance()->CommitThread($thread['threadid'], array('shownmessageid' => $postedid));
}
if (!$isvisitor && $thread['state'] == STATE_INVITE) {
Invitation::GetInstance()->UpdateInvitationMessage($thread['threadid'], $postedid);
}
}
Thread::getInstance()->PrintThreadMessages($thread, $token, $lastid, $isvisitor, $outformat, $viewonly);
exit;
} elseif ($act == "rename") {
if (!Visitor::getInstance()->canVisitorChangeName()) {
show_error("server: forbidden to change name");
}
if (!empty($_REQUEST['name'])) {
$newname = smarticonv('UTF-8', WEBIM_ENCODING, $_REQUEST['name']);
Thread::getInstance()->RenameVisitor($thread, $newname);
Visitor::getInstance()->setVisitorNameCookie($newname);
}
// $data = strtr(base64_encode($newname), '+/=', '-_, ');
show_ok_result("rename");
} elseif ($act == "ping") {
show_ok_result("ping");
} elseif ($act == "close") {
if ($isvisitor) {
ThreadProcessor::getInstance()->ProcessThread($thread['threadid'], 'visitor_close');
$visitor = GetVisitorFromRequestAndSetCookie();
$threads = MapperFactory::getMapper("Thread")->getOpenThreadsForVisitor($visitor['id']);
if (count($threads) < 1) {
VisitSession::GetInstance()->deleteVisitSessionCurrentPageFile($visitor['id']);
}
} elseif ($thread['operatorid'] == $operator['operatorid']) {
ThreadProcessor::getInstance()->ProcessThread($thread['threadid'], 'operator_close');