/halogy/application/modules/blog/views/admin/comments.php

https://bitbucket.org/haloweb/halogy-1.0/ · PHP · 43 lines · 34 code · 9 blank · 0 comment · 1 complexity · c29cd2f12efb55110bf18d635e91bdac MD5 · raw file

  1. <h1>Blog comments</h1>
  2. <?php if ($comments): ?>
  3. <?php echo $this->pagination->create_links(); ?>
  4. <table class="default clear">
  5. <tr>
  6. <th>Date Posted</th>
  7. <th>Post</th>
  8. <th>Author</th>
  9. <th>Email</th>
  10. <th>Comment</th>
  11. <th>Status</th>
  12. <th class="tiny">&nbsp;</th>
  13. <th class="tiny">&nbsp;</th>
  14. </tr>
  15. <?php foreach ($comments as $comment): ?>
  16. <tr>
  17. <td><?php echo dateFmt($comment['dateCreated']); ?></td>
  18. <td><?php echo anchor('/blog/'.dateFmt($comment['uriDate'], 'Y/m/').$comment['uri'], $comment['postTitle']); ?></td>
  19. <td><?php echo $comment['fullName']; ?></td>
  20. <td><?php echo $comment['email']; ?></td>
  21. <td><small><?php echo (strlen($comment['comment'] > 50)) ? htmlentities(substr($comment['comment'], 0, 50)).'...' : htmlentities($comment['comment']); ?></small></td>
  22. <td><?php echo ($comment['active']) ? '<span style="color:green;">Active</span>' : '<span style="color:orange;">Pending</span>'; ?></td>
  23. <td><?php echo (!$comment['active']) ? anchor('/admin/blog/approve_comment/'.$comment['commentID'], 'Approve') : ''; ?></td>
  24. <td>
  25. <?php echo anchor('/admin/blog/delete_comment/'.$comment['commentID'], 'Delete', 'onclick="return confirm(\'Are you sure you want to delete this?\')"'); ?>
  26. </td>
  27. </tr>
  28. <?php endforeach; ?>
  29. </table>
  30. <?php echo $this->pagination->create_links(); ?>
  31. <p style="text-align: right;"><a href="#" class="button grey" id="totop">Back to top</a></p>
  32. <?php else: ?>
  33. <p class="clear">There are no comments yet.</p>
  34. <?php endif; ?>