本文整理汇总了PHP中DBManager::Execute方法的典型用法代码示例。如果您正苦于以下问题:PHP DBManager::Execute方法的具体用法?PHP DBManager::Execute怎么用?PHP DBManager::Execute使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DBManager
的用法示例。
在下文中一共展示了DBManager::Execute方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: header
}
require LIVEZILLA_PATH . "_definitions/definitions.inc.php";
require LIVEZILLA_PATH . "_lib/functions.global.inc.php";
require LIVEZILLA_PATH . "_definitions/definitions.dynamic.inc.php";
require LIVEZILLA_PATH . "_definitions/definitions.protocol.inc.php";
require LIVEZILLA_PATH . "_lib/functions.external.inc.php";
@set_error_handler("handleError");
@error_reporting(E_ALL);
header("Pragma: no-cache");
header("Cache-Control: no-cache, must-revalidate");
header("Keep-Alive: timeout=5, max=100");
Server::InitDataProvider();
if (!empty($_GET["value"]) && strlen($_GET["value"]) == 16) {
$ticket = VisitorChat::GetMatchingVoucher($_GET[GET_EXTERN_GROUP], $_GET["value"]);
if (!empty($ticket) && !$ticket->CheckForVoid() && $ticket->Paid) {
$ticket->UpdateVoucherChatTime(0, empty($ticket->FirstUsed));
$sessions = $ticket->ChatSessionsMax < 0 ? 0 : $ticket->ChatSessionsMax;
if ($result = DBManager::Execute(true, "SELECT `exit` FROM `" . DB_PREFIX . DATABASE_VISITOR_CHATS . "` WHERE `chat_ticket_id`='" . DBManager::RealEscape($ticket->Id) . "' AND `exit`=0 LIMIT 1;")) {
if ($row = DBManager::FetchArray($result)) {
exit("lz_validate_com_chat_input_result(false,true,1,'',0,0,0,false,false,false);");
}
}
exit("lz_validate_com_chat_input_result(true,false,1,'" . $ticket->Id . "'," . $ticket->ChatTime . "," . $ticket->ChatTimeMax . "," . $ticket->ChatSessions . "," . $ticket->ChatSessionsMax . "," . $ticket->VoucherAutoExpire . "," . To::BoolString($ticket->VoucherAutoExpire < time()) . ");");
} else {
if (!empty($ticket)) {
exit("lz_validate_com_chat_input_result(false,false,1,'',0,0,0,false,false,false);");
}
}
}
exit("lz_validate_com_chat_input_result(false,false,0,'',0,0,0,false,false,false);");
Server::UnloadDataProvider();
示例2: SpanSet
static function SpanSet($_value)
{
if (Is::Defined("DB_CONNECTION") && @Server::$Configuration->File["gl_db_gtspan"] != $_value) {
DBManager::Execute(true, "REPLACE INTO `" . DB_PREFIX . DATABASE_CONFIG . "` (`key`, `value`) VALUES ('gl_db_gtspan','" . intval(Server::$Configuration->File["gl_db_gtspan"] = $_value) . "');");
}
}
示例3: Listen
function Listen()
{
global $USER;
$isOp = false;
if ($USER->Browsers[0]->Status == CHAT_STATUS_ACTIVE) {
$result = DBManager::Execute(true, "SELECT * FROM `" . DB_PREFIX . DATABASE_VISITOR_CHAT_OPERATORS . "` WHERE `chat_id`='" . DBManager::RealEscape($USER->Browsers[0]->ChatId) . "' ORDER BY `status` DESC, `dtime` DESC;");
while ($row = DBManager::FetchArray($result)) {
if (isset(Server::$Operators[$row["user_id"]])) {
$ChatMember = new ChatMember($row["user_id"], $row["status"], !empty($row["declined"]), $row["jtime"], $row["ltime"]);
if ($ChatMember->Status == 1 && $ChatMember->Joined >= $USER->Browsers[0]->LastActive) {
$isOp = true;
$this->AddHTML(str_replace("<!--message-->", str_replace("<!--intern_name-->", Server::$Operators[$ChatMember->SystemId]->Fullname, LocalizationManager::$TranslationStrings["client_intern_arrives"]), IOStruct::GetFile(TEMPLATE_HTML_MESSAGE_OVERLAY_CHAT_STATUS)), "sys", "LMMJ" . $ChatMember->SystemId);
} else {
if (($ChatMember->Status == 9 || $ChatMember->Status == 2) && $ChatMember->Left >= $USER->Browsers[0]->LastActive && $ChatMember->Joined > 0) {
$this->AddHTML($this->GetLeaveChatHTML(false, Server::$Operators[$ChatMember->SystemId]->Fullname), "sys", "LCM01" . $ChatMember->SystemId);
}
}
if ($ChatMember->Status == 0) {
$isOp = true;
}
}
}
} else {
$isOp = true;
}
if (Communication::ReadParameter("ovlif")) {
$this->InitFeedback();
}
$USER->Browsers[0]->Typing = isset($_GET["typ"]);
if (!$USER->Browsers[0]->Declined) {
$USER->Browsers[0]->Save();
}
$USER->Browsers[0]->ValidateOperator();
$this->CurrentOperatorId = Communication::GetParameter("op", "", $c, FILTER_SANITIZE_SPECIAL_CHARS, null, 32);
if ($USER->Browsers[0]->Waiting && $this->Botmode || empty($USER->Browsers[0]->OperatorId) && !empty($this->CurrentOperatorId) && isset(Server::$Operators[$this->CurrentOperatorId]) && !Server::$Operators[$this->CurrentOperatorId]->IsBot || !empty($this->CurrentOperatorId) && empty($USER->Browsers[0]->ChatId) && !$this->Botmode || !$isOp || $USER->Browsers[0]->Closed) {
if (!$USER->Browsers[0]->ExternalClosed) {
$USER->Browsers[0]->ExternalClose();
$USER->Browsers[0]->Save();
$USER->Browsers[0]->Load();
}
$USER->Browsers[0]->Members = array();
if (!empty($this->CurrentOperatorId) && !empty(Server::$Operators[$this->CurrentOperatorId]) && $isOp) {
$this->AddHTML($this->GetLeaveChatHTML(true, Server::$Operators[$this->CurrentOperatorId]->Fullname), "sys", "LCM01" . $this->CurrentOperatorId);
if (!empty(Server::$Configuration->File["gl_fboe"]) && Communication::ReadParameter("po", 0) == 0 && !Server::$Operators[$this->CurrentOperatorId]->IsBot) {
if (!empty(Server::$Groups[$USER->Browsers[0]->DesiredChatGroup]->ChatFunctions[3])) {
$this->InitFeedback(false);
}
}
$this->Flags["LMR"] = "null";
$USER->Browsers[0]->OperatorId = null;
$this->CurrentOperatorId = "";
$this->RepollRequired = true;
}
}
}
示例4: buildExtern
function buildExtern()
{
Server::$Response->Tracking = "";
$result = DBManager::Execute(true, "SELECT * FROM `" . DB_PREFIX . DATABASE_CHAT_FORWARDS . "` WHERE `auto`=0 AND `closed`=0 AND `received`=0 ORDER BY `created` ASC;");
while ($row = DBManager::FetchArray($result)) {
$forward = new Forward($row);
Server::$Response->Forwards .= $forward->GetXml();
if (!empty(Server::$Visitors[$forward->ReceiverUserId]) && Server::$Visitors[$forward->ReceiverUserId]->GetBrowser($forward->ReceiverBrowserId) != null) {
if (!$forward->Invite) {
Server::$Visitors[$forward->ReceiverUserId]->GetBrowser($forward->ReceiverBrowserId)->Forward = $forward;
} else {
if (CALLER_SYSTEM_ID == $forward->TargetSessId) {
$forward->Save(true, true);
}
}
}
}
$isex = !empty(Server::$Operators[CALLER_SYSTEM_ID]->Groups) && Server::$Groups[Server::$Operators[CALLER_SYSTEM_ID]->Groups[0]]->IsExternal;
$builder = new ExternalXMLBuilder(Server::$Operators[CALLER_SYSTEM_ID], Server::$Visitors, NO_CLIPPING || isset($_POST[POST_INTERN_RESYNC]), $isex);
$builder->SessionFileSizes = Server::$Operators[CALLER_SYSTEM_ID]->VisitorFileSizes;
$builder->StaticReload = Server::$Operators[CALLER_SYSTEM_ID]->VisitorStaticReload;
$base = array();
$builder->SetDiscardedObject($base);
$builder->Generate();
Server::$Response->Tracking = $builder->XMLCurrent;
foreach ($builder->DiscardedObjects as $uid => $list) {
Server::$Response->Tracking .= "<cd id=\"" . base64_encode($uid) . "\">\r\n";
if ($list != null) {
foreach ($list as $bid) {
Server::$Response->Tracking .= " <bd id=\"" . base64_encode($bid) . "\" />\r\n";
}
}
Server::$Response->Tracking .= "</cd>\r\n";
}
Server::$Response->Typing .= $builder->XMLTyping;
Server::$Operators[CALLER_SYSTEM_ID]->VisitorFileSizes = $builder->SessionFileSizes;
Server::$Operators[CALLER_SYSTEM_ID]->VisitorStaticReload = $builder->StaticReload;
if ($builder->GetAll && !LOGIN) {
Server::$Response->Tracking .= "<resync />\r\n";
}
if (count(Server::$Visitors) == 0) {
Server::$Operators[CALLER_SYSTEM_ID]->VisitorFileSizes = array();
}
}
示例5: processChatActions
function processChatActions()
{
global $RVISITOR;
$count = 0;
while (isset($_POST[POST_INTERN_PROCESS_CHAT_ACTION . "_" . $count . "_va"])) {
$type = $_POST[POST_INTERN_PROCESS_CHAT_ACTION . "_" . $count . "_vd"];
if ($type == "OperatorSignOff") {
$op = Server::$Operators[$_POST[POST_INTERN_PROCESS_CHAT_ACTION . "_" . $count . "_ve_0"]];
$op->SignOff();
CacheManager::FlushKey(DATA_CACHE_KEY_OPERATORS);
} else {
if ($type == "SendChatTranscriptTo") {
$value = 1;
while (!empty($_POST[POST_INTERN_PROCESS_CHAT_ACTION . "_" . $count . "_ve_" . $value])) {
DBManager::Execute(true, "UPDATE `" . DB_PREFIX . DATABASE_CHAT_ARCHIVE . "` SET `transcript_sent`=0,`transcript_receiver`='" . DBManager::RealEscape($_POST[POST_INTERN_PROCESS_CHAT_ACTION . "_" . $count . "_ve_0"]) . "' WHERE `transcript_sent`=1 AND `chat_id`='" . DBManager::RealEscape($_POST[POST_INTERN_PROCESS_CHAT_ACTION . "_" . $count . "_ve_" . $value]) . "' LIMIT 1;");
$value++;
}
Communication::SendChatTranscripts(true);
} else {
if ($type == "CreatePublicGroup") {
if (isset(SERVER::$Operators[$_POST[POST_INTERN_PROCESS_CHAT_ACTION . "_" . $count . "_ve_2"]]) && SERVER::$Operators[$_POST[POST_INTERN_PROCESS_CHAT_ACTION . "_" . $count . "_ve_2"]]->ClientWeb) {
continue;
}
$room = new UserGroup();
$room->IsDynamic = true;
$room->Id = $_POST[POST_INTERN_PROCESS_CHAT_ACTION . "_" . $count . "_ve_0"];
$room->Descriptions["EN"] = $_POST[POST_INTERN_PROCESS_CHAT_ACTION . "_" . $count . "_ve_1"];
$room->Owner = $_POST[POST_INTERN_PROCESS_CHAT_ACTION . "_" . $count . "_ve_2"];
$room->Save();
$room->AddMember($_POST[POST_INTERN_PROCESS_CHAT_ACTION . "_" . $count . "_ve_2"], false);
CacheManager::FlushKey(DATA_CACHE_KEY_OPERATORS);
CacheManager::FlushKey(DATA_CACHE_KEY_GROUPS);
} else {
if ($type == "DeletePublicGroup") {
$room = new UserGroup();
$room->Id = $_POST[POST_INTERN_PROCESS_CHAT_ACTION . "_" . $count . "_ve_0"];
$room->Destroy();
CacheManager::FlushKey(DATA_CACHE_KEY_OPERATORS);
} else {
if ($type == "JoinPublicGroup") {
if (isset(SERVER::$Operators[$_POST[POST_INTERN_PROCESS_CHAT_ACTION . "_" . $count . "_ve_2"]])) {
if (!SERVER::$Operators[$_POST[POST_INTERN_PROCESS_CHAT_ACTION . "_" . $count . "_ve_2"]]->ClientWeb || SERVER::$Operators[$_POST[POST_INTERN_PROCESS_CHAT_ACTION . "_" . $count . "_ve_2"]]->Status == USER_STATUS_OFFLINE) {
$room = new UserGroup();
$room->Id = $_POST[POST_INTERN_PROCESS_CHAT_ACTION . "_" . $count . "_ve_0"];
$room->AddMember($_POST[POST_INTERN_PROCESS_CHAT_ACTION . "_" . $count . "_ve_2"], false);
CacheManager::FlushKey(DATA_CACHE_KEY_OPERATORS);
}
}
} else {
if ($type == "QuitPublicGroup") {
$room = new UserGroup();
$room->Id = $_POST[POST_INTERN_PROCESS_CHAT_ACTION . "_" . $count . "_ve_0"];
$room->RemoveMember($_POST[POST_INTERN_PROCESS_CHAT_ACTION . "_" . $count . "_ve_1"]);
CacheManager::FlushKey(DATA_CACHE_KEY_OPERATORS);
} else {
if ($type == "StartOverlayChat") {
$chat = new VisitorChat($_POST[POST_INTERN_PROCESS_CHAT_ACTION . "_" . $count . "_va"], $_POST[POST_INTERN_PROCESS_CHAT_ACTION . "_" . $count . "_vb"]);
$chat->RequestInitChat(CALLER_SYSTEM_ID);
} else {
if ($type == "AddVisitorComment") {
$visitor = new Visitor($_POST[POST_INTERN_PROCESS_CHAT_ACTION . "_" . $count . "_ve_0"]);
$visitor->SaveComment(CALLER_SYSTEM_ID, $_POST[POST_INTERN_PROCESS_CHAT_ACTION . "_" . $count . "_ve_1"]);
} else {
if ($type == "DownloadRecentHistory") {
$RVISITOR = new Visitor($_POST[POST_INTERN_PROCESS_CHAT_ACTION . "_" . $count . "_ve_0"]);
$RVISITOR->LoadRecentVisits(true, $_POST[POST_INTERN_PROCESS_CHAT_ACTION . "_" . $count . "_ve_1"]);
} else {
if ($type == "SetTranslation") {
$chat = new VisitorChat($_POST[POST_INTERN_PROCESS_CHAT_ACTION . "_" . $count . "_va"], $_POST[POST_INTERN_PROCESS_CHAT_ACTION . "_" . $count . "_vb"]);
$chat->ChatId = $_POST[POST_INTERN_PROCESS_CHAT_ACTION . "_" . $count . "_ve_0"];
$chat->SetTranslation($_POST[POST_INTERN_PROCESS_CHAT_ACTION . "_" . $count . "_ve_1"]);
} else {
if ($type == "SetChatTicketParam") {
$ticket = new CommercialChatVoucher("", $_POST[POST_INTERN_PROCESS_CHAT_ACTION . "_" . $count . "_ve_0"]);
$ticket->Load();
$ticket->SetVoucherParams(!empty($_POST[POST_INTERN_PROCESS_CHAT_ACTION . "_" . $count . "_ve_1"]), !empty($_POST[POST_INTERN_PROCESS_CHAT_ACTION . "_" . $count . "_ve_2"]), !empty($_POST[POST_INTERN_PROCESS_CHAT_ACTION . "_" . $count . "_ve_3"]), !empty($_POST[POST_INTERN_PROCESS_CHAT_ACTION . "_" . $count . "_ve_4"]), !empty($_POST[POST_INTERN_PROCESS_CHAT_ACTION . "_" . $count . "_ve_5"]), !empty($_POST[POST_INTERN_PROCESS_CHAT_ACTION . "_" . $count . "_ve_6"]));
} else {
if (strlen($_POST[POST_INTERN_PROCESS_CHAT_ACTION . "_" . $count . "_vb"]) > 0 && strlen($_POST[POST_INTERN_PROCESS_CHAT_ACTION . "_" . $count . "_va"]) > 0) {
$chat = new VisitorChat($_POST[POST_INTERN_PROCESS_CHAT_ACTION . "_" . $count . "_va"], $_POST[POST_INTERN_PROCESS_CHAT_ACTION . "_" . $count . "_vb"]);
$chat->ChatId = $_POST[POST_INTERN_PROCESS_CHAT_ACTION . "_" . $count . "_vc"];
$chat->Load();
if ($type == "SetCallMeBackStatus") {
$chat->SetCallMeBackStatus($_POST[POST_INTERN_PROCESS_CHAT_ACTION . "_" . $count . "_ve_0"]);
} else {
if ($type == "JoinChatInvisible") {
$chat->JoinChat(CALLER_SYSTEM_ID, true, !empty($_POST[POST_INTERN_PROCESS_CHAT_ACTION . "_" . $count . "_ve_0"]));
} else {
if ($type == "JoinChat") {
$chat->JoinChat(CALLER_SYSTEM_ID, false, !empty($_POST[POST_INTERN_PROCESS_CHAT_ACTION . "_" . $count . "_ve_0"]));
} else {
if ($type == "SetPriority") {
$chat->SetPriority($_POST[POST_INTERN_PROCESS_CHAT_ACTION . "_" . $count . "_ve_0"]);
} else {
if ($type == "SetTargetOperator") {
$chat->SetTargetOperator($_POST[POST_INTERN_PROCESS_CHAT_ACTION . "_" . $count . "_ve_0"]);
} else {
if ($type == "SetTargetGroup") {
$chat->SetTargetGroup($_POST[POST_INTERN_PROCESS_CHAT_ACTION . "_" . $count . "_ve_0"]);
} else {
if ($type == "AcceptChat") {
//.........这里部分代码省略.........
示例6: CleanDatabases
function CleanDatabases($_days)
{
DBManager::Execute(true, "DELETE FROM `" . DB_PREFIX . DATABASE_VISITORS . "` WHERE `entrance`<" . (time() - max(1, $_days) * 86400) . ";");
DBManager::Execute(true, "DELETE FROM `" . DB_PREFIX . DATABASE_OPERATOR_STATUS . "` WHERE `" . DB_PREFIX . DATABASE_OPERATOR_STATUS . "`.`confirmed`<" . DBManager::RealEscape(time() - max(1, $_days) * 86400) . ";");
}
示例7: GetQueueWaitingTime
function GetQueueWaitingTime($_position, $min = 1)
{
if ($this->OperatorsBusy == 0) {
$this->OperatorsBusy++;
}
$result = DBManager::Execute(true, "SELECT AVG(`endtime`-`time`) AS `waitingtime` FROM `" . DB_PREFIX . DATABASE_CHAT_ARCHIVE . "` AS `db1` INNER JOIN `" . DB_PREFIX . DATABASE_OPERATORS . "` as `db2` ON `db1`.`internal_id`=`db2`.`system_id` WHERE `chat_type`=1 AND `bot`=0 AND `endtime`>0 AND `endtime`>`time` AND `endtime`-`time` < 3600;");
if ($result) {
$row = DBManager::FetchArray($result);
if (!empty($row["waitingtime"])) {
$min = $row["waitingtime"] / 60 / $this->OperatorsBusy;
} else {
$min = $min / $this->OperatorsBusy;
}
$minb = $min;
for ($i = 1; $i < $_position; $i++) {
$minb *= 0.9;
$min += $minb;
}
$min /= Server::$Configuration->File["gl_sim_ch"];
$min -= abs((time() - CHAT_START_TIME) / 60);
if ($min <= 0) {
$min = 1;
}
}
return min(10, ceil($min));
}
示例8: UpdateConfiguration
static function UpdateConfiguration($id = 0)
{
if (OperatorRequest::IsValidated() && Is::Defined("VALIDATED_FULL_LOGIN") && OperatorRequest::IsAdministrator(true)) {
Logging::SecurityLog("ServerManager::UpdateConfiguration", "", CALLER_SYSTEM_ID);
if (Is::Defined("STATS_ACTIVE") && !empty($_POST["p_reset_stats"])) {
Server::$Statistic->ResetAll();
}
$int = 0;
if (DB_CONNECTION) {
DBManager::Execute(true, "UPDATE `" . DB_PREFIX . DATABASE_COMMERCIAL_CHAT_TYPES . "` SET `delete`='1';");
DBManager::Execute(true, "DELETE FROM `" . DB_PREFIX . DATABASE_COMMERCIAL_CHAT_LOCALIZATIONS . "`;");
while (!empty($_POST["p_cfg_cct_id_" . $int])) {
$cct = new CommercialChatBillingType($_POST["p_cfg_cct_id_" . $int], $_POST["p_cfg_cct_mnoc_" . $int], $_POST["p_cfg_cct_mtloc_" . $int], $_POST["p_cfg_cct_tae_" . $int], $_POST["p_cfg_cct_tvbo_" . $int], $_POST["p_cfg_cct_svbo_" . $int], $_POST["p_cfg_cct_evbo_" . $int], $_POST["p_cfg_cct_citl_" . $int], $_POST["p_cfg_cct_p_" . $int]);
$cct->Save();
$iint = 0;
while (!empty($_POST["p_cfg_cctli_id_" . $int . "_" . $iint])) {
$cctl = new CommercialChatVoucherLocalization($_POST["p_cfg_cctli_id_" . $int . "_" . $iint], $_POST["p_cfg_cctli_itl_" . $int . "_" . $iint], $_POST["p_cfg_cctli_t_" . $int . "_" . $iint], $_POST["p_cfg_cctli_d_" . $int . "_" . $iint], $_POST["p_cfg_cctli_terms_" . $int . "_" . $iint], $_POST["p_cfg_cctli_emvc_" . $int . "_" . $iint], $_POST["p_cfg_cctli_emvp_" . $int . "_" . $iint], $_POST["p_cfg_cctli_emvu_" . $int . "_" . $iint], $_POST["p_cfg_cctli_exr_" . $int . "_" . $iint]);
$cctl->Save($_POST["p_cfg_cct_id_" . $int]);
$iint++;
}
$int++;
}
$int = 0;
DBManager::Execute(true, "DELETE FROM `" . DB_PREFIX . DATABASE_COMMERCIAL_CHAT_PROVIDERS . "`;");
while (!empty($_POST["p_cfg_ccpp_id_" . $int])) {
$ccpp = new CommercialChatPaymentProvider($_POST["p_cfg_ccpp_id_" . $int], $_POST["p_cfg_ccpp_n_" . $int], $_POST["p_cfg_ccpp_a_" . $int], $_POST["p_cfg_ccpp_u_" . $int], $_POST["p_cfg_ccpp_l_" . $int]);
$ccpp->Save();
$int++;
}
$int = 0;
DBManager::Execute(true, "DELETE FROM `" . DB_PREFIX . DATABASE_MAILBOXES . "`;");
while (!empty($_POST["p_cfg_es_i_" . $int])) {
$acc = new Mailbox($int, true);
$acc->Save();
$int++;
}
$int = 0;
DBManager::Execute(true, "DELETE FROM `" . DB_PREFIX . DATABASE_FEEDBACK_CRITERIA_CONFIG . "`;");
while (isset($_POST["p_cfg_fc_i_" . $int])) {
$fc = new FeedbackCriteria($int, true);
$fc->Save();
$int++;
}
DBManager::Execute(true, "DELETE FROM `" . DB_PREFIX . DATABASE_COMMERCIAL_CHAT_TYPES . "` WHERE `delete`='1';");
DBManager::Execute(true, "DELETE FROM `" . DB_PREFIX . DATABASE_CONFIG . "`;");
foreach ($_POST as $key => $value) {
if (strpos($key, "p_cfg_g_") === 0) {
$skey = str_replace("p_cfg_g_", "", $key);
$value = base64_decode($value);
DBManager::Execute(true, "REPLACE INTO `" . DB_PREFIX . DATABASE_CONFIG . "` (`key`,`value`) VALUES ('" . DBManager::RealEscape($skey) . "','" . DBManager::RealEscape($value) . "');");
}
}
CacheManager::Flush();
}
if (isset($_POST["p_available"])) {
ServerManager::UpdateAvailability(!empty($_POST["p_available"]));
}
//$id = IOStruct::CreateFile($file,base64_decode($_POST["p_upload_value"]),true);
}
GeoTracking::SpanRemove(true);
CacheManager::Flush();
Server::$Response->SetStandardResponse($id, "");
}
示例9: KnowledgebaseEntriesList
function KnowledgebaseEntriesList()
{
$sql_limit = "";
if (!empty($_POST["p_limit"])) {
if (is_int($_POST["p_limit"])) {
$sql_limit = " LIMIT " . intval($_POST["p_limit"]);
} else {
$this->ErrorFilter = "Limit";
return;
}
if (!empty($_POST["p_offset"])) {
if (is_int($_POST["p_offset"])) {
$sql_limit .= " OFFSET " . intval($_POST["p_offset"]);
} else {
$this->ErrorFilter = "Offset";
exit("dsf");
return;
}
}
}
$sql_where = "WHERE `discarded`=0 AND `parentid`<>100";
if (!empty($_POST["p_id"])) {
$sql_where .= " AND `id`='" . DBManager::RealEscape($_POST["p_id"]) . "'";
}
if (empty($_POST["p_show_private"])) {
$sql_where .= " AND `kb_public`=1";
}
$results = array("KnowledgeBaseEntries" => array());
$result = DBManager::Execute(true, "SELECT * FROM `" . DB_PREFIX . DATABASE_RESOURCES . "` " . $sql_where . " ORDER BY `title` ASC " . $sql_limit . ";");
while ($row = DBManager::FetchArray($result)) {
$kbe = new KnowledgeBaseEntry($row);
$results["KnowledgeBaseEntries"][] = array("KnowledgeBaseEntry" => ApiV2::ClearObject(ApiV2::GetObjectFields("KnowledgeBaseEntry"), $kbe));
}
$this->JSONOutput = APIV2::Encode($results, $this->JSONParams);
}
示例10: IsChatBrowserIdAvailable
static function IsChatBrowserIdAvailable($_browserId, $_allowExisting = true)
{
if (empty($_browserId)) {
return false;
}
$result = DBManager::Execute(true, "SELECT * FROM `" . DB_PREFIX . DATABASE_VISITOR_BROWSERS . "` WHERE `id`='" . DBManager::RealEscape($_browserId) . "';");
if ($result) {
if ($row = DBManager::FetchArray($result)) {
if (!$_allowExisting) {
return false;
}
if (!empty($row["overlay_container"]) || empty($row["is_chat"])) {
return false;
}
}
}
return true;
}
示例11: getFileById
function getFileById($_id, $_online, $_type)
{
$result = DBManager::Execute(true, "SELECT * FROM `" . DB_PREFIX . DATABASE_IMAGES . "` WHERE `id`='" . DBManager::RealEscape($_id) . "' AND `button_type`='" . DBManager::RealEscape($_type) . "' AND `online`='" . DBManager::RealEscape($_online ? "1" : "0") . "' LIMIT 1;");
if ($result && ($row = DBManager::FetchArray($result))) {
header("Content-Type: image/" . $row["image_type"] . ";");
return base64_decode($row["data"]);
} else {
header("Content-Type: image/gif;");
return file_get_contents(PATH_IMAGES . "chat_blank.gif");
}
}