S
S
Skrolea2016-11-22 15:55:44
1C-Bitrix
Skrolea, 2016-11-22 15:55:44

How to add images to the mailing list?

Good afternoon. There is a news feed with thumbnails. A mailing list is created without.

<?$arFilter =Array("IBLOCK_ID"=>IntVal(62), "SECTION_ID" => array(892,1712,3800), ">=DATE_ACTIVE_FROM"=>date($DB->DateFormatToPHP(CLang::GetDateFormat("SHORT")), mktime(0,0,0,date("m"),date("d"),date("Y"))), "<DATE_ACTIVE_FROM"=>date($DB->DateFormatToPHP(CLang::GetDateFormat("SHORT")), mktime(0,0,0,date("m"),date("d")+1,date("Y"))),"ACTIVE"=>"Y");
          $rsNews = CIBlockElement::GetList(Array('DATE_ACTIVE_FROM'=>'DESC'), $arFilter);

          if($arNews = $rsNews->GetNextElement()):
          do
          {
            $arItem = $arNews->GetFields();?> 
            <div style="padding: 5px 0">
              <div class="date"><?echo ConvertDateTime($arItem["DATE_ACTIVE_FROM"], "DD-MM-YYYY HH:MI");?></div>
              <h3><a href="http://<?echo $arSite["SERVER_NAME"].$arItem["DETAIL_PAGE_URL"]?>"><?echo $arItem["NAME"];?></a></h3>
              <div><?echo $arItem["PREVIEW_TEXT"];?></div>
            </div>
          <?
        }
        while($arNews = $rsNews->GetNextElement());
      
        endif;
        ?> 

                      </div>
         </td>
                    </tr>
 			</table>


      <?
      $arFilter =Array("IBLOCK_ID"=>IntVal(62), "SECTION_ID" => array(2713), ">=DATE_ACTIVE_FROM"=>date($DB->DateFormatToPHP(CLang::GetDateFormat("SHORT")), mktime(0,0,0,date("m"),date("d"),date("Y"))), "<DATE_ACTIVE_FROM"=>date($DB->DateFormatToPHP(CLang::GetDateFormat("SHORT")), mktime(0,0,0,date("m"),date("d")+1,date("Y"))),"ACTIVE"=>"Y");
      $rsNews = CIBlockElement::GetList(Array('DATE_CREATE'=>'DESC'), $arFilter);
        if($arNews = $rsNews->GetNextElement()):
          do
          {
            $ddd=$ddd+1;
            $arItem = $arNews->GetFields();
            $itt[$ddd]=$arItem["NAME"];
          }
          
        while($arNews = $rsNews->GetNextElement());
      
        endif;
    
        $imtes_count=count($itt);
        if ($imtes_count>0):
        ?>

What do I need to add in order for the images to be displayed in the mailing list?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
Sergey, 2016-11-22
@gangstarcj

I don’t see where you have PREVIEW_PICTURE displayed?

M
MyMac, 2018-01-30
@MyMac

<?
if($arItem["PREVIEW_PICTURE"])
{
echo '<img src="'.$arItem["PREVIEW_PICTURE"]["SRC"].'" width="'.$arItem["PREVIEW_PICTURE"]["WIDTH"].'"  height="'.$arItem["PREVIEW_PICTURE"]["HEIGHT"].'">';
}

?>

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question