_item.php 2.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. <?php
  2. /**
  3. * @var $model \app\models\base\Comments
  4. */
  5. /*
  6. * <div class="comment-item" data-author="<?=$model->author?>" id="comment-<?=$model->id?>">
  7. <div class="message"><?=$model->message?></div>
  8. <div class="meta"><?=$model->getPublishedAt()?>, <?=$model->author?>&nbsp;&nbsp;&nbsp;<a class="answer" href="javascript:void(0)" onclick="answer(this)">Ответить</a></div>
  9. </div>
  10. */
  11. $md = $model->getHash();
  12. $GLOBALS['umd_'.$md] = isset( $GLOBALS['umd_'.$md] )?$GLOBALS['umd_'.$md]:0;
  13. $GLOBALS['umd_'.$md]++;
  14. $message = $model->message;
  15. $message = str_replace(['[[',']]',"\n"],['<span>','</span>',''],$message);
  16. //var_dump($model->islike);
  17. ?>
  18. <a href="javascript:void(0)" class="link-B disabled" name="<?=$md?>_<?=$GLOBALS['umd_'.$md]?>" aria-disabled="true" disabled></a>
  19. <?
  20. $lavel = ($lavel > 4)?4:$lavel;
  21. for( $i = 0; $i < $lavel; $i++){
  22. ?>
  23. <div class="ml-4">
  24. <?}?>
  25. <div class="media-block user-block" id="comment-<?=$model->id?>" data-author="<?=$model->author?>" data-id="<?=$model->id?>" data-time="<?=$model->getPublishedAt(true)?>">
  26. <a class="media-left" href="#<?=$md?>_<?=$GLOBALS['umd_'.$md]+1?>"><img class="rounded-circle mr-3" alt="Avatar Picture" loading="lazy" src="<?=$model->getAvatar()?>"></a>
  27. <div class="media-body">
  28. <div class="mar-btm">
  29. <a href="#<?=$md?>_<?=$GLOBALS['umd_'.$md]+1?>" class="btn-link text-semibold media-heading box-inline"><?=$model->author?></a>
  30. <p class="text-muted text-sm"><svg class="icon icon-comments" width="12px" height="12px"><use xlink:href="/svg/symbol/sprite-clear.svg#clock"></use></svg> <?=$model->getPublishedAt(true)?></p>
  31. </div>
  32. <p><?=$message?></p>
  33. <div class="pad-ver">
  34. <span class="tag tag-sm"><svg class="icon icon-comments" width="14px" height="14px"><use xlink:href="/svg/symbol/sprite-clear.svg#yy"></use></svg>&nbsp;&nbsp;<span id="cnt_<?=$model->id?>"><?=$model->likeed?></span> Нравится</span>
  35. <div class="btn-group">
  36. <a class="btn btn-sm btn-outline-secondary btn-hover-secondary btnlike<?=$model->islike?' disabled':''?>" href="javascript:void(0)" onclick="clike(1,<?=$model->id?>,this)"<?=$model->islike?' disabled':''?>>
  37. <svg class="icon icon-comments" width="15px" height="15px"><use xlink:href="/svg/symbol/sprite-clear.svg#up"></use></svg>
  38. </a>
  39. <a class="btn btn-sm btn-outline-secondary btn-hover-secondary btnlike<?=$model->islike?' disabled':''?>" href="javascript:void(0)" onclick="clike(-1,<?=$model->id?>,this)"<?=$model->islike?' disabled':''?>>
  40. <svg class="icon icon-comments" width="15px" height="15px"><use xlink:href="/svg/symbol/sprite-clear.svg#down"></use></svg></a>
  41. </div>
  42. <a class="btn btn-sm btn-outline-secondary" href="javascript:void(0)" onclick="answer(this)">Ответить</a>
  43. </div>
  44. <hr>
  45. </div>
  46. </div>
  47. <?
  48. for( $i = 0; $i < $lavel; $i++){
  49. ?>
  50. </div>
  51. <?}?>