Advertisement
Guest User

Untitled

a guest
Nov 20th, 2017
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.53 KB | None | 0 0
  1. foreach($comments as $comment){
  2.  
  3. foreach($comment as $key => $value) {
  4. $comment[$key] = htmlentities($value, ENT_QUOTES, "UTF-8");
  5. }
  6.  
  7. $comment["author"] = $commentDAO->selectAuthorById($comment["author_id"]);
  8. $date = strtotime($comment["date"]);
  9.  
  10. echo
  11. "<li class='forum-post-comment'>
  12. <span class='forum-post-comment-body'>" . $comment["body"] ."</span>
  13. <span class='forum-post-comment-date'>posted " . date('h:i', $date) . " on " . date('d-m', $date) . "</span>
  14. <span class='forum-post-comment-author'>
  15. <a id='profile-link' href='profile.php?id=" . $comment["author"]["id"] . "'>" . htmlentities($comment["author"]["username"], ENT_QUOTES, "UTF-8") . "</a>
  16. </span>
  17. </li>";
  18. }
  19. echo "</ul>";
  20. }
  21.  
  22.  
  23.  
  24.  
  25.  
  26. foreach($comments as $comment){
  27.  
  28. foreach($comment as $key => $value) {
  29. $comment[$key] = htmlentities($value, ENT_QUOTES, "UTF-8");
  30. }
  31.  
  32. $comment["author"] = $commentDAO->selectAuthorById($comment["author_id"]);
  33. $date = strtotime($comment["date"]);
  34.  
  35. echo
  36. "<li class='forum-post-comment'>
  37. <span class='forum-post-comment-body'>" . $comment["body"] ."</span>
  38. <span class='forum-post-comment-date'>posted " . date('h:i', $date) . " on " . date('d-m', $date) . "</span>
  39. <span class='forum-post-comment-author'>
  40. <a id='profile-link' href='profile.php?id=" . $comment["author"]["id"] . "'>" . $comment["author"]["username"] . "</a>
  41. </span>
  42. </li>";
  43. }
  44. echo "</ul>";
  45. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement