Имеем: созданный раздел, компонент RSS новости (импорт)-настройки компонента заскриншотины
И вот такой вот код шаблона компонента:
<?
if(!defined("B_PROLOG_INCLUDED" || B_PROLOG_INCLUDED!==true)die();?>
<div class="rss-show">
<?
if(is_array($arResult["item"] ):
foreach($arResult["item"] as $arItem):?>
<?if(strlen($arItem["enclosure"]["url"] >0):?>
<img src="<?=$arItem["enclosure"]["url"]?>" alt="<?=$arItem["enclosure"]["url"]?>" /><br />
<?endif;?>
<?if(strlen($arItem["link"] >0):?>
"><?=$arItem["title"]?>
<?else:?>
<?=$arItem["title"]?>
<?endif;?>
<?
//Обработка html текста
//$str = '<h1>T1</h1>Lorem ipsum.<h1>T2</h1>The quick red fox...<h1>T3</h1>... jumps over the lazy brown FROG';
$new_text = preg_replace("/<p.*?>.*?<\/p.*?>/si", "", $arItem["description"],1);
$new_text = preg_replace("/<div style=\"padding:.*?>.*?<\/div.*?>/si", "", $new_text,1);
echo $new_text;
?>
<br /><br />
<?endforeach;
endif;?>
</div>
В чем может быть дело?
И вот такой вот код шаблона компонента:
<?
if(!defined("B_PROLOG_INCLUDED" || B_PROLOG_INCLUDED!==true)die();?>
<div class="rss-show">
<?
if(is_array($arResult["item"] ):
foreach($arResult["item"] as $arItem):?>
<?if(strlen($arItem["enclosure"]["url"] >0):?>
<img src="<?=$arItem["enclosure"]["url"]?>" alt="<?=$arItem["enclosure"]["url"]?>" /><br />
<?endif;?>
<?if(strlen($arItem["link"] >0):?>
<?else:?>
<?=$arItem["title"]?>
<?endif;?>
<?
//Обработка html текста
//$str = '<h1>T1</h1>Lorem ipsum.<h1>T2</h1>The quick red fox...<h1>T3</h1>... jumps over the lazy brown FROG';
$new_text = preg_replace("/<p.*?>.*?<\/p.*?>/si", "", $arItem["description"],1);
$new_text = preg_replace("/<div style=\"padding:.*?>.*?<\/div.*?>/si", "", $new_text,1);
echo $new_text;
?>
<br /><br />
<?endforeach;
endif;?>
</div>
В чем может быть дело?