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


PHP CUserCounter::ClearByUser方法代码示例

本文整理汇总了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;
开发者ID:Satariall,项目名称:izurit,代码行数:31,代码来源:component.php

示例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();
开发者ID:mrdeadmouse,项目名称:u136006,代码行数:31,代码来源:component.php

示例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 {
开发者ID:mrdeadmouse,项目名称:u136006,代码行数:31,代码来源:component.php

示例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
		)
	)
	{
开发者ID:ASDAFF,项目名称:bitrix-5,代码行数:31,代码来源:component.php


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