function boost_node_get_basics in Boost 6
Get some basic node attribues from the database given node id.
Parameters
$nid: node ID
Return value
node object node->nid node->type node->language node->path node->domain node->tids
4 calls to boost_node_get_basics()
- boost_boost_menu_router in ./
boost.module - Implementation of hook_boost_menu_router().
- boost_views_pre_render in ./
boost.module - Implementation of hook_views_pre_render().
- _boost_cache_insert in ./
boost.module - Shutdown function, gets called at the very end of node creation.
- _boost_views_runit in ./
boost.module
File
- ./
boost.module, line 202 - Provides static file caching for Drupal text output. Pages, Feeds, ect...
Code
function boost_node_get_basics($nid) {
static $nodes = array();
// Is the node statically cached?
if (isset($nodes[$nid])) {
return $nodes[$nid];
}
// Retrieve node nid, type, language.
$op = 'load';
$node = db_fetch_object(db_query("SELECT nid, type, language FROM {node} WHERE nid = %d", $nid));
// Get path info
if (module_exists('path')) {
path_nodeapi($node, $op, NULL, NULL);
}
// Get domain access info
if (module_exists('domain')) {
domain_nodeapi($node, $op, NULL, NULL);
}
// Get taxonomy tid info
if (module_exists('taxonomy')) {
$node->tids = boost_taxonomy_node_get_tids($node->nid);
}
$nodes[$nid] = $node;
return $nodes[$nid];
}