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


PHP Browser::SendXmlHeaders方法代码示例

本文整理汇总了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;
开发者ID:Nikitian,项目名称:fl-ru-damp,代码行数:27,代码来源:onsite.php

示例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>";
     }
 }
开发者ID:Nikitian,项目名称:fl-ru-damp,代码行数:54,代码来源:class.thread.php

示例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();
 }
开发者ID:kapai69,项目名称:fl-ru-damp,代码行数:22,代码来源:class.operator.php

示例4: show_error

function show_error($message)
{
    Browser::SendXmlHeaders();
    echo "<error><descr>{$message}</descr></error>";
    exit;
}
开发者ID:notUserDeveloper,项目名称:fl-ru-damp,代码行数:6,代码来源:thread.php


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