Commit 66ad60bd authored by merlinofchaos's avatar merlinofchaos

Patch 69975 by tombias maier: allow filter on comment count

parent 912718e8
......@@ -37,7 +37,7 @@ function comment_views_tables() {
'name' => t('Comment: Last Comment Time'),
'sortable' => true,
'handler' => views_handler_field_dates(),
'option' => string,
'option' => 'string',
'help' => t('This will display the last comment time.'),
),
'last_comment_name' => array(
......@@ -58,12 +58,20 @@ function comment_views_tables() {
'help' => t('This will display the comment count.'),
),
),
'filters' => array(
'comment_count' => array(
'name' => t('Node: Comment Count'),
'operator' => 'views_handler_operator_gtlt',
'option' => 'integer',
'help' => t('This filter allows you to filter by the amount of comments.'),
),
),
'sorts' => array(
'last_comment_timestamp' => array(
'name' => t('Comment: Last Comment Date'),
'help' => t('This will allow you to sort by the date of the most recent comment on a node.')
)
)
),
),
);
return $tables;
}
......
......@@ -183,6 +183,8 @@ function views_handler_field_username($fieldinfo, $fielddata, $value, $data) {
$obj->name = $value;
$uidfield = $fielddata['tablename'] . "_" . $fieldinfo['uid'];
$obj->uid = $data->$uidfield;
dprint_r($obj);
dprint_r($data);
return theme('username', $obj);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment