You are here

function biblio_load in Bibliography Module 6

Same name and namespace in other branches
  1. 5 biblio.module \biblio_load()
  2. 6.2 biblio.module \biblio_load()
  3. 7.3 biblio.module \biblio_load()
  4. 7 biblio.module \biblio_load()
  5. 7.2 biblio.module \biblio_load()

Implementation of hook_load().

This hook is called every time a node is loaded, and allows us to do some loading of our own.

File

./biblio.module, line 1743

Code

function biblio_load($node) {
  require_once drupal_get_path('module', 'biblio') . '/biblio.contributors.inc';
  require_once drupal_get_path('module', 'biblio') . '/biblio.keywords.inc';
  $additions = db_fetch_object(db_query('SELECT b.*, bt.name as biblio_type_name
                                         FROM {biblio} b
                                         LEFT JOIN {biblio_types} bt on b.biblio_type = bt.tid
                                         WHERE b.vid = %d', $node->vid));
  $additions->biblio_year = _biblio_text_year($additions->biblio_year);
  $additions->biblio_contributors = biblio_load_contributors($node->vid, $additions->biblio_type);
  $additions->biblio_keywords = biblio_load_keywords($node->vid);
  return $additions;
}