You are here

function biblio_get_cid_by_name in Bibliography Module 7

Same name and namespace in other branches
  1. 6.2 includes/biblio.contributors.inc \biblio_get_cid_by_name()

Get an author id from the database using the "name" field as a key. If the "cid" value is negative, this means we found an "alternate" form of the name, which should have an "aka" value which points to the preferred form.

Parameters

string $name:

Return value

int

2 calls to biblio_get_cid_by_name()
biblio_admin_author_edit_add_candidate in includes/biblio.admin.inc
biblio_admin_author_edit_form_link_submit in includes/biblio.admin.inc
_state

File

includes/biblio.contributors.inc, line 75

Code

function biblio_get_cid_by_name($name) {
  $cid = 0;
  $auth = biblio_get_contributor_by_name($name);
  if ($auth) {
    if ($auth->cid > 0) {
      $cid = $auth->cid;
    }
    if ($auth->aka > 0 && $auth->alt_form > 0) {
      $cid = $auth->aka;
    }
  }
  return $cid;
}