function nodeblock_load_nodeblock in Nodeblock 7
Does a node_load via the nodeblock machine name.
2 calls to nodeblock_load_nodeblock()
- nodeblock_block_configure in ./
nodeblock.module - Implements hook_block_configure().
- nodeblock_block_view in ./
nodeblock.module - Implements hook_block_view().
File
- ./
nodeblock.module, line 755 - Enables use of specified node types as custom blocks.
Code
function nodeblock_load_nodeblock($machine_name) {
$nid = db_select('nodeblock', 'nb')
->condition('machine_name', $machine_name)
->condition('enabled', 1)
->fields('nb', array(
'nid',
))
->execute()
->fetchColumn();
if ($nid) {
return node_load($nid);
}
}