本文整理汇总了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"]));