function visitors_block_show_total_visitors in Visitors 8
Same name and namespace in other branches
- 7.2 visitors.block.inc \visitors_block_show_total_visitors()
- 7 visitors.block.inc \visitors_block_show_total_visitors()
- 7.0 visitors.block.inc \visitors_block_show_total_visitors()
Display total visitors count to visitors block.
Parameters
$list_items: array associative array of variables, use for theme function
1 call to visitors_block_show_total_visitors()
- theme_visitors_block_view in ./
visitors.block.inc - Implement a theme function for block output.
File
- ./
visitors.block.inc, line 55 - Display current visitor block.
Code
function visitors_block_show_total_visitors(&$list_items) {
if (variable_get('visitors_show_total_visitors', 1)) {
$query = 'SELECT COUNT(*) FROM {visitors}';
$count = db_query($query)
->fetchField() + variable_get('visitors_start_count_total_visitors', 0);
$list_items[] = t('Total Visitors: %visitors', array(
'%visitors' => $count,
));
}
}