<?
if (CModule::IncludeModule('iblock')) {
$arElements = array();
$arSelect = Array("ID", "NAME", "DETAIL_PAGE_URL");
$arFilter = Array("IBLOCK_ID" => 26);
$dbElements1 = CIBlockElement::GetList(array(), $arFilter, false, false, $arSelect);;
$dbElements1->SetUrlTemplates('/catalog/#SECTION_CODE#/#ELEMENT_ID#/');
while ($arElement = $dbElements1->GetNext()) {
$arElements[$arElement['ID']]['old_url'] = $arElement['DETAIL_PAGE_URL'];
}
$dbElements2 = CIBlockElement::GetList(array(), $arFilter, false, false, $arSelect);;
$dbElements2->SetUrlTemplates('/catalog/#SECTION_CODE#/#ELEMENT_CODE#/');
while ($arElement = $dbElements2->GetNext()) {
$arElements[$arElement['ID']]['new_url'] = $arElement['DETAIL_PAGE_URL'];
}
echo '<pre>';
var_dump($arElements);
echo '</pre>';
die();
}
?>