You are here

function biblio_update_6027 in Bibliography Module 7

Same name and namespace in other branches
  1. 6.2 biblio.install \biblio_update_6027()
  2. 6 biblio.install \biblio_update_6027()
  3. 7.2 biblio.install \biblio_update_6027()

File

./biblio.install, line 1896

Code

function biblio_update_6027() {

  // Renunmber the author rank such that it is zero based accross all categories
  // this only needs to be done for entries that actually have auth_categories other than 1.
  require_once drupal_get_path('module', 'biblio') . '/includes/biblio.contributors.inc';
  $result = array();
  $count = 0;
  $db_result = db_query("SELECT DISTINCT(vid),nid FROM {biblio_contributor} WHERE auth_category IN (2,3,4,5) ");
  $count_success = db_query("SELECT COUNT(DISTINCT(vid)) FROM {biblio_contributor} WHERE auth_category IN (2,3,4,5) ")
    ->fetchField();
  foreach ($db_result as $node) {
    $contributors = biblio_load_contributors($node->vid);
    _save_contributors($contributors, $node->nid, $node->vid, $update = FALSE);
    $count++;
  }
}