本文整理汇总了PHP中CUserCounter::ClearByUser方法的典型用法代码示例。如果您正苦于以下问题:PHP CUserCounter::ClearByUser方法的具体用法?PHP CUserCounter::ClearByUser怎么用?PHP CUserCounter::ClearByUser使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CUserCounter
的用法示例。
在下文中一共展示了CUserCounter::ClearByUser方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: intval
}
$arResult["WORKGROUPS_PAGE"] = $folderWorkgroups;
if ($GLOBALS["USER"]->IsAuthorized() && $arParams["SET_LOG_COUNTER"] == "Y") {
$arCounters = CUserCounter::GetValues($user_id, SITE_ID);
if (isset($arCounters[$arResult["COUNTER_TYPE"]])) {
$arResult["LOG_COUNTER"] = intval($arCounters[$arResult["COUNTER_TYPE"]]);
} else {
$bEmptyCounter = true;
$arResult["LOG_COUNTER"] = 0;
}
} else {
$arParams["SHOW_UNREAD"] = "N";
}
if ($GLOBALS["USER"]->IsAuthorized() && $arParams["SET_LOG_COUNTER"] == "Y" && (intval($arResult["LOG_COUNTER"]) > 0 || $bEmptyCounter)) {
CUserCounter::ClearByUser($user_id, array(SITE_ID, "**"), $arResult["COUNTER_TYPE"], true);
CUserCounter::ClearByUser($user_id, SITE_ID, "BLOG_POST_IMPORTANT");
}
if ($GLOBALS["USER"]->IsAuthorized() && $arParams["SET_LOG_PAGE_CACHE"] == "Y" && $dateLastPage && (!$dateLastPageStart || $dateLastPageStart != $dateLastPage || $bNeedSetLogPage)) {
$groupCode = strlen($arResult["COUNTER_TYPE"]) > 0 ? $arResult["COUNTER_TYPE"] : "**";
$bNeedSetTraffic = CSocNetLogComponent::isSetTrafficNeeded(array("PAGE_NUMBER" => $arResult["PAGE_NUMBER"], "GROUP_CODE" => $groupCode, "TRAFFIC_LAST_DATE_TS" => $arLastPageStart['TRAFFIC_LAST_DATE_TS']));
CSocNetLogPages::Set($user_id, $dateLastPage, $arParams["PAGE_SIZE"], $arResult["PAGE_NUMBER"], SITE_ID, $groupCode, $bNeedSetTraffic ? ($arLastPageStart['TRAFFIC_AVG'] + $dateFirstPageTS - $arResult["dateLastPageTS"]) / ($arLastPageStart['TRAFFIC_CNT'] + 1) : false, $bNeedSetTraffic ? $arLastPageStart['TRAFFIC_CNT'] + 1 : false);
}
} else {
$arResult["NEED_AUTH"] = "Y";
}
if (!isset($arResult["FatalError"]) && $GLOBALS["USER"]->IsAuthorized() && !$arResult["AJAX_CALL"]) {
$cache = new CPHPCache();
$cache_id = "log_form_comments" . serialize($arParams["COMMENT_PROPERTY"]);
$cache_path = "/sonet/log_form/comments";
if (defined("BX_COMP_MANAGED_CACHE")) {
$ttl = 2592000;
示例2: foreach
}
}
}
}
}
foreach ($arTmpEventsNew as $arTmpEvent) {
if (!is_array($_SESSION["SONET_LOG_ID"]) || !in_array($arTmpEvent["EVENT"]["ID"], $_SESSION["SONET_LOG_ID"])) {
$_SESSION["SONET_LOG_ID"][] = $arTmpEvent["EVENT"]["ID"];
}
$arResult["EventsNew"][] = $arTmpEvent;
}
if ($arTmpEvent["EVENT"]["DATE_FOLLOW"]) {
$dateLastPage = ConvertTimeStamp(MakeTimeStamp($arTmpEvent["EVENT"]["DATE_FOLLOW"], CSite::GetDateFormat("FULL")), "FULL");
}
$arResult["WORKGROUPS_PAGE"] = COption::GetOptionString("socialnetwork", "workgroups_page", "/workgroups/", SITE_ID);
if ($GLOBALS["USER"]->IsAuthorized() && $arParams["SET_LOG_COUNTER"] == "Y") {
CUserCounter::ClearByUser($GLOBALS["USER"]->GetID(), SITE_ID, $arResult["COUNTER_TYPE"]);
CUserCounter::ClearByUser($GLOBALS["USER"]->GetID(), "**", $arResult["COUNTER_TYPE"]);
}
if ($GLOBALS["USER"]->IsAuthorized() && $arParams["SET_LOG_PAGE_CACHE"] == "Y" && $dateLastPage) {
CSocNetLogPages::Set($GLOBALS["USER"]->GetID(), $dateLastPage, $arParams["PAGE_SIZE"], $arResult["PAGE_NUMBER"], SITE_ID);
}
if ($GLOBALS["USER"]->IsAuthorized() && $arParams["USE_FOLLOW"] == "Y") {
$rsFollow = CSocNetLogFollow::GetList(array("USER_ID" => $GLOBALS["USER"]->GetID(), "CODE" => "**"), array("TYPE"));
if ($arFollow = $rsFollow->Fetch()) {
$arResult["FOLLOW_DEFAULT"] = $arFollow["TYPE"];
} else {
$arResult["FOLLOW_DEFAULT"] = COption::GetOptionString("socialnetwork", "follow_default_type", "Y");
}
}
$this->IncludeComponentTemplate();
示例3: ConvertTimeStamp
if ($arTmpEvent["DATE_FOLLOW"]) {
$dateLastPage = ConvertTimeStamp(MakeTimeStamp($arTmpEvent["DATE_FOLLOW"], CSite::GetDateFormat("FULL")), "FULL");
} elseif ($arParams["USE_FOLLOW"] == "N" && $arTmpEvent["LOG_UPDATE"]) {
$dateLastPage = ConvertTimeStamp(MakeTimeStamp($arTmpEvent["LOG_UPDATE"], CSite::GetDateFormat("FULL")), "FULL");
}
if ($arParams["LOG_ID"] <= 0 && intval($arParams["NEW_LOG_ID"]) <= 0 && $GLOBALS["USER"]->IsAuthorized()) {
$arCounters = CUserCounter::GetValues($GLOBALS["USER"]->GetID(), SITE_ID);
if (isset($arCounters[$arResult["COUNTER_TYPE"]])) {
$arResult["LOG_COUNTER"] = intval($arCounters[$arResult["COUNTER_TYPE"]]);
} else {
$bEmptyCounter = true;
$arResult["LOG_COUNTER"] = 0;
}
}
if ($GLOBALS["USER"]->IsAuthorized() && $arParams["SET_LOG_COUNTER"] == "Y" && (intval($arResult["LOG_COUNTER"]) > 0 || $bEmptyCounter)) {
CUserCounter::ClearByUser($GLOBALS["USER"]->GetID(), array(SITE_ID, "**"), $arResult["COUNTER_TYPE"]);
}
if ($GLOBALS["USER"]->IsAuthorized() && $arParams["SET_LOG_PAGE_CACHE"] == "Y" && $dateLastPage && (!$dateLastPageStart || $dateLastPageStart != $dateLastPage || $bNeedSetLogPage)) {
CSocNetLogPages::Set($GLOBALS["USER"]->GetID(), $dateLastPage, $arParams["PAGE_SIZE"], $arResult["PAGE_NUMBER"], SITE_ID, strlen($arResult["COUNTER_TYPE"]) > 0 ? $arResult["COUNTER_TYPE"] : "**");
}
} else {
$rsCurrentUser = CUser::GetByID($GLOBALS["USER"]->GetID());
if ($arCurrentUser = $rsCurrentUser->Fetch()) {
$arResult["EmptyComment"] = array("AVATAR_SRC" => CSocNetLogTools::FormatEvent_CreateAvatar($arCurrentUser, $arParams, ""), "AUTHOR_NAME" => CUser::FormatName($arParams["NAME_TEMPLATE"], $arCurrentUser, $bUseLogin));
}
}
if ($GLOBALS["USER"]->IsAuthorized() && $arParams["USE_FOLLOW"] == "Y") {
$rsFollow = CSocNetLogFollow::GetList(array("USER_ID" => $GLOBALS["USER"]->GetID(), "CODE" => "**"), array("TYPE"));
if ($arFollow = $rsFollow->Fetch()) {
$arResult["FOLLOW_DEFAULT"] = $arFollow["TYPE"];
} else {
示例4:
$arParams["SHOW_UNREAD"] = "N";
if (
$GLOBALS["USER"]->IsAuthorized()
&& $arParams["SET_LOG_COUNTER"] == "Y"
&& (intval($arResult["LOG_COUNTER"]) > 0 || $bEmptyCounter)
)
{
CUserCounter::ClearByUser(
$GLOBALS["USER"]->GetID(),
array(SITE_ID, "**"),
$arResult["COUNTER_TYPE"]
);
CUserCounter::ClearByUser(
$GLOBALS["USER"]->GetID(),
SITE_ID,
"BLOG_POST_IMPORTANT"
);
}
if (
$GLOBALS["USER"]->IsAuthorized()
&& $arParams["SET_LOG_PAGE_CACHE"] == "Y"
&& $dateLastPage
&& (
!$dateLastPageStart
|| $dateLastPageStart != $dateLastPage
|| $bNeedSetLogPage
)
)
{