<?if(CModule::IncludeModule("iblock")):
$arSelect = Array("ID", "DETAIL_PAGE_URL");
$arFilter = Array("IBLOCK_ID"=>12, "ACTIVE"=>"Y");
$res = CIBlockElement::GetList(Array("ACTIVE_FROM"=>"DESC", "SORT"=>"ASC"), $arFilter, false, false, $arSelect);
$prev = ""; $next = ""; $count_news = 0;
while($ob = $res->GetNext()):
if($_REQUEST['id'] == $ob['ID']):
$ob = $res->GetNext();
$prev = $ob['DETAIL_PAGE_URL'];
if($count_news == 0) $next = $null;
break;
else:
$next = $ob['DETAIL_PAGE_URL'];
$count_news++;
endif;
?>
<?endwhile;?>
<div class="detail-navigation">
<?if(isset($prev)):?>
<a href="<?=$prev;?>" class="detail-prev" title="Предыдущая">« Предыдущая</a>
<?endif;?>
<a href="/news/" class="detail-list" title="Вернуться к списку">Вернуться к списку</a>
<?if(isset($next)):?>
<a href="<?=$next;?>" class="detail-next" title="Следующая">Следующая »</a>
<?endif;?>
<?endif;?>
</div> |