本文整理汇总了PHP中Browser::SendXmlHeaders方法的典型用法代码示例。如果您正苦于以下问题:PHP Browser::SendXmlHeaders方法的具体用法?PHP Browser::SendXmlHeaders怎么用?PHP Browser::SendXmlHeaders使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Browser
的用法示例。
在下文中一共展示了Browser::SendXmlHeaders方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: time
<?php
/*
*
* Данный файл является частью проекта Веб Мессенджер.
*
* Все права защищены. (c) 2005-2009 ООО "ТОП".
* Данное программное обеспечение и все сопутствующие материалы
* предоставляются на условиях лицензии, доступной по адресу
* http://webim.ru/license.html
*
*/
require_once '../classes/functions.php';
require_once '../classes/class.operator.php';
require_once '../classes/class.thread.php';
$operator = Operator::getInstance()->GetLoggedOperator(false);
// папка online в мэмкэш --------------------
//touch_online_file(OPERATOR_VIEW_TRACKER_FILE);
$mem_buff->set('OPERATOR_VIEW_TRACKER_FILE', time(), 1800);
if (!$operator) {
Browser::SendXmlHeaders();
echo "<error><descr>" . escape_with_cdata(getstring("agent.not_logged_in")) . "</descr></error>";
exit;
}
$xml = Thread::getInstance()->BuildVisitorsXml();
Browser::SendXmlHeaders();
echo $xml;
示例2: PrintThreadMessages
function PrintThreadMessages($thread, $token, $lastid, $isvisitor, $format, $viewonly = false)
{
$threadid = $thread['threadid'];
$istyping = abs($thread['current'] - $thread[$isvisitor ? "lpoperator" : "lpvisitor"]) < WEBIM_CONNECTION_TIMEOUT && $thread[$isvisitor ? "agenttyping" : "visitortyping"] == "1" ? "1" : "0";
$israted = empty($thread['ratedoperatorid']) ? 'false' : 'true';
$visitSession = $isvisitor ? GetVisitorFromRequestAndSetCookie() : MapperFactory::getMapper("VisitSession")->getById($thread['visitsessionid']);
$visitorname = $isvisitor ? removeSpecialSymbols($visitSession['name']) : removeSpecialSymbols(htmlspecialchars($visitSession['visitorname']));
$rate = $thread['rate'];
if ($format == "xml") {
$visitorname = "visitorname=\"{$visitorname}\"";
$operatorfullname = "operatorfullname=\"" . $thread['operatorfullname'] . "\"";
$fl_login = "fl_login=\"" . ($isvisitor || empty($visitSession['fl_login']) ? '' : $visitSession['fl_login']) . "\"";
$threadstate = "state=\"" . $thread['state'] . "\"";
$isHasMessages = true;
if ($lastid != 0 && !$viewonly) {
$isHasMessages = $isvisitor ? $this->isHasMessagesForVisitor($thread['threadid']) : $this->isHasMessagesForOperator($thread['threadid']);
}
$haveMessegesToAlert = "needtoalert=\"" . ($isHasMessages ? "true" : "false") . "\"";
$output = array();
if ($isHasMessages) {
$output = $this->GetMessages($threadid, "xml", $isvisitor, $lastid);
if ($thread['state'] !== STATE_CLOSED) {
if ($isvisitor) {
$this->unsetThreadHasMessagesForVisitor($thread['threadid']);
} else {
if (!$viewonly) {
$this->unsetThreadHasMessagesForOperator($thread['threadid']);
}
}
}
}
Browser::SendXmlHeaders();
print "<thread lastid=\"{$lastid}\" typing=\"" . $istyping . "\" viewonly=\"" . $viewonly . "\" {$visitorname} {$operatorfullname} {$fl_login} {$haveMessegesToAlert} {$threadstate} israted=\"{$israted}\" rate=\"{$rate}\">";
foreach ($output as $msg) {
if (!$isvisitor && strpos($msg, "webimFeedbackBtn") !== false) {
continue;
}
print $msg;
}
print "</thread>";
} elseif ($format == "html") {
$output = $this->GetMessages($threadid, "html", $isvisitor, $lastid);
Browser::SendHtmlHeaders();
$url = WEBIM_ROOT . "/thread.php?act=refresh&thread=" . $threadid . "&token=" . $token . "&html=on&visitor=" . ($isvisitor ? "true" : "false");
print "<html><head>\n" . "<link rel=\"stylesheet\" type=\"text/css\" media=\"all\" href=\"" . WEBIM_ROOT . "/css/admin_chat.css?" . WEBIM_VERSION . "\" />\n" . "<meta http-equiv=\"Refresh\" content=\"7; URL={$url}&sn=11\">\n" . "<meta http-equiv=\"Pragma\" content=\"no-cache\">\n" . "</head>" . "<body bgcolor='#FFFFFF' text='#000000' link='#C28400' vlink='#C28400' alink='#C28400' marginwidth='0' marginheight='0' leftmargin='0' rightmargin='0' topmargin='0' bottommargin='0' onload=\"if (location.hash != '#aend') {location.hash='#aend';}\">" . "<table width='100%' cellspacing='0' cellpadding='0' border='0'><tr><td valign='top' class='message'>";
foreach ($output as $msg) {
if (!$isvisitor && strpos($msg, "webimFeedbackBtn") !== false) {
continue;
}
print $msg;
}
print "</td></tr></table><a name='aend'>" . "</body></html>";
}
}
示例3: GetLoggedOperator
public function GetLoggedOperator($redirect = true)
{
if (!isset($_SESSION['operator'])) {
if (isset($_COOKIE['WEBIM_AUTH'])) {
list($login, $pwd) = split(',', $_COOKIE['WEBIM_AUTH'], 2);
$op = MapperFactory::getMapper('Operator')->getByLogin($login);
if ($op && isset($pwd) && isset($op['password']) && md5($op['password']) == $pwd) {
$this->setOperatorToSessionById($op['operatorid']);
return $op;
}
}
if ($redirect) {
header('Location: ' . WEBIM_ROOT . '/operator/login.php?redir=' . urlencode($_SERVER['PHP_SELF']));
exit;
} else {
Browser::SendXmlHeaders();
Browser::displayAjaxError('agent.not_logged_in');
exit;
}
}
return SilentGetOperator();
}
示例4: show_error
function show_error($message)
{
Browser::SendXmlHeaders();
echo "<error><descr>{$message}</descr></error>";
exit;
}