You are here

function biblio_coins_generate in Bibliography Module 5

Same name and namespace in other branches
  1. 6.2 includes/biblio.util.inc \biblio_coins_generate()
  2. 6 biblio.module \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.module
theme_biblio_short in ./biblio.module

File

./biblio.module, line 3689

Code

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