function forum_node_load

Implements hook_node_load().

File

modules/forum/forum.module, line 428

Code

function forum_node_load($nodes) {
    $node_vids = array();
    foreach ($nodes as $node) {
        if (_forum_node_check_node_type($node)) {
            $node_vids[] = $node->vid;
        }
    }
    if (!empty($node_vids)) {
        $query = db_select('forum', 'f');
        $query->fields('f', array(
            'nid',
            'tid',
        ))
            ->condition('f.vid', $node_vids);
        $result = $query->execute();
        foreach ($result as $record) {
            $nodes[$record->nid]->forum_tid = $record->tid;
        }
    }
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.