Причем такая фигня: для новостей в одной папке лежат два файла в шаблонах last.php и index.php
В о втоором прекрасно дату отображает, а в первом нет!
Вот файлы
index.php - в котором все работает
Цитата |
---|
<? IncludeTemplateLangFile(__FILE__);
$IBLOCK_TYPE = (strlen($IBLOCK_TYPE)>0 ? $IBLOCK_TYPE : "articles"); $IBLOCK_SORT_BY = (isset($IBLOCK_SORT_BY) ? $IBLOCK_SORT_BY : "SORT"); $IBLOCK_SORT_ORDER = (isset($IBLOCK_SORT_ORDER) ? $IBLOCK_SORT_ORDER : "ASC"); $IBLOCK_SORT = Array($IBLOCK_SORT_BY=>$IBLOCK_SORT_ORDER); $NEWS_COUNT = (strlen($NEWS_COUNT)>0 ? intval($NEWS_COUNT) : "5");
$SORT_BY1 = (isset($SORT_BY1) ? $SORT_BY1 : "ACTIVE_FROM"); $SORT_ORDER1 = (isset($SORT_ORDER1) ? $SORT_ORDER1 : "DESC"); $SORT_BY2 = (isset($SORT_BY2) ? $SORT_BY2 : "SORT"); $SORT_ORDER2 = (isset($SORT_ORDER2) ? $SORT_ORDER2 : "ASC");
$SORT = Array($SORT_BY1=>$SORT_ORDER1, $SORT_BY2=>$SORT_ORDER2);
$CACHE_TIME = intval($CACHE_TIME); $CACHE_ID = SITE_ID."|".$APPLICATION->GetCurPage()."|".md5(serialize($arParams))."|".$USER->GetGroups();
$APPLICATION->SetTitle(GetMessage("T_NEWS_INDEX_TITLE"));
$cache = new CPageCache; if($cache->StartDataCache($CACHE_TIME, $CACHE_ID)) { if(!CModule::IncludeModule("iblock")): echo ShowError(GetMessage("T_NEWS_INDEX_MODULE_NA")); else: //if(!CModule::IncludeModule("iblock")): $iblocks = GetIBlockList($IBLOCK_TYPE, Array(), Array(), $IBLOCK_SORT); while($arIBlock = $iblocks->GetNext()): $arIBlockElement = GetIBlockElement($IBLOCK_TYPE); ?> <!-- <font class="text"> [url=<?echo $arIBlock[]"><?echo $arIBlock["NAME"]?>[/url]<br><br></font> --> <?$items = GetIBlockElementList($arIBlock["ID"], false, $SORT, $NEWS_COUNT); ?>
<?while($obItem = $items->GetNextElement()): $arItem = $obItem->GetFields(); $arProps = $obItem->GetProperties(); $arLinkProp = $arProps["DOC_LINK"]; ?> <?if ($arItem["PREVIEW_PICTURE"]):?> <?echo ShowImage($arItem["PREVIEW_PICTURE"], 66, 78, "class='main' hspace='2' vspace='2' align='left' border='3' ", $arItem["DETAIL_PAGE_URL"]);?> | | | <?endif;?>
<font class="text"><?echo $arItem["ACTIVE_FROM"]?></font><? if (strlen($arItem["ACTIVE_FROM"])>0):?> | <?endif;?> <font class="text"> <?if ($arItem["DETAIL_TEXT"] && !$arLinkProp["VALUE"]):?>[url=<?echo $arItem[]"><?elseif ($arLinkProp["VALUE"]):?><a href="<?echo $arLinkProp["VALUE"];?>"><?endif;?><?=$arItem["NAME"]?><?if ($arItem["DETAIL_TEXT"] || $arLinkProp["VALUE"]):?>[/url]<?endif;?> </font><br><font class="prot"> <?echo $arProps["writer"]["VALUE"];?>, <br> <?echo $arProps["country"]["VALUE"];?>, <br> <?$arDATE = ParseDate($arItem ["DATE_CREATE"],"dmy"); echo $arDATE["0"]." ".GetMessage("MONTH_".intval($arDATE["1"])."_S")." ".$arDATE["2"];?> </font> <br>
<font class="text"><?if ($arItem["PREVIEW_TEXT"]):?><?echo $arItem["PREVIEW_TEXT"];?><br><?endif;?></font> | | <?endwhile;?> | <?endwhile;?> <?endif //if(!CModule::IncludeModule("iblock")):?> <? $cache->EndDataCache(); } //if($cache->StartDataCache($CACHE_TIME, SITE_ID."|".$APPLICATION->GetCurPage())) ?> |
last.php - в который возвращает пустую строку
Цитата |
---|
<? IncludeTemplateLangFile(__FILE__);
$IBLOCK_TYPE = (strlen($IBLOCK_TYPE)>0 ? $IBLOCK_TYPE : "articles"); $IBLOCK_SORT_BY = (isset($IBLOCK_SORT_BY) ? $IBLOCK_SORT_BY : "SORT"); $IBLOCK_SORT_ORDER = (isset($IBLOCK_SORT_ORDER) ? $IBLOCK_SORT_ORDER : "ASC"); $IBLOCK_SORT = Array($IBLOCK_SORT_BY=>$IBLOCK_SORT_ORDER); $NEWS_COUNT = (strlen($NEWS_COUNT)>0 ? intval($NEWS_COUNT) : "5");
$SORT_BY1 = (isset($SORT_BY1) ? $SORT_BY1 : "ACTIVE_FROM"); $SORT_ORDER1 = (isset($SORT_ORDER1) ? $SORT_ORDER1 : "DESC"); $SORT_BY2 = (isset($SORT_BY2) ? $SORT_BY2 : "SORT"); $SORT_ORDER2 = (isset($SORT_ORDER2) ? $SORT_ORDER2 : "ASC");
$SORT = Array($SORT_BY1=>$SORT_ORDER1, $SORT_BY2=>$SORT_ORDER2);
$CACHE_TIME = intval($CACHE_TIME); $CACHE_ID = SITE_ID."|".$APPLICATION->GetCurPage()."|".md5(serialize($arParams))."|".$USER->GetGroups();
$APPLICATION->SetTitle(GetMessage("T_NEWS_INDEX_TITLE"));
$cache = new CPageCache; if($cache->StartDataCache($CACHE_TIME, $CACHE_ID)) { if(!CModule::IncludeModule("iblock")): echo ShowError(GetMessage("T_NEWS_INDEX_MODULE_NA")); else: //if(!CModule::IncludeModule("iblock")): $iblocks = GetIBlockList($IBLOCK_TYPE, Array(), Array(), $IBLOCK_SORT); while($arIBlock = $iblocks->GetNext()): $arIBlockElement = GetIBlockElement($IBLOCK_TYPE); ?> <!-- <font class="text"> [url=<?echo $arIBlock[]"><?echo $arIBlock["NAME"]?>[/url]<br><br></font> --> <?$items = GetIBlockElementList($arIBlock["ID"], false, $SORT, $NEWS_COUNT); ?>
<?while($obItem = $items->GetNextElement()): $arItem = $obItem->GetFields(); $arProps = $obItem->GetProperties(); $arLinkProp = $arProps["DOC_LINK"]; ?> <?if ($arItem["PREVIEW_PICTURE"]):?> <?echo ShowImage($arItem["PREVIEW_PICTURE"], 48, 57, "class='main' hspace='2' vspace='2' align='left' border='3' ", $arItem["DETAIL_PAGE_URL"]);?> | | | <?endif;?>
<font class="text"><?echo $arItem["ACTIVE_FROM"]?></font><? if (strlen($arItem["ACTIVE_FROM"])>0):?> | <?endif;?> <font class="text"> <?if ($arItem["DETAIL_TEXT"] && !$arLinkProp["VALUE"]):?>[url=<?echo $arItem[]"><?elseif ($arLinkProp["VALUE"]):?><a href="<?echo $arLinkProp["VALUE"];?>"><?endif;?><?=$arItem["NAME"]?><?if ($arItem["DETAIL_TEXT"] || $arLinkProp["VALUE"]):?>[/url]<?endif;?> </font> <br>
<font class="protG"> <?echo $arProps["writer"]["VALUE"];?>, <?echo $arProps["country"]["VALUE"];?>, <?$arDATE = ParseDate($arItem ["DATE_CREATE"],"dmy"); echo $arDATE["0"]." ".GetMessage("MONTH_".intval($arDATE["1"])."_S")." ".$arDATE["2"];?> </font> <br>
| | <?endwhile;?> | <?endwhile;?> <?endif //if(!CModule::IncludeModule("iblock")):?> <? $cache->EndDataCache(); } //if($cache->StartDataCache($CACHE_TIME, SITE_ID."|".$APPLICATION->GetCurPage())) ?> |