function themekey_node_get_simple_node_property in ThemeKey 6.2
Same name and namespace in other branches
- 6.4 modules/themekey.node.inc \themekey_node_get_simple_node_property()
 - 6.3 modules/themekey.node.inc \themekey_node_get_simple_node_property()
 - 7.3 modules/themekey.node.inc \themekey_node_get_simple_node_property()
 - 7 modules/themekey.node.inc \themekey_node_get_simple_node_property()
 - 7.2 modules/themekey.node.inc \themekey_node_get_simple_node_property()
 
Helper function that loads a node and returns the value of a node's property.
Parameters
$nid: a node id
$property: name of a nodes attribute as string
Return value
the value of the property or NULL
9 calls to themekey_node_get_simple_node_property()
- themekey_node_nid2changed in modules/
themekey.node.inc  - ThemeKey mapping function to set a ThemeKey property's value (destination) with the aid of another ThemeKey property (source).
 - themekey_node_nid2created in modules/
themekey.node.inc  - ThemeKey mapping function to set a ThemeKey property's value (destination) with the aid of another ThemeKey property (source).
 - themekey_node_nid2language in modules/
themekey.node.inc  - ThemeKey mapping function to set a ThemeKey property's value (destination) with the aid of another ThemeKey property (source).
 - themekey_node_nid2promote in modules/
themekey.node.inc  - ThemeKey mapping function to set a ThemeKey property's value (destination) with the aid of another ThemeKey property (source).
 - themekey_node_nid2sticky in modules/
themekey.node.inc  - ThemeKey mapping function to set a ThemeKey property's value (destination) with the aid of another ThemeKey property (source).
 
File
- modules/
themekey.node.inc, line 159  - Provides some node attributes as ThemeKey properties.
 
Code
function themekey_node_get_simple_node_property($nid, $property) {
  static $nodes = array();
  if (!isset($nodes[$nid])) {
    // node_load() must not be called from hook_init(). Therefor we have to execute SQL here
    $nodes[$nid] = db_fetch_array(db_query('SELECT * FROM {node} WHERE nid = %d', $nid));
  }
  if (isset($nodes[$nid][$property])) {
    return $nodes[$nid][$property];
  }
  else {
    return NULL;
  }
}