You are here

function _biblio_single_author_link in Bibliography Module 5

1 call to _biblio_single_author_link()
theme_biblio_format_authors in ./biblio.module

File

./biblio.module, line 3083

Code

function _biblio_single_author_link($author, $base = 'biblio', $inline = false) {
  $query = null;
  $inline = $inline ? "/inline" : "";

  //$attrib = (variable_get('biblio_links_target_new_window',null)) ? array('target'=>'_blank') : null;
  $attrib = null;
  if (isset($_GET['sort'])) {
    $query .= "sort=" . $_GET['sort'];
  }
  if (isset($_GET['order'])) {
    $query .= $query ? "&" : "";
    $query .= "order=" . $_GET['order'];
  }
  $html = "";
  $html .= empty($html) ? "" : "; ";
  if (strstr($author, ",")) {
    $parts = split(",", $author);
    $lastname = $parts[0];
  }
  else {
    $parts = split(" ", $author);
    $lastname = end($parts);
  }

  // list($lastname, $init) = split(",", $auth);
  $html .= l(trim($author), "{$base}/author/" . trim($lastname) . $inline, $attrib, $query);
  return $html;
}