Breviora can be downloaded via this MCZ web page and BioOne while issues older than 2004 can be found in the Biodiversity Heritage Library.";
$order = " order by number desc "; // display breviora in descending order by number only.
break;
case "bullmcz":
$publication = "Bulletin of the Museum of Comparative Zoology";
$order = " order by year desc, volume desc, number desc "; // display mcz bulletin by year, volume, number
$bhl ="The MCZ Bulletin can be downloaded via this MCZ web page and BioOne while issues older than 2004 can be found in the Biodiversity Heritage Library.
";
break;
case "memoirs":
$publication = "Memoirs of the Museum of Comparative Zoology";
$bhl ="Memoirs of the MCZ can be found in the Biodiversity Heritage Library.
";
break;
default;
}
$mode = "query";
}
if (@$_GET['list']!="") {
if (@$_GET['list']=="taxa") { $mode = "list_taxa"; }
if (@$_GET['list']=="topics") { $mode = "list_topics"; }
if (@$_GET['list']=="departments") { $mode = "list_departments"; }
}
function head($head) {
$area = "Publications";
include("main_header.html");
echo "
MCZ Publications$head
";
}
function foot() {
include("footer.html");
}
function do_query($sql,$headbit) {
global $showhollis;
@$connection=mcz_connect("publications_read");
if ($connection) {
$result = mysql_query($sql);
echo mysql_error();
$numrows = mysql_num_rows($result);
if ($numrows > 0) {
echo "";
for ($x=0;$x<$numrows;$x++) {
$row = mysql_fetch_object($result);
$authors = $row->authors;
$year = $row->year;
$title = $row->title;
$journal = $row->journal;
$volume = $row->volume;
$number = $row->number;
$hollis_no = $row->hollis_no;
$pdf = $row->pdf;
$supplement = $row->supplement;
$page = $row->page;
$bhl = $row->bhl;
if (strpos($page,"-")===false && strpos($page,"p")===false) {
$page = "$page pp.";
}
$hollis = "";
if ($showhollis===true && $hollis_no!="") {
$hollis = " [Hollis]";
}
$pdflink = "";
if ($pdf!="") {
$pdflink = " [pdf]";
}
if ($bhl!="") {
$pdflink .= " [BHL]";
}
if ($supplement!="") {
if (substr($supplement,0,4)=='http') {
$pdflink .= " [Supplemental material]";
} else {
$pdflink .= " [Supplemental material]";
}
}
$title = preg_replace('/\.$/','',trim($title)); // strip trailing period, if any from title.
$authors = preg_replace('/\.$/','',trim($authors)); // strip trailing period, if any from authors.
if ($journal=="Breviora") {
$citation = "$authors. $year. $title. $journal, $number:$page $hollis $pdflink";
} else {
$citation = "$authors. $year. $title. $journal, $volume($number):$page $hollis $pdflink";
}
echo "- $citation
";
}
echo "
";
}
echo "";
} else {
echo "Unable to connect to database.";
}
}
$select = "select authors, year, title, journal, volume, number, page, hollis_no, pdf, bhl, supplement ";
switch ($mode) {
case "list_taxa":
// taxonomic groups
head(" by Taxon");
@$connection=mcz_connect("publications_read");
if ($connection) {
$sql="select count(id), higher_taxon from mczpubs where higher_taxon !='' group by higher_taxon order by higher_taxon";
$result = mysql_query($sql);
$numrows = mysql_num_rows($result);
echo "";
for ($x=0;$x<$numrows;$x++) {
$row = mysql_fetch_row($result);
$higher_taxon = trim($row[1]);
$url_higher_taxon = urlencode($higher_taxon);
$count = $row[0];
if ($higher_taxon!="") {
echo "- $higher_taxon ($count)
";
}
}
echo "
";
}
foot();
break;
case "list_topics":
// taxonomic groups
head(" by Topic");
@$connection=mcz_connect("publications_read");
if ($connection) {
echo "";
// Other topics
$sql="select count(id), other_subject from mczpubs where other_subject <> '' group by other_subject order by other_subject";
$result = mysql_query($sql);
$numrows = mysql_num_rows($result);
for ($x=0;$x<$numrows;$x++) {
$row = mysql_fetch_row($result);
$other_subject = trim($row[1]);
$url_other_subject = urlencode($other_subject);
$count = $row[0];
echo "- $other_subject ($count)
";
}
// Paleontological publications
/*
//Exclude for now. May want to add back in later with a systematic biology category.
$sql="select count(id), paleo from mczpubs where paleo <> '' group by paleo order by paleo";
$result = mysql_query($sql);
$numrows = mysql_num_rows($result);
for ($x=0;$x<$numrows;$x++) {
$row = mysql_fetch_row($result);
$paleo = trim($row[1]);
$url_paleo = urlencode($paleo);
$count = $row[0];
echo "- $paleo ($count)
";
}
*/
echo "
";
}
foot();
break;
case "list_departments":
// taxonomic groups
head(" by Department");
@$connection=mcz_connect("publications_read");
if ($connection) {
echo "";
$sql="select count(id), department from mczpubs where department <> '' group by department order by department";
$result = mysql_query($sql);
$numrows = mysql_num_rows($result);
for ($x=0;$x<$numrows;$x++) {
$row = mysql_fetch_row($result);
$department = trim($row[1]);
// treat geology as a special case and hide it.
if ($department != "Geology") {
$url_department = urlencode($department);
$count = $row[0];
echo "- $department ($count)
";
}
}
echo "
";
}
foot();
break;
case "query":
$and = "";
$headbit = "";
$wherebit = "";
$topic = "";
if ($publication!="") {
$headbit .= " $publication";
$wherebit .= " $and journal = '$publication' ";
$and = " and ";
}
if ($higher_taxon!="") {
$headbit .= " $higher_taxon";
$topic = $higher_taxon;
$wherebit .= " $and higher_taxon = '$higher_taxon' ";
$and = " and ";
}
if ($paleo!="") {
$headbit .= " $paleo";
$topic .= $and.$paleo;
$wherebit .= " $and paleo = '$paleo' ";
$and = " and ";
}
if ($department!="") {
$headbit .= " $department";
$topic .= $and.$department;
$wherebit .= " $and department = '$department' ";
$and = " and ";
}
if ($other_subject!="") {
$headbit .= " $other_subject";
$topic .= $and.$other_subject;
$wherebit .= " $and other_subject = '$other_subject' ";
$and = " and ";
}
if ($term!="") {
$headbit .= " $term";
$topic .= $and.$term;
$wherebit .= " $and ( citation like '%$term%' or authors like '%$term%' or title like '%$term%' or higher_taxon like '%$term%' or genus like '%$term%' or subject like '%$term%' ) ";
$and = " and ";
}
if ($headbit!="") {
if ($publication!="") {
$headbit = " in $publication";
if ($topic!="") {
$headbit = "$headbit on $topic";
}
} else {
$headbit = " on $topic";
}
}
if ($wherebit != "") {
$wherebit = " where $wherebit ";
}
head($headbit);
echo "$bhl";
$sql="$select from mczpubs $wherebit $order";
do_query($sql,$headbit);
foot();
break;
case "form":
default:
head(" Search");
echo "";
foot();
}
?>