本文整理匯總了PHP中CForumUser::GetUserTopicVisits方法的典型用法代碼示例。如果您正苦於以下問題:PHP CForumUser::GetUserTopicVisits方法的具體用法?PHP CForumUser::GetUserTopicVisits怎麽用?PHP CForumUser::GetUserTopicVisits使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類CForumUser
的用法示例。
在下文中一共展示了CForumUser::GetUserTopicVisits方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: array
global $CACHE_MANAGER;
$cache_path = $CACHE_MANAGER->GetCompCachePath(CComponentEngine::MakeComponentPath($this->__name));
$arCacheID = array($arResult["PERMISSION"] < "Q", $arParams['FID'], CTimeZone::GetOffset(), $by => $order);
$cache_id = "forum_topics_" . md5(serialize($arCacheID));
if ($PAGEN == null && $arParams["CACHE_TIME"] > 0 && defined("BX_COMP_MANAGED_CACHE")) {
if ($cache->InitCache($arParams["CACHE_TIME"], $cache_id, $cache_path)) {
$res = $cache->GetVars();
$arResult["Topics"] = $res["Topics"];
$arResult["NAV_STRING"] = $res['NAV_STRING'];
$arResult["NAV_PAGE"] = $res['NAV_PAGE'];
// get last_visit dates
$arTopics = array();
foreach ($arResult['Topics'] as $arTopic) {
$arTopics[] = $arTopic['ID'];
}
$arVisit = CForumUser::GetUserTopicVisits($arParams["FID"], $arTopics);
if (!empty($arVisit)) {
foreach ($arResult['Topics'] as $topicIndex => $arTopic) {
if (isset($arVisit[$arTopic['ID']])) {
$arResult['Topics'][$topicIndex]['LAST_VISIT'] = $arVisit[$arTopic['ID']];
}
}
}
}
}
/*******************************************************************
/ CACHE
*******************************************************************/
if (empty($arResult["Topics"])) {
/*******************************************************************/
$db_res = CForumTopic::GetListEx(array("SORT" => "ASC", $by => $order), $arFilter, false, false, array("bDescPageNumbering" => $arParams["USE_DESC_PAGE"] == "Y", "nPageSize" => $arParams["TOPICS_PER_PAGE"], "bShowAll" => false, "sNameTemplate" => $arParams["NAME_TEMPLATE"]));