function visitors_block_published_nodes in Visitors 7.0
Same name and namespace in other branches
- 8 visitors.block.inc \visitors_block_published_nodes()
- 7.2 visitors.block.inc \visitors_block_published_nodes()
- 7 visitors.block.inc \visitors_block_published_nodes()
Display published nodes count to visitors block.
Parameters
$list_items: array associative array of variables, use for theme function
1 call to visitors_block_published_nodes()
- theme_visitors_block_view in ./
visitors.block.inc - Implement a theme function for block output.
File
- ./
visitors.block.inc, line 118 - Display current visitor block.
Code
function visitors_block_published_nodes(&$list_items) {
if (variable_get('visitors_published_nodes', 1)) {
$query = 'SELECT COUNT(*) FROM {node} WHERE status = 1';
$nodes = db_query($query)
->fetchField();
$list_items[] = t('Published Nodes: %nodes', array(
'%nodes' => $nodes,
));
}
}