}
 if (!empty($arParams["FID_RANGE"])) {
     $arFilter["@ID"] = $arParams["FID_RANGE"];
 }
 if ($GLOBALS["APPLICATION"]->GetGroupRight("forum") < "W") {
     $arFilter["PERMS"] = array($GLOBALS["USER"]->GetGroups(), 'A');
     $arFilter["ACTIVE"] = "Y";
 }
 $cache_id = "forum_forums_" . serialize($arFilter);
 if (($tzOffset = CTimeZone::GetOffset()) != 0) {
     $cache_id .= "_" . $tzOffset;
 }
 $cache_path = $cache_path_main . "forums";
 if ($arParams["CACHE_TIME"] > 0 && $cache->InitCache($arParams["CACHE_TIME"], $cache_id, $cache_path)) {
     $res = $cache->GetVars();
     $arForums = CForumCacheManager::Expand($res["arForums"]);
 }
 $arForums = is_array($arForums) ? $arForums : array();
 if (empty($arForums)) {
     $db_res = CForumNew::GetListEx(array("FORUM_GROUP_SORT" => "ASC", "FORUM_GROUP_ID" => "ASC", "SORT" => "ASC", "NAME" => "ASC"), $arFilter);
     if ($db_res && ($res = $db_res->GetNext())) {
         do {
             $arForums[$res["ID"]] = $res;
         } while ($res = $db_res->GetNext());
     }
     if ($arParams["CACHE_TIME"] > 0) {
         $cache->StartDataCache($arParams["CACHE_TIME"], $cache_id, $cache_path);
         $cache->EndDataCache(array("arForums" => CForumCacheManager::Compress($arForums)));
     }
 }
 $arResult["FORUMS"] = $arForums;
Example #2
0
                $res["user_start_id_profile"] = $res["URL"]["AUTHOR"];
                // For custom
                $res["read"] = $res["URL"]["READ"];
                // For custom
                $arTopics[] = $res;
            }
        }
    }
    $arResult['TOPICS'] = CForumCacheManager::Compress($arTopics);
    $arResult['FORUMS'] = CForumCacheManager::Compress($arForums);
    $this->EndResultCache();
    $arResult['TOPICS'] = $arTopics;
    $arResult['FORUMS'] = $arForums;
} else {
    $arResult['TOPICS'] = CForumCacheManager::Expand($arResult['TOPICS']);
    $arResult['FORUMS'] = CForumCacheManager::Expand($arResult['FORUMS']);
}
$arResult["TOPIC"] = $arResult["TOPICS"];
// For custom
$arResult["FORUM"] = $arResult["FORUMS"];
// For custom
$this->IncludeComponentTemplate();
/********************************************************************
			Data
********************************************************************/
if ($arParams["SET_NAVIGATION"] != "N") {
    $APPLICATION->AddChainItem(GetMessage("FTP_INDEX"), CComponentEngine::MakePathFromTemplate($arParams["URL_TEMPLATES_INDEX"], array()));
}
if ($arParams["SET_TITLE"] != "N") {
    $APPLICATION->SetTitle(GetMessage("FTP_TITLE"));
}