P
P
Pashchuk Ilya2015-08-12 20:45:19
1C-Bitrix
Pashchuk Ilya, 2015-08-12 20:45:19

The avatar of the Bitrix forum comments component is not displayed?

Hello, dear colleagues, I can’t understand why, the user’s avatar is not displayed in the comments on Bitrix?
Comments to the infoblock were connected from the forum component, please help me
understand the code:

<? foreach( $arResult["MESSAGES"] as $aMessage ):?>
    <div class="comment">      
  <?if(is_array($res["AVATAR"]) && array_key_exists("HTML", $res["AVATAR"])):?>
    <img class="comment__avatar" src="<?=$res["AVATAR"]["HTML"]?>" alt="">
  <?else:?>
    <img src="/bitrix/components/bitrix/forum.topic.reviews/templates/.default/images/noavatar.gif" border="10" />
  <?endif;?>

      <div class="comment__body">
        <p><span class="comment__author"><?=$aMessage['AUTHOR_NAME']?></span> • <span class="comment__time"><?=FormatDate( 'd.m.Y', strtotime( $aMessage['POST_DATE'] ) )?></span></p>
        <p class="comment__text"><?=$aMessage['POST_MESSAGE']?></p>

        <ul class="comment__icons">
          <li class="comment__icon comment__icon--appreciations"><a href="#">like</a> Нравится / <span><?=$arItem['SHOW_COUNTER']?></span></li>
          <li class="comment__icon comment__icon--comments"><a href="#">Ответить</a> / <span>0</span></li>
        </ul>
      </div>
    </div>
  <? endforeach; ?>
    <? if( $arResult["NAV_RESULT"] && $arResult["NAV_RESULT"]->NavPageCount > 1 ): ?>
        <?=$arResult["NAV_STRING"]?>
    <? endif; ?>

Screenshots: prntscr.com/83uq8w , avatar is present

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander, 2015-08-12
Madzhugin @Suntechnic

So will you show the resulting HTML?
Does $res["AVATAR"]["HTML"] contain the path to the file, and not a ready-made tag? (I don't remember :( )

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question