summaryrefslogtreecommitdiff
path: root/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/comment/views_handler_field_last_comment_timestamp.inc
diff options
context:
space:
mode:
Diffstat (limited to 'kolab.org/www/drupal-7.15/sites/all/modules/views/modules/comment/views_handler_field_last_comment_timestamp.inc')
-rw-r--r--kolab.org/www/drupal-7.15/sites/all/modules/views/modules/comment/views_handler_field_last_comment_timestamp.inc23
1 files changed, 23 insertions, 0 deletions
diff --git a/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/comment/views_handler_field_last_comment_timestamp.inc b/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/comment/views_handler_field_last_comment_timestamp.inc
new file mode 100644
index 0000000..2bfa970
--- /dev/null
+++ b/kolab.org/www/drupal-7.15/sites/all/modules/views/modules/comment/views_handler_field_last_comment_timestamp.inc
@@ -0,0 +1,23 @@
+<?php
+
+/**
+ * Field handler to display the timestamp of a comment with the count of comments.
+ *
+ * @ingroup views_field_handlers
+ */
+class views_handler_field_last_comment_timestamp extends views_handler_field_date {
+ function construct() {
+ parent::construct();
+ $this->additional_fields['comment_count'] = 'comment_count';
+ }
+
+ function render($values) {
+ $comment_count = $this->get_value($values, 'comment_count');
+ if (empty($this->options['empty_zero']) || $comment_count) {
+ return parent::render($values);
+ }
+ else {
+ return NULL;
+ }
+ }
+}