summaryrefslogtreecommitdiff
path: root/sites/all/modules/views/modules/comment/views_handler_filter_ncs_last_updated.inc
diff options
context:
space:
mode:
Diffstat (limited to 'sites/all/modules/views/modules/comment/views_handler_filter_ncs_last_updated.inc')
-rw-r--r--sites/all/modules/views/modules/comment/views_handler_filter_ncs_last_updated.inc25
1 files changed, 25 insertions, 0 deletions
diff --git a/sites/all/modules/views/modules/comment/views_handler_filter_ncs_last_updated.inc b/sites/all/modules/views/modules/comment/views_handler_filter_ncs_last_updated.inc
new file mode 100644
index 000000000..2319edffd
--- /dev/null
+++ b/sites/all/modules/views/modules/comment/views_handler_filter_ncs_last_updated.inc
@@ -0,0 +1,25 @@
+<?php
+
+/**
+ * @file
+ * Definition of views_handler_filter_ncs_last_updated.
+ */
+
+/**
+ * Filter handler for the newer of last comment / node updated.
+ *
+ * @ingroup views_filter_handlers
+ */
+class views_handler_filter_ncs_last_updated extends views_handler_filter_date {
+ function query() {
+ $this->ensure_my_table();
+ $this->node_table = $this->query->ensure_table('node', $this->relationship);
+
+ $field = "GREATEST(" . $this->node_table . ".changed, " . $this->table_alias . ".last_comment_timestamp)";
+
+ $info = $this->operators();
+ if (!empty($info[$this->operator]['method'])) {
+ $this->{$info[$this->operator]['method']}($field);
+ }
+ }
+}