- Модуль: fileman
- Путь к файлу: ~/bitrix/modules/fileman/classes/general/sticker.php
- Класс: CSticker
- Вызов: CSticker::GetPagesList
static function GetPagesList($site)
{
if (!CSticker::CanDoOperation('sticker_view'))
return false;
global $USER, $DB;
$userId = $USER->GetId();
$cachePath = "stickers/";
$cacheTime = 36000000;
$bCache = true;
if ($bCache)
{
$cache = new CPHPCache;
$cacheId = 'page_list_'.$userId;
if ($cache->InitCache($cacheTime, $cacheId, $cachePath))
{
$cachedRes = $cache->GetVars();
if (!empty($cachedRes['page_list']))
return $cachedRes['page_list'];
}
}
$err_mess = (CSticker::GetErrorMess())."
Function: GetPagesList
Line: ";
$strSql = "
select PAGE_URL, PAGE_TITLE, max(DATE_UPDATE) as MAX_DATE_UPDATE
from b_sticker
where
DELETED='N'
AND SITE_ID='".$DB->ForSql($site)."'
AND ((PERSONAL='Y' AND CREATED_BY=".intval($userId).") OR PERSONAL='N')
group by PAGE_URL, PAGE_TITLE
order by MAX_DATE_UPDATE desc";
$strSql = $DB->TopSQL($strSql, 10);
$res = $DB->Query($strSql, false, $err_mess.__LINE__);
$arResult = array();
while($arRes = $res->Fetch())
$arResult[] = $arRes;
if ($bCache)
{
$cache->StartDataCache($cacheTime, $cacheId, $cachePath);
$cache->EndDataCache(array("page_list" => $arResult));
}
return $arResult;
}