本文整理汇总了PHP中CUserCounter::Clear方法的典型用法代码示例。如果您正苦于以下问题:PHP CUserCounter::Clear方法的具体用法?PHP CUserCounter::Clear怎么用?PHP CUserCounter::Clear使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CUserCounter
的用法示例。
在下文中一共展示了CUserCounter::Clear方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: GetMessage
} else {
$arResult['ID'] = CMailbox::Add($arFields);
$res = $arResult['ID'] > 0;
}
if (!$res) {
$arResult['ERRORS'][] = GetMessage('INTR_MAIL_SAVE_ERROR');
} else {
CUserCounter::Set($USER->GetID(), 'mail_unseen', $unseen, SITE_ID);
CUserOptions::SetOption('global', 'last_mail_check_' . SITE_ID, time());
CUserOptions::SetOption('global', 'last_mail_check_success_' . SITE_ID, $unseen >= 0);
LocalRedirect($APPLICATION->GetCurPage() . '?STEP=confirm&ACT=setup');
}
}
}
break;
case 'remove':
if (check_bitrix_sessid()) {
CMailbox::Delete($arResult['ID']);
CUserCounter::Clear($USER->GetID(), 'mail_unseen', SITE_ID);
CUserOptions::DeleteOption('global', 'last_mail_check_' . SITE_ID);
CUserOptions::DeleteOption('global', 'last_mail_check_success_' . SITE_ID);
LocalRedirect($APPLICATION->GetCurPage() . '?STEP=confirm&ACT=remove');
} else {
LocalRedirect($APPLICATION->GetCurPage() . '?STEP=setup');
}
break;
case 'confirm':
$arResult['ACT'] = isset($_REQUEST['ACT']) ? $_REQUEST['ACT'] : '';
break;
}
$this->IncludeComponentTemplate();
示例2: Clear
public static function Clear($code, $site_id = SITE_ID, $sendPull = true)
{
return CUserCounter::Clear(CUserCounter::SYSTEM_USER_ID, $code, $site_id, $sendPull);
}
示例3: Delete
function Delete($ID)
{
global $DB;
$ID = IntVal($ID);
$db_msg = CMailMessage::GetList(Array(), Array("MAILBOX_ID"=>$ID));
while($msg = $db_msg->Fetch())
{
if(!CMailMessage::Delete($msg["ID"]))
return false;
}
$db_flt = CMailFilter::GetList(Array(), Array("MAILBOX_ID"=>$ID));
while($flt = $db_flt->Fetch())
{
if(!CMailFilter::Delete($flt["ID"]))
return false;
}
$db_log = CMailLog::GetList(Array(), Array("MAILBOX_ID"=>$ID));
while($log = $db_log->Fetch())
{
if(!CMailLog::Delete($log["ID"]))
return false;
}
$db_mbox = CMailbox::GetList(array('ID' => $ID, 'ACTIVE' => 'Y', '!USER_ID' => 0));
if ($mbox = $db_mbox->fetch())
{
CUserCounter::Clear($mbox['USER_ID'], 'mail_unseen', $mbox['LID']);
CUserOptions::DeleteOption('global', 'last_mail_check_'.$mbox['LID'], false, $mbox['USER_ID']);
CUserOptions::DeleteOption('global', 'last_mail_check_success_'.$mbox['LID'], false, $mbox['USER_ID']);
}
CAgent::RemoveAgent("CMailbox::CheckMailAgent(".$ID.");", "mail");
$strSql = "DELETE FROM b_mail_message_uid WHERE MAILBOX_ID=".$ID;
if(!$DB->Query($strSql, true))
return false;
CMailbox::SMTPReload();
$strSql = "DELETE FROM b_mail_mailbox WHERE ID=".$ID;
return $DB->Query($strSql, true);
}
示例4: executeManageDeleteMailbox
private static function executeManageDeleteMailbox(&$error)
{
$error = false;
$userId = $_REQUEST['USER_ID'];
if (!check_bitrix_sessid()) {
$error = GetMessage('INTR_MAIL_CSRF');
}
if ($error === false) {
$mailbox = CIntranetMailSetupHelper::getUserMailbox($userId);
if (empty($mailbox) || !in_array($mailbox['SERVER_TYPE'], array('controller', 'domain', 'crdomain'))) {
$error = GetMessage('INTR_MAIL_AJAX_ERROR');
}
}
if ($error === false) {
CMailbox::delete($mailbox['ID']);
list($login, $domain) = explode('@', $mailbox['LOGIN'], 2);
if ($mailbox['SERVER_TYPE'] == 'domain') {
$domainService = CIntranetMailSetupHelper::getDomainService($mailbox['SERVICE_ID']);
CMailDomain2::deleteUser($domainService['token'], $domain, $login);
} else {
if ($mailbox['SERVER_TYPE'] == 'crdomain') {
$crResponse = CControllerClient::ExecuteEvent('OnMailControllerDeleteMemberUser', array('DOMAIN' => $domain, 'NAME' => $login));
if (!isset($crResponse['result'])) {
$error = empty($crResponse['error']) ? GetMessage('INTR_MAIL_CONTROLLER_INVALID') : CMail::getErrorMessage($crResponse['error']);
}
} else {
if ($mailbox['SERVER_TYPE'] == 'controller') {
$crResponse = CControllerClient::ExecuteEvent('OnMailControllerDeleteUser', array('DOMAIN' => $domain, 'NAME' => $login));
if (!isset($crResponse['result'])) {
$error = empty($crResponse['error']) ? GetMessage('INTR_MAIL_CONTROLLER_INVALID') : CMail::getErrorMessage($crResponse['error']);
}
}
}
}
CUserCounter::Clear($userId, 'mail_unseen', $mailbox['LID']);
CUserOptions::DeleteOption('global', 'last_mail_check_' . $mailbox['LID']);
CUserOptions::DeleteOption('global', 'last_mail_check_success_' . $mailbox['LID']);
}
if ($error === false) {
$create = '<a href="#" onclick="mb.create(' . intval($userId) . '); return false; ">' . GetMessage('INTR_MAIL_MANAGE_CREATE') . '</a>';
}
return array('result' => $error === false ? 'ok' : 'error', 'create' => isset($create) ? CharsetConverter::ConvertCharset($create, SITE_CHARSET, 'UTF-8') : '', 'error' => CharsetConverter::ConvertCharset($error, SITE_CHARSET, 'UTF-8'));
}