function statistics_block_view
statistics_block_view($delta = '')
Implements hook_block_view().
File
- modules/statistics/statistics.module, line 362
- Logs and displays access statistics for a site.
Code
function statistics_block_view($delta = '') { if (user_access('access content')) { $content = array(); $daytop = variable_get('statistics_block_top_day_num', 0); if ($daytop && ($result = statistics_title_list('daycount', $daytop)) && ($node_title_list = node_title_list($result, t("Today's:")))) { $content['top_day'] = $node_title_list; $content['top_day']['#suffix'] = '<br />'; } $alltimetop = variable_get('statistics_block_top_all_num', 0); if ($alltimetop && ($result = statistics_title_list('totalcount', $alltimetop)) && ($node_title_list = node_title_list($result, t('All time:')))) { $content['top_all'] = $node_title_list; $content['top_all']['#suffix'] = '<br />'; } $lasttop = variable_get('statistics_block_top_last_num', 0); if ($lasttop && ($result = statistics_title_list('timestamp', $lasttop)) && ($node_title_list = node_title_list($result, t('Last viewed:')))) { $content['top_last'] = $node_title_list; $content['top_last']['#suffix'] = '<br />'; } if (count($content)) { $block['content'] = $content; $block['subject'] = t('Popular content'); return $block; } } }
© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/modules!statistics!statistics.module/function/statistics_block_view/7.x