commentsView.inc 1.2 KB

1234567891011121314151617181920212223242526272829303132
  1. <?php
  2. $humanReadableTime = new HumanReadableTime();
  3. foreach ($comments as $commentData) {
  4. ?>
  5. <div class="comment" id="comment<?=$commentData['comment_id']?>">
  6. <div class="commentByline"><?=$commentData['display_name']?> - <?=$humanReadableTime->formatString($commentData['timestamp'])?><?=$commentData['is_edited'] ? '*' : ''?></div>
  7. <p class="contents"><?=$commentData['content']?></p>
  8. <?php include "commentAttachmentsView.inc"?>
  9. <div class="editWindow" style="display:none;">
  10. <?php include "editCommentView.inc"; ?>
  11. </div>
  12. <?php if(isset($userId)) {?>
  13. <div class="commentActions">
  14. <a data-id="<?=$commentData['comment_id']?>" class="toggleCommentReply" href="javascript:;">reply</a>
  15. <?php if ($commentData['user_id'] == $userId) { ?>
  16. <a data-id="<?=$commentData['comment_id']?>" class="openCommentEdit" href="javascript:;">edit</a>
  17. <?php } ?>
  18. </div>
  19. <?php } ?>
  20. <?php
  21. include "commentReplyView.inc";
  22. ?>
  23. <?php if($commentData['replies'] > 0) {?>
  24. <div class="replies">
  25. <a data-id="<?=$commentData['comment_id']?>"
  26. class="loadCommentReplies" href="javascript:;">View replies (<?=$commentData['replies']?>)</a>
  27. </div>
  28. <?php } ?>
  29. </div>
  30. <?php
  31. }
  32. ?>