You are here

function biblio_coins_generate in Bibliography Module 6

Same name and namespace in other branches
  1. 5 biblio.module \biblio_coins_generate()
  2. 6.2 includes/biblio.util.inc \biblio_coins_generate()
  3. 7 includes/biblio.util.inc \biblio_coins_generate()
  4. 7.2 includes/biblio.util.inc \biblio_coins_generate()
2 calls to biblio_coins_generate()
theme_biblio_long in ./biblio_theme.inc
DEPRECIATED! this was the original output format which is not to flexable it will be removed TODO: remove this function
theme_biblio_style in ./biblio_theme.inc
Applies a "style" function to a single node.

File

./biblio.module, line 2116

Code

function biblio_coins_generate(&$node) {
  if ($node) {
    $node->biblio_coins = biblio_coins($node);
    db_query("UPDATE {biblio}\n              SET biblio_coins = '%s'\n              WHERE vid = %d", $node->biblio_coins, $node->vid);
  }
  else {
    $result = db_query("SELECT nr.*, b.*\n                        FROM {node} AS n\n                        LEFT JOIN {node_revisions}  AS nr ON n.vid = nr.vid LEFT JOIN {biblio} AS b ON n.vid = b.vid\n                        WHERE n.type = 'biblio'  ");
    while ($node = db_fetch_object($result)) {
      $node->biblio_coins = biblio_coins($node);
      db_query("UPDATE {biblio}\n                SET biblio_coins = '%s'\n                WHERE vid = %d", $node->biblio_coins, $node->vid);
    }
    drupal_goto('');
  }
}