function comment_views_default_views in Views (for Drupal 7) 5
Same name and namespace in other branches
- 6.3 modules/comment.views_default.inc \comment_views_default_views()
- 6.2 modules/comment.views_default.inc \comment_views_default_views()
- 7.3 modules/comment.views_default.inc \comment_views_default_views()
File
- modules/
views_comment.inc, line 283
Code
function comment_views_default_views() {
$view = new stdClass();
$view->name = 'comments_recent';
$view->description = t('Display recent comments block');
$view->access = array();
$view->view_args_php = '';
$view->block = TRUE;
$view->block_title = t('Recent comments');
$view->block_header = "";
$view->block_header_format = '1';
$view->block_footer = "";
$view->block_footer_format = '1';
$view->block_empty = "";
$view->block_empty_format = '1';
$view->block_type = 'list';
$view->nodes_per_block = '10';
$view->block_more = '0';
$view->block_use_page_header = FALSE;
$view->block_use_page_footer = FALSE;
$view->block_use_page_empty = FALSE;
$view->sort = array(
array(
'tablename' => 'comments',
'field' => 'timestamp',
'sortorder' => 'DESC',
'options' => '',
),
);
$view->argument = array();
$view->field = array(
array(
'tablename' => 'comments',
'field' => 'subject',
'label' => '',
'handler' => 'views_handler_field_commentlink',
'options' => 'link',
),
array(
'tablename' => 'comments',
'field' => 'name',
'label' => '',
),
array(
'tablename' => 'comments',
'field' => 'timestamp',
'label' => '',
'handler' => 'views_handler_field_date_small',
),
);
$view->filter = array(
array(
'tablename' => 'node_comment_statistics',
'field' => 'comment_count',
'operator' => '>=',
'options' => '',
'value' => '1',
),
array(
'tablename' => 'comments',
'field' => 'status',
'operator' => '=',
'options' => '',
'value' => '0',
),
);
$view->exposed_filter = array();
$view->requires = array(
comments,
node_comment_statistics,
);
$views[$view->name] = $view;
return $views;
}