[support] How To See Number Of Stories Posted By An Author
Swapnil
swapnil.bhartiya at gmail.com
Tue Nov 20 10:53:03 UTC 2012
Thanks for the view. I have managed to see the story of the author
exposed in the views, I can give dates manually, but then to calculate
the total stories he posted from 1-30 of a month (and that date varies)
I have to do 30 manual searches for each date. Is it possible to give
date range in the exposed filter to find how many stories the selected
author posted between given dates.
Here is the views I am using:
$view = new view();
$view->name = 'total';
$view->description = '';
$view->tag = 'default';
$view->base_table = 'users';
$view->human_name = 'total';
$view->core = 7;
$view->api_version = '3.0';
$view->disabled = FALSE; /* Edit this to true to make a default view
disabled initially */
/* Display: Master */
$handler = $view->new_display('default', 'Master', 'default');
$handler->display->display_options['title'] = 'total';
$handler->display->display_options['use_more_always'] = FALSE;
$handler->display->display_options['group_by'] = TRUE;
$handler->display->display_options['access']['type'] = 'perm';
$handler->display->display_options['access']['perm'] = 'access user
profiles';
$handler->display->display_options['cache']['type'] = 'none';
$handler->display->display_options['query']['type'] = 'views_query';
$handler->display->display_options['query']['options']['distinct'] = TRUE;
$handler->display->display_options['query']['options']['query_comment']
= FALSE;
$handler->display->display_options['exposed_form']['type'] = 'basic';
$handler->display->display_options['pager']['type'] = 'full';
$handler->display->display_options['pager']['options']['items_per_page']
= '10';
$handler->display->display_options['style_plugin'] = 'default';
$handler->display->display_options['row_plugin'] = 'fields';
/* Relationship: User: Content authored */
$handler->display->display_options['relationships']['uid']['id'] = 'uid';
$handler->display->display_options['relationships']['uid']['table'] =
'users';
$handler->display->display_options['relationships']['uid']['field'] = 'uid';
/* Field: User: Name */
$handler->display->display_options['fields']['name']['id'] = 'name';
$handler->display->display_options['fields']['name']['table'] = 'users';
$handler->display->display_options['fields']['name']['field'] = 'name';
$handler->display->display_options['fields']['name']['label'] = '';
$handler->display->display_options['fields']['name']['alter']['word_boundary']
= FALSE;
$handler->display->display_options['fields']['name']['alter']['ellipsis'] =
FALSE;
/* Field: COUNT(Content: Nid) */
$handler->display->display_options['fields']['nid']['id'] = 'nid';
$handler->display->display_options['fields']['nid']['table'] = 'node';
$handler->display->display_options['fields']['nid']['field'] = 'nid';
$handler->display->display_options['fields']['nid']['relationship'] = 'uid';
$handler->display->display_options['fields']['nid']['group_type'] = 'count';
$handler->display->display_options['fields']['nid']['label'] = 'Number
of Stories Posted';
$handler->display->display_options['fields']['nid']['hide_alter_empty']
= FALSE;
/* Filter criterion: Content: Author uid */
$handler->display->display_options['filters']['uid']['id'] = 'uid';
$handler->display->display_options['filters']['uid']['table'] = 'node';
$handler->display->display_options['filters']['uid']['field'] = 'uid';
$handler->display->display_options['filters']['uid']['relationship'] =
'uid';
$handler->display->display_options['filters']['uid']['value'] = '';
$handler->display->display_options['filters']['uid']['exposed'] = TRUE;
$handler->display->display_options['filters']['uid']['expose']['operator_id']
= 'uid_op';
$handler->display->display_options['filters']['uid']['expose']['label']
= 'Author uid';
$handler->display->display_options['filters']['uid']['expose']['operator']
= 'uid_op';
$handler->display->display_options['filters']['uid']['expose']['identifier']
= 'uid';
$handler->display->display_options['filters']['uid']['expose']['remember_roles']
= array(
2 => '2',
1 => 0,
24 => 0,
6 => 0,
5 => 0,
25 => 0,
);
/* Filter criterion: Date: Date (node) */
$handler->display->display_options['filters']['date_filter_1']['id'] =
'date_filter_1';
$handler->display->display_options['filters']['date_filter_1']['table']
= 'node';
$handler->display->display_options['filters']['date_filter_1']['field']
= 'date_filter';
$handler->display->display_options['filters']['date_filter_1']['relationship']
= 'uid';
$handler->display->display_options['filters']['date_filter_1']['exposed'] =
TRUE;
$handler->display->display_options['filters']['date_filter_1']['expose']['operator_id']
= 'date_filter_1_op';
$handler->display->display_options['filters']['date_filter_1']['expose']['label']
= 'Date (node)';
$handler->display->display_options['filters']['date_filter_1']['expose']['operator']
= 'date_filter_1_op';
$handler->display->display_options['filters']['date_filter_1']['expose']['identifier']
= 'date_filter_1';
$handler->display->display_options['filters']['date_filter_1']['expose']['remember_roles']
= array(
2 => '2',
1 => 0,
24 => 0,
6 => 0,
5 => 0,
25 => 0,
);
$handler->display->display_options['filters']['date_filter_1']['form_type']
= 'date_popup';
$handler->display->display_options['filters']['date_filter_1']['date_fields']
= array(
'node.created' => 'node.created',
);
/* Display: Page */
$handler = $view->new_display('page', 'Page', 'page');
$handler->display->display_options['defaults']['hide_admin_links'] = FALSE;
$handler->display->display_options['path'] = 'total';
$translatables['total'] = array(
t('Master'),
t('total'),
t('more'),
t('Apply'),
t('Reset'),
t('Sort by'),
t('Asc'),
t('Desc'),
t('Items per page'),
t('- All -'),
t('Offset'),
t('« first'),
t('‹ previous'),
t('next ›'),
t('last »'),
t('nodes'),
t('Number of Stories Posted'),
t('Author uid'),
t('Date (node)'),
t('Page'),
);
More information about the support
mailing list