本文整理汇总了PHP中CPHPCache::Output方法的典型用法代码示例。如果您正苦于以下问题:PHP CPHPCache::Output方法的具体用法?PHP CPHPCache::Output怎么用?PHP CPHPCache::Output使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CPHPCache
的用法示例。
在下文中一共展示了CPHPCache::Output方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: serialize
$cache_id = "blog_last_messages_" . serialize($arParams) . "_" . serialize($UserGroupID) . "_" . $USER->IsAdmin();
if (($tzOffset = CTimeZone::GetOffset()) != 0) {
$cache_id .= "_" . $tzOffset;
}
if ($arParams["USE_SOCNET"] == "Y") {
$cache_id .= "_" . $user_id;
}
$cache_path = "/" . SITE_ID . "/blog/last_messages/";
$arResult = array();
if ($arParams["CACHE_TIME"] > 0 && $cache->InitCache($arParams["CACHE_TIME"], $cache_id, $cache_path)) {
$Vars = $cache->GetVars();
foreach ($Vars["arResult"] as $k => $v) {
$arResult[$k] = $v;
}
CBitrixComponentTemplate::ApplyCachedData($Vars["templateCachedData"]);
$cache->Output();
} else {
if ($arParams["CACHE_TIME"] > 0) {
$cache->StartDataCache($arParams["CACHE_TIME"], $cache_id, $cache_path);
}
$arFilter = array("<=DATE_PUBLISH" => ConvertTimeStamp(time() + $tzOffset, "FULL", false), "PUBLISH_STATUS" => BLOG_PUBLISH_STATUS_PUBLISH, ">PERMS" => BLOG_PERMS_DENY, "BLOG_ACTIVE" => "Y", "BLOG_GROUP_SITE_ID" => SITE_ID);
if (strlen($arParams["BLOG_URL"]) > 0) {
$arFilter["BLOG_URL"] = $arParams["BLOG_URL"];
}
if (!empty($arParams["GROUP_ID"])) {
$arFilter["BLOG_GROUP_ID"] = $arParams["GROUP_ID"];
}
if ($USER->IsAdmin()) {
unset($arFilter[">PERMS"]);
}
$arSelectedFields = array("ID", "BLOG_ID", "TITLE", "DATE_PUBLISH", "AUTHOR_ID", "DETAIL_TEXT", "BLOG_ACTIVE", "BLOG_URL", "BLOG_GROUP_ID", "BLOG_GROUP_SITE_ID", "AUTHOR_LOGIN", "AUTHOR_NAME", "AUTHOR_LAST_NAME", "AUTHOR_SECOND_NAME", "BLOG_USER_ALIAS", "BLOG_OWNER_ID", "VIEWS", "NUM_COMMENTS", "ATTACH_IMG", "BLOG_SOCNET_GROUP_ID", "CODE", "MICRO");
示例2: unset
$arFilter["CATEGORY_ID_F"][] = $arCategory["ID"];
}
}
if ($USER->IsAdmin()) {
unset($arFilter[">PERMS"]);
}
if (CModule::IncludeModule("socialnetwork") && IntVal($arParams["SOCNET_GROUP_ID"]) <= 0 && IntVal($arParams["USER_ID"]) <= 0) {
unset($arFilter[">PERMS"]);
$cacheSoNet = new CPHPCache();
$cache_idSoNet = "blog_sonet_" . SITE_ID . "_" . $USER->GetID() . "_extranet";
$cache_pathSoNet = "/" . SITE_ID . "/blog/sonet/";
if ($arParams["CACHE_TIME"] > 0 && $cacheSoNet->InitCache($arParams["CACHE_TIME"], $cache_idSoNet, $cache_pathSoNet)) {
$Vars = $cacheSoNet->GetVars();
$arAvBlog = $Vars["arAvBlog"];
CBitrixComponentTemplate::ApplyCachedData($Vars["templateCachedData"]);
$cacheSoNet->Output();
} else {
if ($arParams["CACHE_TIME"] > 0) {
$cacheSoNet->StartDataCache($arParams["CACHE_TIME"], $cache_idSoNet, $cache_pathSoNet);
}
$arUsersInMyGroupsID = CExtranet::GetMyGroupsUsers(SITE_ID);
$arUsersInMyGroupsID[] = $USER->GetID();
$arPublicUsersID = CExtranet::GetPublicUsers();
$arUsersToFilter = array_merge($arUsersInMyGroupsID, $arPublicUsersID);
$arAvBlog = array();
$arFilterTmp = array("ACTIVE" => "Y", "GROUP_SITE_ID" => SITE_ID);
if (IntVal($arParams["GROUP_ID"]) > 0) {
$arFilterTmp["GROUP_ID"] = $arParams["GROUP_ID"];
}
$dbBlog = CBlog::GetList(array(), $arFilterTmp);
while ($arBlog = $dbBlog->Fetch()) {