function statistics_views_default_views in Views (for Drupal 7) 5
Same name and namespace in other branches
- 6.3 modules/statistics.views_default.inc \statistics_views_default_views()
- 6.2 modules/statistics.views_default.inc \statistics_views_default_views()
- 7.3 modules/statistics.views_default.inc \statistics_views_default_views()
File
- modules/
views_statistics.inc, line 63
Code
function statistics_views_default_views() {
$view = new stdClass();
$view->name = 'popular_recent';
$view->disabled = TRUE;
$view->description = t('Nodes sorted by recent page-views');
$view->access = array();
$view->view_args_php = '';
$view->page = TRUE;
$view->page_title = t('Recent popular content');
$view->page_header = '';
$view->page_header_format = '1';
$view->page_footer = '';
$view->page_footer_format = '1';
$view->page_empty = '';
$view->page_empty_format = '1';
$view->page_type = 'table';
$view->url = 'popular/latest';
$view->use_pager = TRUE;
$view->nodes_per_page = '20';
$view->menu = TRUE;
$view->menu_title = '';
$view->menu_tab = TRUE;
$view->menu_tab_default = TRUE;
$view->menu_weight = '-1';
$view->block = TRUE;
$view->block_title = t('Recent popular content');
$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 = '5';
$view->block_more = '1';
$view->block_use_page_header = FALSE;
$view->block_use_page_footer = FALSE;
$view->block_use_page_empty = FALSE;
$view->sort = array();
$view->argument = array();
$view->field = array(
array(
'tablename' => 'node',
'field' => 'type',
'label' => t('Type'),
'sortable' => '1',
),
array(
'tablename' => 'node',
'field' => 'title',
'label' => t('Title'),
'handler' => 'views_handler_field_nodelink',
'sortable' => '1',
),
array(
'tablename' => 'users',
'field' => 'name',
'label' => t('Author'),
'sortable' => '1',
),
array(
'tablename' => 'node',
'field' => 'created',
'label' => t('Created'),
'handler' => 'views_handler_field_date_small',
'sortable' => '1',
),
array(
'tablename' => 'node_counter',
'field' => 'daycount',
'label' => t('Recent hits'),
'sortable' => '1',
'defaultsort' => 'DESC',
),
);
$view->filter = array(
array(
'tablename' => 'node',
'field' => 'status',
'operator' => '=',
'options' => '',
'value' => '1',
),
);
$view->requires = array(
node_counter,
node,
users,
);
$views[$view->name] = $view;
$view = new stdClass();
$view->name = 'popular_alltime';
$view->disabled = TRUE;
$view->description = t('Nodes sorted by total page-views');
$view->access = array();
$view->view_args_php = '';
$view->page = TRUE;
$view->page_title = t('All-time popular content');
$view->page_header = '';
$view->page_header_format = '1';
$view->page_footer = '';
$view->page_footer_format = '1';
$view->page_empty = '';
$view->page_empty_format = '1';
$view->page_type = 'table';
$view->url = 'popular/alltime';
$view->use_pager = TRUE;
$view->nodes_per_page = '20';
$view->menu = TRUE;
$view->menu_title = '';
$view->menu_tab = TRUE;
$view->menu_tab_default = FALSE;
$view->menu_weight = '1';
$view->block = TRUE;
$view->block_title = t('All-time popular content');
$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 = '5';
$view->block_more = '1';
$view->block_use_page_header = FALSE;
$view->block_use_page_footer = FALSE;
$view->block_use_page_empty = FALSE;
$view->sort = array();
$view->argument = array();
$view->field = array(
array(
'tablename' => 'node',
'field' => 'type',
'label' => t('Type'),
'sortable' => '1',
),
array(
'tablename' => 'node',
'field' => 'title',
'label' => t('Title'),
'handler' => 'views_handler_field_nodelink',
'sortable' => '1',
),
array(
'tablename' => 'users',
'field' => 'name',
'label' => t('Author'),
'sortable' => '1',
),
array(
'tablename' => 'node',
'field' => 'created',
'label' => t('Created'),
'handler' => 'views_handler_field_since',
'sortable' => '1',
),
array(
'tablename' => 'node_counter',
'field' => 'totalcount',
'label' => t('Reads'),
'sortable' => '1',
'defaultsort' => 'DESC',
),
);
$view->filter = array(
array(
'tablename' => 'node',
'field' => 'status',
'operator' => '=',
'options' => '',
'value' => '1',
),
);
$view->requires = array(
node_counter,
node,
users,
);
$views[$view->name] = $view;
return $views;
}