本文整理汇总了PHP中CacheManager::GetValueBySystemId方法的典型用法代码示例。如果您正苦于以下问题:PHP CacheManager::GetValueBySystemId方法的具体用法?PHP CacheManager::GetValueBySystemId怎么用?PHP CacheManager::GetValueBySystemId使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CacheManager
的用法示例。
在下文中一共展示了CacheManager::GetValueBySystemId方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: ProcessPosts
function ProcessPosts()
{
global $USER;
$pc = 0;
if (!empty($USER->Browsers[0]->QueuedPosts)) {
if (!$USER->Browsers[0]->Waiting) {
while (!empty($_GET["mi" . $pc])) {
$pc++;
}
foreach ($USER->Browsers[0]->QueuedPosts as $id => $postar) {
$_GET["mp" . $pc] = $postar[0];
$_GET["mrid" . $pc] = $_GET["mi" . $pc] = Encoding::Base64UrlEncode($id);
$_GET["mc" . $pc++] = Encoding::Base64UrlEncode($postar[1]);
DBManager::Execute(true, "DELETE FROM `" . DB_PREFIX . DATABASE_POSTS . "` WHERE `id`='" . DBManager::RealEscape($id) . "' LIMIT 1;");
}
$pc = 0;
$USER->Browsers[0]->QueuedPosts = array();
}
}
$this->OverlayHTML = "";
if (!empty($_GET["mi" . $pc]) || $USER->Browsers[0]->Waiting || !empty($USER->Browsers[0]->InitChatWith) || !empty($USER->Browsers[0]->Forward) && !$USER->Browsers[0]->Forward->Received && $USER->Browsers[0]->Forward->Processed) {
if ($USER->Browsers[0]->Waiting && $this->Botmode && !empty($USER->Browsers[0]->QueuedPosts)) {
$USER->Browsers[0]->QueuedPosts = array();
} else {
if (!Visitor::$OpenChatExternal) {
$this->Init();
}
}
if (!empty($USER->Browsers[0]->Forward) && !$USER->Browsers[0]->Forward->Received && $USER->Browsers[0]->Forward->Processed) {
$USER->Browsers[0]->Forward->Save(true, true);
Visitor::$IsActiveOverlayChat = !$USER->Browsers[0]->Declined;
}
}
if (!empty($USER->Browsers[0]->ChatId)) {
$USER->AddFunctionCall("lz_chat_id='" . $USER->Browsers[0]->ChatId . "';", false);
}
$USER->Browsers[0]->VisitId = $USER->VisitId;
while (!empty($_GET["mi" . $pc])) {
$id = Communication::ReadParameter("mrid" . $pc, md5($USER->Browsers[0]->SystemId . $USER->Browsers[0]->ChatId . $_GET["mi" . $pc]));
$senderName = !empty($USER->Browsers[0]->UserData->Fullname) ? $USER->Browsers[0]->UserData->Fullname : LocalizationManager::$TranslationStrings["client_guest"] . " " . Visitor::GetNoName($USER->UserId . Communication::GetIP());
$post = new Post($id, $USER->Browsers[0]->SystemId, "", Encoding::Base64UrlDecode($_GET["mp" . $pc]), Communication::ReadParameter("mc" . $pc, time()), $USER->Browsers[0]->ChatId, $senderName);
$post->BrowserId = VisitorMonitoring::$Browser->BrowserId;
if (!empty($_GET["mpti" . $pc])) {
$post->Translation = Encoding::Base64UrlDecode($_GET["mpt" . $pc]);
$post->TranslationISO = Encoding::Base64UrlDecode($_GET["mpti" . $pc]);
}
$saved = false;
if (!$USER->Browsers[0]->Waiting) {
foreach (Server::$Groups as $groupid => $group) {
if ($group->IsDynamic && $USER->Browsers[0]->Status == CHAT_STATUS_ACTIVE && isset($group->Members[$USER->Browsers[0]->SystemId])) {
foreach ($group->Members as $member => $persistent) {
if ($member != $USER->Browsers[0]->SystemId) {
if (!empty(Server::$Operators[$member])) {
processPost($id, $post, $member, $pc, $groupid, $USER->Browsers[0]->ChatId);
} else {
processPost($id, $post, $member, $pc, $groupid, CacheManager::GetValueBySystemId($member, "chat_id", ""));
}
$saved = true;
}
}
$pGroup = $group;
}
}
foreach ($USER->Browsers[0]->Members as $systemid => $member) {
if (!empty($member->Declined)) {
continue;
}
if (!empty(Server::$Operators[$systemid]) && !empty($pGroup) && isset($pGroup->Members[$systemid])) {
continue;
}
if (!(!empty($pGroup) && !empty(Server::$Operators[$systemid]))) {
$saved = processPost($id, $post, $systemid, $pc, $USER->Browsers[0]->SystemId, $USER->Browsers[0]->ChatId, Server::$Operators[$systemid]->IsBot);
}
}
if (!empty($USER->Browsers[0]->OperatorId) && (Server::$Operators[$USER->Browsers[0]->OperatorId]->IsBot || $USER->Browsers[0]->Status == CHAT_STATUS_ACTIVE)) {
$rpost = new Post($id = getId(32), Server::$Operators[$USER->Browsers[0]->OperatorId]->SystemId, $USER->Browsers[0]->SystemId, $answer = Server::$Operators[$USER->Browsers[0]->OperatorId]->GetAutoReplies($post->Text . " " . $post->Translation, $USER->Browsers[0]), time(), $USER->Browsers[0]->ChatId, Server::$Operators[$USER->Browsers[0]->OperatorId]->Fullname);
if (!empty($answer)) {
if (Server::$Operators[$USER->Browsers[0]->OperatorId]->IsBot) {
sleep(1);
$USER->AddFunctionCall("lz_chat_input_bot_state(true,false);", false);
}
$rpost->ReceiverOriginal = $rpost->ReceiverGroup = $USER->Browsers[0]->SystemId;
$rpost->Save();
$saved = true;
foreach ($USER->Browsers[0]->Members as $opsysid => $member) {
if ($opsysid != Server::$Operators[$USER->Browsers[0]->OperatorId]->SystemId || !Server::$Operators[$USER->Browsers[0]->OperatorId]->IsBot) {
$rpost = new Post($id, Server::$Operators[$USER->Browsers[0]->OperatorId]->SystemId, $opsysid, $answer, time(), $USER->Browsers[0]->ChatId, Server::$Operators[$opsysid]->Fullname);
$rpost->ReceiverOriginal = $rpost->ReceiverGroup = $USER->Browsers[0]->SystemId;
$rpost->Save();
}
}
}
}
if ($saved) {
$USER->AddFunctionCall("lz_chat_release_post('" . Encoding::Base64UrlDecode($_GET["mi" . $pc]) . "');", false);
}
} else {
processPost($id, $post, "", $pc, $USER->Browsers[0]->SystemId, $USER->Browsers[0]->ChatId, false);
$USER->Browsers[0]->QueuedPosts[$id] = array(0 => $_GET["mp" . $pc], 1 => time(), 2 => VisitorMonitoring::$Browser->BrowserId);
$USER->AddFunctionCall("lz_chat_release_post('" . Encoding::Base64UrlDecode($_GET["mi" . $pc]) . "');", false);
//.........这里部分代码省略.........
示例2: processPostForExternal
function processPostForExternal($rec, $recgroup, $post, $time, $count, $_group = false)
{
if (STATS_ACTIVE) {
Server::$Statistic->ProcessAction(ST_ACTION_INTERNAL_POST);
}
if (!empty(Server::$Operators[CALLER_SYSTEM_ID]->ExternalChats[$rec]) && $_group) {
Server::$Operators[CALLER_SYSTEM_ID]->ExternalChats[$rec]->Load();
Server::$Operators[CALLER_SYSTEM_ID]->ExternalChats[$rec]->Members[$rec] = true;
$chatId = Server::$Operators[CALLER_SYSTEM_ID]->ExternalChats[$rec]->ChatId;
$receiverlist = Server::$Operators[CALLER_SYSTEM_ID]->ExternalChats[$rec]->Members;
} else {
$chatId = CacheManager::GetValueBySystemId($rec, "chat_id", "");
$receiverlist = array($rec => $rec);
}
$npost = new Post(getId(32), CALLER_SYSTEM_ID, "", $post, $time, $chatId, Server::$Operators[CALLER_SYSTEM_ID]->Fullname);
foreach ($receiverlist as $systemid => $member) {
if ($systemid == CALLER_SYSTEM_ID || !empty($member->Declined)) {
continue;
}
if (!empty(Server::$Operators[$systemid]) && !empty(Server::$Groups[$recgroup]->Members[$systemid])) {
continue;
}
$npost->Receiver = $systemid;
$npost->Persistent = false;
$npost->Translation = $_POST[POST_INTERN_PROCESS_POSTS . "_vd" . $count];
$npost->TranslationISO = $_POST[POST_INTERN_PROCESS_POSTS . "_ve" . $count];
$npost->ReceiverGroup = $recgroup;
$npost->ReceiverOriginal = $rec;
$npost->Save();
Server::$Operators[CALLER_SYSTEM_ID]->SetRepostTime($npost->ReceiverGroup, $npost->Created);
}
}