views_handler_field_last_comment_timestamp.inc

  1. 3.x modules/comment/views_handler_field_last_comment_timestamp.inc
  2. 2.x modules/comment/views_handler_field_last_comment_timestamp.inc

Definition of views_handler_field_last_comment_timestamp.

File

modules/comment/views_handler_field_last_comment_timestamp.inc
View source
  1. <?php
  2. /**
  3. * @file
  4. * Definition of views_handler_field_last_comment_timestamp.
  5. */
  6. /**
  7. * Field handler to display the timestamp of a comment with the count of comments.
  8. *
  9. * @ingroup views_field_handlers
  10. */
  11. class views_handler_field_last_comment_timestamp extends views_handler_field_date {
  12. function construct() {
  13. parent::construct();
  14. $this->additional_fields['comment_count'] = 'comment_count';
  15. }
  16. function render($values) {
  17. $comment_count = $this->get_value($values, 'comment_count');
  18. if (empty($this->options['empty_zero']) || $comment_count) {
  19. return parent::render($values);
  20. }
  21. else {
  22. return NULL;
  23. }
  24. }
  25. }