예제 #1
0
    function DisplayHtmlContent()
    {
        global $config;
        global $db;
        $this->display_disqus = false;
        echo html_page_header(true, '', 'name');
        echo '<h1>' . $this->GetTitle() . '</h1>';
        echo '<h2>' . num_cited_by($this->id) . " citations" . '</h2>';
        echo '<p class="explanation">References in BioStor that cite this reference</p>' . "\n";
        $sql = 'SELECT DISTINCT(rdmp_reference_cites.reference_id) FROM rdmp_reference_citation_string_joiner
INNER JOIN rdmp_reference_cites USING(citation_string_id)
WHERE rdmp_reference_citation_string_joiner.reference_id=' . $this->id;
        $result = $db->Execute($sql);
        if ($result == false) {
            die("failed [" . __FILE__ . ":" . __LINE__ . "]: " . $sql);
        }
        echo '<ul>' . "\n";
        while (!$result->EOF) {
            $reference = db_retrieve_reference($result->fields['reference_id']);
            echo '<li style="border-bottom:1px dotted rgb(128,128,128);padding:4px;">';
            echo '<a href="' . $config['web_root'] . 'reference/' . $result->fields['reference_id'] . '">' . $reference->title . '</a><br/>';
            echo '<span style="color:green;">' . reference_authors_to_text_string($reference);
            if (isset($reference->year)) {
                echo ' (' . $reference->year . ')';
            }
            echo ' ' . reference_to_citation_text_string($reference) . '</span>';
            echo ' ' . reference_to_coins($reference);
            echo '</li>';
            $result->MoveNext();
        }
        echo '</ul>' . "\n";
    }
예제 #2
0
 function DisplayHtmlContent()
 {
     global $config;
     echo html_page_header(true, '', 'name');
     echo '<div style="float:right;background-color:rgb(230,242,250);padding:6px">' . "\n";
     if ($this->issn != '') {
         echo '<h2>Identifiers</h2>' . "\n";
         echo '<ul class="guid-list">' . "\n";
         echo '<li class="permalink"><a href="' . $config['web_root'] . 'issn/' . $this->issn . '" title="Permalink">' . $config['web_root'] . 'issn/' . $this->issn . '</a></li>' . "\n";
         echo '<li class="worldcat"><a href="http://www.worldcat.org/issn/' . $this->issn . '" title="ISSN">' . $this->issn . '</a></li>' . "\n";
         echo '<h2>Export</h2>' . "\n";
         echo '<ul class="export-list">' . "\n";
         echo '<li class="xml"><a href="' . $config['web_root'] . 'issn/' . $this->issn . '.xml" title="Endnote XML">Endnote XML</a></li>';
         echo '<li class="ris"><a href="' . $config['web_root'] . 'issn/' . $this->issn . '.ris" title="RIS">Reference manager</a></li>';
         echo '<li class="bibtex"><a href="' . $config['web_root'] . 'issn/' . $this->issn . '.bib" title="BibTex">BibTex</a></li>';
         echo '<li class="text"><a href="' . $config['web_root'] . 'issn/' . $this->issn . '.text" title="text">Text</a></li>';
         echo '</ul>' . "\n";
     }
     if ($this->oclc != '') {
         echo '<h2>Identifiers</h2>' . "\n";
         echo '<ul class="guid-list">' . "\n";
         echo '<li class="permalink"><a href="' . $config['web_root'] . 'oclc/' . $this->oclc . '" title="Permalink">' . $config['web_root'] . 'oclc/' . $this->oclc . '</a></li>' . "\n";
         echo '<li class="worldcat"><a href="http://www.worldcat.org/oclc/' . $this->oclc . '" title="OCLC">' . $this->oclc . '</a></li>' . "\n";
         echo '<h2>Export</h2>' . "\n";
         echo '<ul class="export-list">' . "\n";
         echo '<li class="xml"><a href="' . $config['web_root'] . 'oclc/' . $this->oclc . '.xml" title="Endnote XML">Endnote XML</a></li>';
         echo '<li class="ris"><a href="' . $config['web_root'] . 'oclc/' . $this->oclc . '.ris" title="RIS">Reference manager</a></li>';
         echo '<li class="bibtex"><a href="' . $config['web_root'] . 'oclc/' . $this->oclc . '.bib" title="BibTex">BibTex</a></li>';
         echo '<li class="text"><a href="' . $config['web_root'] . 'oclc/' . $this->oclc . '.text" title="text">Text</a></li>';
         echo '</ul>' . "\n";
     }
     echo '</div>' . "\n";
     echo '<h1>' . $this->GetTitle() . '</h1>';
     // Image
     if (isset($this->issn)) {
         echo '<div>';
         echo '<img src="http://bioguid.info/issn/image.php?issn=' . $this->issn . '" alt="cover" style="border:1px solid rgb(228,228,228);height:100px;" />';
         echo '</div>';
     }
     // Stats
     /*		echo '<div>';
     		echo '<img src="' . sparkline_articles_added_for_issn($this->issn) . '" alt="sparkline" />';
     		echo '</div>';*/
     echo '<a href="http://twitter.com/share" class="twitter-share-button" data-count="vertical" data-via="rdmpage" data-related="biostor_org">Tweet</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script>';
     echo '<h2>Coverage</h2>' . "\n";
     echo '<p>';
     if ($this->issn != '') {
         echo bhl_articles_for_issn($this->issn);
     }
     if ($this->oclc != '') {
         echo bhl_articles_for_oclc($this->oclc);
     }
     echo ' articles in database.</p>' . "\n";
     echo '<h3>Distribution of identified articles over time</h3>' . "\n";
     echo '<div>' . "\n";
     echo '   <img src="' . sparkline_references($this->issn, $this->oclc, 360, 100) . '" alt="sparkline" />' . "\n";
     echo '</div>' . "\n";
     $titles = array();
     if ($this->issn != '') {
         $titles = bhl_titles_for_issn($this->issn);
     }
     if ($this->oclc != '') {
         $titles = bhl_titles_for_oclc($this->oclc);
     }
     if (count($titles) > 0) {
         echo '<h3>Distribution of identified articles across BHL items</h3>' . "\n";
         echo '<div>';
         echo '<div style="display:inline;background-color:rgb(230,242,250);width:20px;height:20px;">&nbsp;&nbsp;&nbsp;&nbsp;</div>';
         echo '&nbsp;Scanned pages&nbsp;';
         echo '<div style="display:inline;background-color:rgb(0,119,204);width:10px;height:10px;">&nbsp;&nbsp;&nbsp;&nbsp;</div>';
         echo '&nbsp;Articles&nbsp;';
         echo '</div>';
         echo '<p></p>';
         $items = array();
         $volumes = array();
         items_from_titles($titles, $items, $volumes);
         $html = '<div style="height:400px;border:1px solid rgb(192,192,192);overflow:auto;">' . "\n";
         $html .= '<table>' . "\n";
         $html .= '<tbody style="font-size:10px;">' . "\n";
         foreach ($volumes as $volume) {
             $item = $items[$volume];
             // How many pages in this item?
             $num_pages = bhl_num_pages_in_item($item->ItemID);
             // Coverage
             $coverage = bhl_item_page_coverage($item->ItemID);
             $row_height = 10;
             // Draw as DIV
             $html .= '<tr>' . "\n";
             $html .= '<td>';
             $html .= '<a href="http://www.biodiversitylibrary.org/item/' . $item->ItemID . '" target="_new">';
             $html .= $item->VolumeInfo;
             $html .= '</a>';
             $html .= '</td>' . "\n";
             $html .= '<td>' . "\n";
             $html .= '<div style="position:relative">' . "\n";
             $html .= '   <div style="background-color:rgb(230,242,250);border-bottom:1px solid rgb(192,192,192);border-right:1px solid rgb(192,192,192);position:absolute;left:0px;top:0px;width:' . $num_pages . 'px;height:' . $row_height . 'px;">' . "\n";
             foreach ($coverage as $c) {
                 $html .= '      <div style="background-color:rgb(0,119,204);position:absolute;left:' . $c->start . 'px;top:0px;width:' . ($c->end - $c->start) . 'px;height:' . $row_height . 'px;">' . "\n";
                 $html .= '      </div>' . "\n";
             }
             $html .= '   </div>' . "\n";
             $html .= '</div>' . "\n";
             $html .= '</td>' . "\n";
             $html .= '</tr>' . "\n";
         }
         $html .= '</tbody>' . "\n";
         $html .= '</table>' . "\n";
         $html .= '</div>' . "\n";
         echo $html;
     }
     $institutions = institutions_from_titles($titles);
     if (count($institutions) != 0) {
         echo '<h3>BHL source(s)</h3>' . "\n";
         echo '<table>' . "\n";
         foreach ($institutions as $k => $v) {
             echo '<tr>' . "\n";
             echo '<td>' . "\n";
             switch ($k) {
                 case 'American Museum of Natural History Library':
                     echo '<img src="' . $config['web_root'] . 'images/institutions/' . 'AMNH_logo_--_blue_rectangle.jpg' . '" width="48" />';
                     break;
                 case 'Harvard University, MCZ, Ernst Mayr Library':
                     echo '<br /><img src="' . $config['web_root'] . 'images/institutions/' . 'Mod_Color_Harvard_Shield_small_bigger.jpg' . '" width="48" />';
                     break;
                 case 'Missouri Botanical Garden':
                     echo '<br /><img src="' . $config['web_root'] . 'images/institutions/' . 'twitter_icon_MBG.jpg' . '" width="48" />';
                     break;
                 case 'New York Botanical Garden':
                     echo '<br /><img src="' . $config['web_root'] . 'images/institutions/' . 'NYBGDOMEHEADERWEB.jpg' . '" />';
                     break;
                 case 'Smithsonian Institution Libraries':
                     echo '<br /><img src="' . $config['web_root'] . 'images/institutions/' . 'SILCatesbyMagnolia.jpg' . '"  width="48" />';
                     break;
                 case 'The Field Museum':
                     echo '<br /><img src="' . $config['web_root'] . 'images/institutions/' . 'field.jpg' . '" width="48" />';
                     break;
                 case 'BHL-Europe':
                     echo '<br /><div style="background-color:green;width:120px;text-align:center"><img src="' . $config['web_root'] . 'images/institutions/' . 'BHL_logo_wg.png' . '" height="48" /></div>';
                     break;
                 case 'Boston Public Library':
                     echo '<br /><img src="' . $config['web_root'] . 'images/institutions/' . 'BPLcards.jpg' . '" width="48" />';
                     break;
                 case 'Harvard University Herbarium':
                     echo '<br /><img src="' . $config['web_root'] . 'images/institutions/' . 'huh_logo_bw_100.png' . '" width="48" />';
                     break;
                 case 'MBLWHOI Library':
                     echo '<br /><img src="' . $config['web_root'] . 'images/institutions/' . 'library_logo2_bigger.jpg' . '" width="48" />';
                     break;
                 case 'Natural History Museum, London':
                     echo '<br /><img src="' . $config['web_root'] . 'images/institutions/' . 'natural_history_museum-01.jpg' . '" width="48" />';
                     break;
                 case 'University of Illinois Urbana Champaign':
                     echo '<br /><img src="' . $config['web_root'] . 'images/institutions/' . 'ilogo_horz_bold.gif' . '" height="48" />';
                     break;
                 default:
                     break;
             }
             echo '</td>' . "\n";
             echo '<td>' . "\n";
             echo $k . '<br />' . $v . ' items';
             echo '</td>' . "\n";
             echo '</tr>' . "\n";
         }
         echo '</table>' . "\n";
     }
     // How does journal relate to BHL Titles and Items?
     $titles = array();
     if ($this->issn != '') {
         $titles = db_retrieve_journal_names_from_issn($this->issn);
     }
     if ($this->oclc != '') {
         $titles = db_retrieve_journal_names_from_oclc($this->oclc);
     }
     if (count($titles) > 1) {
         echo '<h2>Alternative titles</h2>';
         echo '<ul>';
         foreach ($titles as $title) {
             echo '<li>' . $title . '</li>';
         }
         echo '</ul>';
     }
     echo '<h2>Articles</h2>';
     if ($this->issn == '0374-5481') {
         // Special treatment for Ann mag Nat Hist
         echo '<ul>';
         for ($series = 1; $series <= 9; $series++) {
             echo '<li><a href="' . $config['web_root'] . 'issn/' . $this->issn . '#series' . $series . '">Series ' . $series . '</a></li>';
         }
         echo '</ul>';
         for ($series = 1; $series <= 9; $series++) {
             echo '<h3><a name="series' . $series . '"></a>Series ' . $series . '</h3>' . "\n";
             $articles = db_retrieve_articles_from_journal_series($this->issn, $series == 1 ? '' : $series);
             echo '<ul>';
             foreach ($articles as $k => $v) {
                 echo '<li style="display:block;border-top:1px solid #EEE; ">' . $k;
                 echo '<ul>';
                 if (is_array($v)) {
                     foreach ($v as $ref) {
                         echo '<li><a href="' . $config['web_root'] . 'reference/' . $ref->id . '">' . $ref->title . '</a></li>';
                     }
                 }
                 echo '</ul>';
                 echo '</li>';
             }
             echo '</ul>';
         }
     } else {
         $articles = db_retrieve_articles_from_journal($this->issn, $this->oclc);
         //print_r($articles);
         echo '<ul>';
         foreach ($articles as $k => $v) {
             echo '<li style="display:block;border-top:1px solid #EEE; ">' . $k;
             echo '<ul>';
             if (is_array($v)) {
                 foreach ($v as $ref) {
                     if (0) {
                         // fast
                         echo '<li><a href="' . $config['web_root'] . 'reference/' . $ref->id . '">' . $ref->title . '</a></li>';
                     } else {
                         // slower, but useful for debugging
                         $reference = db_retrieve_reference($ref->id);
                         echo '<li style="border-bottom:1px dotted rgb(128,128,128);padding:4px;">';
                         echo '<a href="' . $config['web_root'] . 'reference/' . $ref->id . '">' . $reference->title . '</a><br/>';
                         echo '<span style="color:green;">' . reference_authors_to_text_string($reference);
                         if (isset($reference->year)) {
                             echo ' (' . $reference->year . ')';
                         }
                         echo ' ' . reference_to_citation_text_string($reference) . '</span>';
                         echo ' ' . reference_to_coins($reference);
                         // Thumbail, useful for debugging
                         if (0) {
                             echo '<div>';
                             $pages = bhl_retrieve_reference_pages($ref->id);
                             $image = bhl_fetch_page_image($pages[0]->PageID);
                             echo '<a href="' . $config['web_root'] . 'reference/' . $ref->id . '">';
                             echo '<img style="padding:2px;border:1px solid blue;margin:2px;" id="thumbnail_image_' . $page->PageID . '" src="' . $image->thumbnail->url . '" width="' . $image->thumbnail->width . '" height="' . $image->thumbnail->height . '" alt="thumbnail"/>';
                             echo '</a>';
                             echo '</div>';
                         }
                         echo '</li>';
                     }
                 }
             } else {
                 // Article lacks volume
                 if (isset($v->id)) {
                     $reference = db_retrieve_reference($v->id);
                     echo '<li style="border-bottom:1px dotted rgb(128,128,128);padding:4px;">';
                     echo '<a href="' . $config['web_root'] . 'reference/' . $v->id . '">' . $reference->title . '</a><br/>';
                     echo '<span style="color:green;">' . reference_authors_to_text_string($reference);
                     if (isset($reference->year)) {
                         echo ' (' . $reference->year . ')';
                     }
                     echo ' ' . reference_to_citation_text_string($reference) . '</span>';
                     echo ' ' . reference_to_coins($reference);
                 }
             }
             echo '</ul>';
             echo '</li>';
         }
         echo '</ul>';
     }
 }
예제 #3
0
파일: index.php 프로젝트: rdmpage/biostor
function display_article_metadata($reference)
{
    // Metadata --------------------------------------------------------------------------
    if (isset($reference->journal)) {
        echo $reference->journal->name;
        if (isset($reference->journal->series)) {
            echo ' series ' . $reference->journal->series;
        }
        if (isset($reference->date)) {
            switch (count($reference->date)) {
                case 3:
                    echo ' ' . date('j F Y', strtotime(join('-', $reference->date)));
                    break;
                case 2:
                    // Set date to first of month, but only show month
                    echo ' ' . date('F Y', strtotime(join('-', $reference->date) . '-01'));
                    break;
                case 1:
                    echo ' ' . $reference->date[0];
                    break;
                default:
                    break;
            }
        } else {
            if (isset($reference->year)) {
                echo ' ' . $reference->year;
            }
        }
        if (isset($reference->journal->volume)) {
            echo ' ' . $reference->journal->volume;
        }
        if (isset($reference->journal->issue)) {
            echo '(' . $reference->journal->issue . ')';
        }
        if (isset($reference->journal->pages)) {
            echo ':' . str_replace('--', '-', $reference->journal->pages);
        }
        echo '<br />';
    }
    if (isset($reference->identifier)) {
        foreach ($reference->identifier as $identifier) {
            switch ($identifier->type) {
                case 'doi':
                    /*
                    echo 'DOI: ';
                    echo ' <a href="http://dx.doi.org/' . $identifier->id . '" target="_new"></i>' . $identifier->id . ' <span class="glyphicon glyphicon-new-window" aria-hidden="true"></span></a>';
                    echo '<br />';
                    */
                    echo '<span class="doi"><a href="http://dx.doi.org/' . $identifier->id . '" target="_new">' . $identifier->id . '</a></span>';
                    echo '<br />';
                    break;
                case 'jstor':
                    echo ' <span class="jstor"><a href="http://www.jstor.org/stable/' . $identifier->id . '" target="_new">' . $identifier->id . '</a></span>';
                    echo '<br />';
                    break;
                case 'lsid':
                    echo '<span class="lsid"><a href="http://lsid.tdwg.org/' . $identifier->id . '" target="_new">' . $identifier->id . '</a></span>';
                    echo '<br />';
                    break;
                default:
                    break;
            }
        }
    }
    // Title -----------------------------------------------------------------------------
    echo "<h3>" . $reference->title . "</h3>";
    // Authors ---------------------------------------------------------------------------
    if (isset($reference->author)) {
        if (count($reference->author) > 0) {
            $authors = array();
            foreach ($reference->author as $author) {
                $string = '';
                if (isset($author->firstname)) {
                    $string = $author->firstname . ' ' . $author->lastname;
                } else {
                    $string = $author->name;
                }
                //$authors[] = '<a href="' . '?q=author:&quot;' . $string . '&quot;' . '">' . $string . '</a>';
                $authors[] = '<a href="' . 'search/author:&quot;' . $string . '&quot;' . '">' . $string . '</a>';
            }
            echo join(', ', $authors);
        }
    }
    // COinS -----------------------------------------------------------------------------
    echo reference_to_coins($reference);
    /*
    echo '<pre>';
    echo htmlentities(reference_to_google_scholar($reference));
    echo '</pre>';
    
    echo '<pre>';
    echo htmlentities(reference_to_twitter($reference));
    echo '</pre>';
    
    echo '<pre>';
    echo htmlentities(reference_to_coins($reference));
    echo '</pre>';
    
    
    echo '<pre>';
    echo json_encode(reference_to_citeprocjs($reference), JSON_PRETTY_PRINT);
    echo '</pre>';
    */
}
예제 #4
0
 function DisplayHtmlContent()
 {
     global $config;
     echo html_page_header(true, '', 'name');
     echo '<h1>' . $this->GetTitle() . '</h1>';
     if (count($this->object->specimens) == 0) {
         echo '<p>No specimens with this code</p>';
     } else {
         // What articles have this specimen?
         echo '<h2>References in BioStor with this specimen</h2>';
         $refs = specimens_references_with_code($this->code);
         //print_r($refs);
         foreach ($refs as $occurrenceID => $ref_list) {
             if ($occurrenceID != 0) {
                 echo '<p>GBIF occurrence <a class="gbif" href="http://data.gbif.org/occurrences/' . $occurrenceID . '/" target="_new">' . $occurrenceID . '</a>';
                 $datasetID = specimens_dataset_from_occurrence($occurrenceID);
                 $dataset = specimens_dataset($datasetID);
                 echo ' from dataset <a href="gbif_dataset.php?datasetID=' . $dataset->datasetID . '">' . $dataset->dataResourceName . ' (' . $dataset->providerName . ')' . '</a>';
                 echo '</p>';
                 $occurrence = specimens_from_occurrenceID($occurrenceID);
                 echo '<p>' . $occurrence->scientificName . ' (' . join(':', $occurrence->lineage) . ')' . '</p>';
             } else {
                 echo '<p>(specimen not known in GBIF)</p>';
             }
             echo '<table cellspacing="0" cellpadding="2" width="100%">';
             foreach ($ref_list as $reference_id) {
                 $reference = db_retrieve_reference($reference_id);
                 echo '<tr';
                 if (in_array($reference_id, $act_refs)) {
                     echo ' style="background-color:#D8F3C9;"';
                 }
                 echo '>';
                 if ($reference->PageID != 0) {
                     $image = bhl_fetch_page_image($reference->PageID);
                     $imageURL = $image->thumbnail->url;
                 } else {
                     // if it's an article we could use journal image
                     $imageURL = 'http://bioguid.info/issn/image.php?issn=' . $reference->issn;
                 }
                 echo '<td valign="top"><img style="border:1px solid rgb(192,192,192);" src="' . $imageURL . '" width="40" />';
                 echo '</td>';
                 echo '<td valign="top">';
                 echo '<a href="' . $config['web_root'] . 'reference/' . $reference_id . '">' . $reference->title . '</a><br/>';
                 echo '<span>' . reference_authors_to_text_string($reference);
                 if (isset($reference->year)) {
                     echo ' (' . $reference->year . ')';
                 }
                 echo ' ' . reference_to_citation_text_string($reference) . '</span>';
                 echo ' ' . reference_to_coins($reference);
                 if (0) {
                     echo '<div>';
                     echo bhl_pages_with_name_thumbnails($reference_id, $this->object->NameBankID);
                     echo '</div>';
                 }
                 echo '</td>';
                 echo '</tr>';
             }
             echo '</table>';
         }
     }
 }
예제 #5
0
function display_search($text, $bookmark = '')
{
    global $couch;
    global $config;
    $rows_per_page = 10;
    $q = $text;
    $q = str_replace(':', ',', $q);
    if ($q == '') {
        $obj = new stdclass();
        $obj->rows = array();
        $obj->total_rows = 0;
        $obj->bookmark = '';
    } else {
        $url = '/_design/citation/_search/all?q=' . urlencode($q) . '&limit=' . $rows_per_page . '&include_docs=true';
        if ($bookmark != '') {
            $url .= '&bookmark=' . $bookmark;
        }
        $resp = $couch->send("GET", "/" . $config['couchdb_options']['database'] . "/" . $url);
        $obj = json_decode($resp);
        //print_r($config);
        //echo $config['couchdb_options']['database'] . $url;
        //exit();
    }
    echo '<!DOCTYPE html>
	<html>
        <head>
            <meta charset="utf-8"/>

			<!-- Le styles -->
			<link href="assets/css/bootstrap.css" rel="stylesheet">
			<style type="text/css">
			  body {
				padding-top: 60px;
				padding-bottom: 40px;
			  }
			  .sidebar-nav {
				padding: 9px 0;
			  }
			  
			  .item-links a { margin-right:40px; }
			  
			</style>
			<link href="assets/css/bootstrap-responsive.css" rel="stylesheet">
			
			<link href="font-awesome.css" media="screen" rel="stylesheet" type="text/css" />						
		
			<!-- Le HTML5 shim, for IE6-8 support of HTML5 elements -->
			<!--[if lt IE 9]>
			  <script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
			<![endif]-->
			
</head>
<body>
		   <div class="navbar navbar-fixed-top">
			  <div class="navbar-inner">
				<div class="container">
				  <a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
					<span class="icon-bar"></span>
					<span class="icon-bar"></span>
					<span class="icon-bar"></span>
				  </a>
				  <a class="brand" href=".">Biostor in the cloud</a>
				  <div class="nav-collapse">
					<ul class="nav">
					  <li class="active"><a href=".">Home</a></li>
					  <li><a href="?page=about">About</a></li>
					</ul>
				  </div><!--/.nav-collapse -->
				  
					<form class="navbar-search pull-left" method="get" action=".">
						<input type="text" id=\'q\' name=\'q\' class="search-query" placeholder="Search" value="' . $q . '">
					</form>          
				  
				  
				</div>
			  </div>
			</div>

<div class="container-fluid">';
    //print_r($obj);
    if (isset($obj->error)) {
        echo '<h3>Error</h3>';
        echo '<p>' . $obj->reason . '</p>';
    } else {
        $total_rows = $obj->total_rows;
        $bookmark = $obj->bookmark;
        echo '<h3>' . $total_rows . ' hit(s)' . '</h3>';
        if ($total_rows > $rows_per_page) {
            echo '<p><a class="btn" href="?q=' . urlencode($q) . '&bookmark=' . $bookmark . '">More »</a></p>';
        }
        //echo '<p>' . "Bookmark=$bookmark " . '<a href="?q=' . urlencode($q) . '&bookmark=' . $bookmark . '">more</a>' . '</p>';
        echo '<table class="table">';
        echo '<thead>';
        echo '</thead>';
        echo '<tbody>';
        foreach ($obj->rows as $row) {
            $hit = $row->fields->default;
            $reference = $row->doc;
            $reference->id = $row->id;
            echo '<tr>';
            echo '<td style="text-align:center;width:100px;">';
            if (isset($reference->thumbnail)) {
                echo '<img style="box-shadow:2px 2px 2px #ccc;width:64px;" src="' . $reference->thumbnail . '">';
            }
            echo '</td>';
            echo '<td class="item-data">';
            //echo $row->order[0];
            //echo '<p class="lead">';
            echo '<p style="font-size:21px;font-weight:200;line-height:30px;">';
            echo '<a href="id/' . $reference->id . '">' . $reference->title . '</a>';
            echo '</p>';
            echo '<div>';
            if (isset($reference->year)) {
                echo 'Published in <b>' . $reference->year . '</b>';
            }
            if (isset($reference->journal)) {
                $issn = '';
                if (isset($reference->journal->identifier)) {
                    foreach ($reference->journal->identifier as $identifier) {
                        if ($identifier->type == 'issn') {
                            $issn = $identifier->id;
                        }
                    }
                }
                if ($issn != '') {
                    echo ' in <b><a href="issn/' . $issn . '">' . $reference->journal->name . '</a></b>';
                } else {
                    echo ' in <b>' . $reference->journal->name . '</b>';
                }
                if (isset($reference->journal->volume)) {
                    echo ', volume <b>' . $reference->journal->volume . '</b>';
                }
                if (isset($reference->journal->issue)) {
                    echo ', issue <b>' . $reference->journal->issue . '</b>';
                }
                if (isset($reference->journal->pages)) {
                    echo ', on pages <b>' . str_replace('--', '-', $reference->journal->pages) . '</b>';
                }
            } else {
                // not a journal...
                echo ', on pages <b>' . str_replace('--', '-', $reference->pages) . '</b>';
            }
            echo '</div>';
            echo '<div>';
            if (isset($reference->author)) {
                $authors = array();
                foreach ($reference->author as $author) {
                    if (isset($author->firstname)) {
                        $authors[] = $author->lastname . ' ' . $author->firstname;
                    } else {
                        $authors[] = $author->name;
                    }
                }
                echo join(', ', $authors);
            }
            echo '</div>';
            // COinS
            echo reference_to_coins($reference);
            // Links
            echo '<div class="item-links">';
            //echo '<a href="">cite</a>';
            if (isset($reference->identifier)) {
                foreach ($reference->identifier as $identifier) {
                    switch ($identifier->type) {
                        case 'biostor':
                            echo '<a href="http://biostor.org/reference/' . $identifier->id . '" target="_new"><i class="icon-external-link"></i>biostor.org/reference/' . $identifier->id . '</a>';
                            break;
                        case 'cinii':
                            echo '<a href="http://ci.nii.ac.jp/naid/' . $identifier->id . '" target="_new"><i class="icon-external-link"></i>ci.nii.ac.jp/naid/' . $identifier->id . '</a>';
                            break;
                        case 'doi':
                            echo '<a href="http://dx.doi.org/' . $identifier->id . '" target="_new"><i class="icon-external-link"></i>doi.dx.org/' . $identifier->id . '</a>';
                            break;
                        case 'handle':
                            echo '<a href="http://hdl.handle.net/' . $identifier->id . '" target="_new"><i class="icon-external-link"></i>hdl.handle.net/' . $identifier->id . '</a>';
                            break;
                        case 'jstor':
                            echo '<a href="http://www.jstor.org/stable/' . $identifier->id . '" target="_new"><i class="icon-external-link"></i>www.jstor.org/stable/' . $identifier->id . '</a>';
                            break;
                        default:
                            break;
                    }
                }
            }
            echo '</div>';
            echo '</td>';
            echo '</tr>';
        }
        echo '</tbody>';
        echo '</table>';
        if ($total_rows > $rows_per_page) {
            echo '<p><a class="btn" href="?q=' . urlencode($q) . '&bookmark=' . $bookmark . '">More »</a></p>';
        }
    }
    echo '</div>
</body>
</html>';
}
예제 #6
0
 function DisplayHtmlContent()
 {
     global $config;
     echo html_page_header(true, '', 'name');
     echo '<h1>' . $this->GetTitle() . '</h1>';
     echo '<h2>Identifiers</h2>';
     echo '<ul>';
     if ($this->object->NameBankID != 0) {
         echo '<li>' . 'urn:lsid:ubio.org:namebank:' . $this->object->NameBankID . '</li>';
     }
     echo '</ul>';
     // Taxon name (nomenclators)
     $acts = acts_for_namestring($this->GetTitle());
     $act_refs = references_for_acts_for_namestring($this->GetTitle());
     if (count($acts) > 0) {
         echo '<h2>Taxonomic names</h2>';
         echo '<ul>';
         foreach ($acts as $tn) {
             echo '<li>' . $tn->global_id . '</li>';
         }
         echo '</ul>';
     }
     $col = col_accepted_name_for($this->GetTitle());
     if (isset($col->name)) {
         echo '<h2>Catalogue of Life accepted name</h2>' . "\n";
         echo '<p>';
         echo '<span><a href="' . $config['web_root'] . 'name/' . $col->name . '">' . $col->name . '</a>' . ' ' . $col->author . '</span>';
         echo '</p>' . "\n";
         // Synonyms
         $col_synonyms = col_synonyms_for_namecode($col->name_code);
         if (count($col_synonyms) != 0) {
             echo '<h3>Synonyms</h3>' . "\n";
             echo '<ul>' . "\n";
             foreach ($col_synonyms as $s) {
                 echo '<li><a href="' . $config['web_root'] . 'name/' . $s->name . '">' . $s->name . '</a> ' . $s->author . '</li>' . "\n";
             }
             echo '</ul>' . "\n";
         }
     }
     if (1) {
         /*
         // What pages have this name? (BHL timeline)
         $hits = bhl_name_search($this->object->NameBankID);
         if (count($hits) > 0)
         {
         	echo '<h2>BHL</h2>' . "\n";		
         	echo '<h3>Distribution of name in BHL</h3>';		
         	echo '<div>' . "\n";
         	echo '   <img src="' . sparkline_bhl_name($hits, 360,100) . '" alt="sparkline" />' . "\n";
         	echo '</div>' . "\n";
         }
         else
         {
         	//echo '<p>Name not found in BHL</p>';
         }
         */
         // What articles have this name?
         echo '<hr />';
         echo '<h2>References in BioStor</h2>';
         //		echo '<p><img src="/images/star.png"> indicates reference that publishes a "nomenclatural act", such as publishing the name.</p>';
         echo '<div>';
         echo '<div style="display:inline;border:1px solid rgb(192,192,192);background-color:#D8F3C9;width:20px;height:20px;">&nbsp;&nbsp;&nbsp;&nbsp;</div>';
         echo '&nbsp;Reference contains nomenclatural act, such as publishing the name';
         echo '</div>';
         echo '<p />';
         // Find using BHL bhl_page_name index
         //$refs = bhl_references_with_name($this->object->NameBankID);
         $refs = bhl_references_with_namestring($this->GetTitle());
         // Merge with references from nomenclators
         $refs = array_merge($refs, $act_refs);
         $refs = array_unique($refs);
         //print_r($refs);
         if (count($refs) == 0) {
             echo '<p>[No references]</p>';
         }
         /*		
         		echo '<ul class="reference-list">';
         		foreach($refs as $reference_id)
         		{
         			$reference = db_retrieve_reference ($reference_id);
         			echo '<li ';
         			
         			if (in_array($reference_id, $act_refs))
         			{
         				echo 'class="act"';
         			}
         			else
         			{
         				echo 'class="default"';
         			}
         			echo '>';
         			echo '<a href="' . $config['web_root'] . 'reference/' . $reference_id . '">' . $reference->title . '</a><br/>';
         			echo '<span style="color:green;">' . reference_authors_to_text_string($reference);
         			if (isset($reference->year))
         			{
         				echo ' (' . $reference->year . ')';
         			}
         			echo ' ' . reference_to_citation_text_string($reference) . '</span>';
         			echo ' ' . reference_to_coins($reference);
         			
         			if (0)
         			{
         				echo '<div>';
         				echo bhl_pages_with_name_thumbnails($reference_id,$this->object->NameBankID);	
         				echo '</div>';
         			}
         			echo '</li>';
         		}
         		echo '</ul>';
         */
         echo '<table cellspacing="0" cellpadding="2" width="100%">';
         foreach ($refs as $reference_id) {
             $reference = db_retrieve_reference($reference_id);
             echo '<tr';
             if (in_array($reference_id, $act_refs)) {
                 echo ' style="background-color:#D8F3C9;"';
             }
             echo '>';
             if ($reference->PageID != 0) {
                 $image = bhl_fetch_page_image($reference->PageID);
                 $imageURL = $image->thumbnail->url;
             } else {
                 // if it's an article we could use journal image
                 $imageURL = 'http://bioguid.info/issn/image.php?issn=' . $reference->issn;
             }
             echo '<td valign="top"><img style="border:1px solid rgb(192,192,192);" src="' . $imageURL . '" width="40" />';
             echo '</td>';
             echo '<td valign="top">';
             echo '<a href="' . $config['web_root'] . 'reference/' . $reference_id . '">' . $reference->title . '</a><br/>';
             echo '<span>' . reference_authors_to_text_string($reference);
             if (isset($reference->year)) {
                 echo ' (' . $reference->year . ')';
             }
             echo ' ' . reference_to_citation_text_string($reference) . '</span>';
             echo ' ' . reference_to_coins($reference);
             if (0) {
                 echo '<div>';
                 echo bhl_pages_with_name_thumbnails($reference_id, $this->object->NameBankID);
                 echo '</div>';
             }
             echo '</td>';
             echo '</tr>';
         }
         echo '</table>';
         /*
         $refs = col_references_for_name($this->GetTitle());
         if (count($refs) != 0)
         {
         	echo '<h2>Catalogue of Life Bibliography</h2>';
         	echo '<ol>';
         	foreach($refs as $ref)
         	{
         		echo '<li style="border-bottom:1px dotted rgb(128,128,128);padding:4px;">';
         		echo '<span>';
         		echo '[' . $ref->record_id . '] ';
         		if (isset($ref->reference_type))
         		{
         			echo '[' . $ref->reference_type . '] ';
         		}
         		echo $ref->author;
         		echo ' ';
         		echo $ref->year;
         		echo ' ';
         		echo $ref->title;
         		echo '. ';
         		echo $ref->source;
         		echo '</span>';
         		echo '</li>';
         	}
         	echo '</ol>';
         }
         */
     }
 }
예제 #7
0
 function DisplayHtmlContent()
 {
     global $config;
     log_access($this->id, 'html');
     echo html_page_header(true, '', 'name');
     // Embed first page of OCR text, added 2011-12-07
     if ($this->in_bhl) {
         $pages = bhl_retrieve_reference_pages($this->id);
         $page_ids = array($pages[0]->PageID);
         $text = bhl_fetch_text_for_pages($page_ids);
         $text = str_replace('\\n', '', $text);
         $text = str_replace('- ', '-', $text);
         $text = str_replace('- ', '-', $text);
         echo "\n<!-- First page of OCR text -->\n";
         echo '<div style="display:none;">' . "\n";
         echo htmlentities($text, ENT_COMPAT, "UTF-8");
         echo '</div>' . "\n";
     }
     echo '<div style="float:right;background-color:rgb(230,242,250);padding:6px">' . "\n";
     echo '<h2>Identifiers</h2>' . "\n";
     echo '<ul class="guid-list">' . "\n";
     echo '<li class="permalink">' . '<div itemscope itemtype="http://schema.org/ScholarlyArticle">' . '<a href="' . $config['web_root'] . 'reference/' . $this->id . '" title="Permalink">' . $config['web_root'] . 'reference/' . $this->id . '</a>' . '</div>' . '</li>' . "\n";
     if ($this->in_bhl) {
         echo '<li class="bhl"><a href="http://www.biodiversitylibrary.org/page/' . $this->object->PageID . '" target="_new" title="BHL page"  onClick="_gaq.push([\'_trackEvent\', \'Outbound Links\', \'bhl\', \'' . $this->object->PageID . '\', 0]);">' . $this->object->PageID . '</a></li>' . "\n";
     }
     if (isset($this->object->doi)) {
         echo '<li class="doi"><a href="http://dx.doi.org/' . $this->object->doi . '" target="_new" title="DOI" onClick="_gaq.push([\'_trackEvent\', \'Outbound Links\', \'doi\', \'' . $this->object->doi . '\', 0]);">' . $this->object->doi . '</a></li>' . "\n";
     }
     if (isset($this->object->url)) {
         echo '<li class="url"><a href="' . $this->object->url . '" target="_new" title="URL">' . trim_string($this->object->url, 30) . '</a></li>' . "\n";
     }
     if (isset($this->object->pdf)) {
         echo '<li class="pdf"><a href="' . $this->object->pdf . '" target="_new" title="PDF">' . trim_string($this->object->pdf, 30) . '</a></li>' . "\n";
     }
     if (isset($this->object->hdl)) {
         echo '<li class="handle"><a href="http://hdl.handle.net/' . $this->object->hdl . '" target="_new" title="Handle">' . $this->object->hdl . '</a></li>' . "\n";
     }
     if (isset($this->object->lsid)) {
         echo '<li class="lsid"><a href="' . $config['web_root'] . $this->object->lsid . '" title="LSID">' . $this->object->lsid . '</a></li>' . "\n";
     }
     if (isset($this->object->pmid)) {
         echo '<li class="pmid"><a href="http://www.ncbi.nlm.nih.gov/pubmed/' . $this->object->pmid . '" target="_new" title="PMID" >' . $this->object->pmid . '</a></li>' . "\n";
     }
     echo '</ul>' . "\n";
     echo '<h2>Export</h2>' . "\n";
     echo '<ul class="export-list">' . "\n";
     // Mendeley
     echo '<li class="mendeley"><a href="http://www.mendeley.com/import/?url=' . urlencode($config['web_root'] . 'reference/' . $this->id) . '" title="Add to Mendeley" target="_new" onClick="_gaq.push([\'_trackEvent\', \'Export\', \'Mendeley\', \'' . $this->id . '\', 0]);">Mendeley</a></li>';
     if ($this->in_bhl) {
         echo '<li class="pdf"><a href="' . $config['web_root'] . 'reference/' . $this->id . '.pdf" title="PDF" onClick="_gaq.push([\'_trackEvent\', \'Export\', \'pdf\', \'' . $this->id . '\', 0]);">PDF</a></li>';
     }
     echo '<li class="xml"><a href="' . $config['web_root'] . 'reference/' . $this->id . '.xml" title="Endnote XML" target="_new" onClick="_gaq.push([\'_trackEvent\', \'Export\', \'Endnote\', \'' . $this->id . '\', 0]);">Endnote XML</a></li>';
     echo '<li class="ris"><a href="' . $config['web_root'] . 'reference/' . $this->id . '.ris" title="RIS" target="_new" onClick="_gaq.push([\'_trackEvent\', \'Export\', \'RIS\', \'' . $this->id . '\', 0]);">Reference manager</a></li>';
     echo '<li class="bibtex"><a href="' . $config['web_root'] . 'reference/' . $this->id . '.bib" title="BibTex" target="_new" onClick="_gaq.push([\'_trackEvent\', \'Export\', \'bibtex\', \'' . $this->id . '\', 0]);">BibTex</a></li>';
     echo '<li class="bibjson"><a href="' . $config['web_root'] . 'reference/' . $this->id . '.bibjson" title="BibJSON" target="_new" onClick="_gaq.push([\'_trackEvent\', \'Export\', \'bibjson\', \'' . $this->id . '\', 0]);">BibJSON</a></li>';
     echo '<li class="wikipedia"><a href="' . $config['web_root'] . 'reference/' . $this->id . '.wikipedia" title="Wikipedia" target="_new" onClick="_gaq.push([\'_trackEvent\', \'Export\', \'Wikipedia\', \'' . $this->id . '\', 0]);">Wikipedia</a></li>';
     if ($this->in_bhl) {
         echo '<li class="text"><a href="' . $config['web_root'] . 'reference/' . $this->id . '.text" title="Text" onClick="_gaq.push([\'_trackEvent\', \'Export\', \'text\', \'' . $this->id . '\', 0]);">Text</a></li>';
     }
     echo '</ul>' . "\n";
     echo '</div>' . "\n";
     //------------------------------------------------------------------------------------------
     echo '<div itemscope itemtype="http://schema.org/ScholarlyArticle">';
     echo '<h1>' . '<div itemprop="name">' . $this->GetTitle() . '</div>' . '</h1>' . "\n";
     //------------------------------------------------------------------------------------------
     // Authors
     echo '<div>' . "\n";
     $count = 0;
     $num_authors = count($this->object->authors);
     if ($num_authors > 0) {
         foreach ($this->object->authors as $author) {
             echo '<a href="' . $config['web_root'] . 'author/' . $author->id . '">';
             echo $author->forename . ' ' . $author->lastname;
             if (isset($author->suffix)) {
                 echo ' ' . $author->suffix;
             }
             echo '</a>';
             $count++;
             if ($count < $num_authors - 1) {
                 echo ', ';
             } else {
                 if ($count < $num_authors) {
                     echo ' and ';
                 }
             }
         }
     }
     echo "\n" . '</div>' . "\n";
     //------------------------------------------------------------------------------------------
     // Metadata and COinS
     echo '<div>' . "\n";
     echo '<div itemprop="description">';
     echo '<span class="journal">';
     // Various options for linking journal.
     if (isset($this->object->issn)) {
         echo '<a href="' . $config['web_root'] . 'issn/' . $this->object->issn . '">';
         echo $this->object->secondary_title;
         echo '</a>';
     } elseif (isset($this->object->oclc)) {
         echo '<a href="' . $config['web_root'] . 'oclc/' . $this->object->oclc . '">';
         echo $this->object->secondary_title;
         echo '</a>';
     } else {
         echo $this->object->secondary_title;
     }
     echo '</span>';
     echo ' ';
     if (isset($this->object->series)) {
         echo ' <span class="volume">(' . $this->object->series . ') </span>';
     }
     echo '<span class="volume">' . $this->object->volume . '</span>';
     if (isset($this->object->issue)) {
         echo '<span class="issue">' . '(' . $this->object->issue . ')' . '</span>';
     }
     echo ':';
     echo ' ';
     echo '<span class="pages">' . $this->object->spage . '</span>';
     if (isset($this->object->epage)) {
         echo '<span class="pages">' . '-' . $this->object->epage . '</span>';
     }
     if (isset($this->object->year)) {
         echo ' ';
         echo '<span class="year">' . '(' . $this->object->year . ')' . '</span>';
     }
     echo reference_to_coins($this->object);
     echo '</div>' . "\n";
     echo '</div>' . "\n";
     echo '</div>';
     // schema
     //------------------------------------------------------------------------------------------
     // When record added and updated
     echo '<p class="explanation">Reference added ';
     echo distanceOfTimeInWords(strtotime($this->object->created), time(), true);
     echo ' ago';
     echo '</p>' . "\n";
     //------------------------------------------------------------------------------------------
     // Social bookmarking
     //		echo '<g:plusone size="tall"></g:plusone>';
     echo '<a href="http://twitter.com/share" class="twitter-share-button" data-count="vertical" data-via="rdmpage" data-related="biostor_org">Tweet</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script>';
     //------------------------------------------------------------------------------------------
     // Export options
     /*		echo '<h2>Export</h2>' . "\n";
     		echo '<div>' . "\n";
     		echo '<span><a href="' . $config['web_root'] . 'reference/' . $this->id . '.xml" title="Endnote XML">Endnote XML</a></span>';
     		echo ' | ';
     		echo '<span><a href="' . $config['web_root'] . 'reference/' . $this->id . '.ris" title="RIS">Reference manager</a></span>';		
     		echo ' | ';
     		echo '<span><a href="' . $config['web_root'] . 'reference/' . $this->id . '.bib" title="BibTex">BibTex</a></span>';	
     		
     		if ($this->in_bhl)
     		{
     			echo ' | ';
     			echo '<span><a href="' . $config['web_root'] . 'reference/' . $this->id . '.text" title="Text">Text</a></span>';
     		}
     		echo '</div>' . "\n";
     */
     //------------------------------------------------------------------------------------------
     // Identifiers
     /*		echo '<h2>Identifiers</h2>' . "\n";
     		echo '<ul>' . "\n";
     		if ($this->in_bhl)
     		{
     			// BHL reference
     			echo '<li><a href="http://www.biodiversitylibrary.org/page/' . $this->object->PageID . '" target="_new">BHL PageID:' . $this->object->PageID . '</a></li>' . "\n";
     		}
     		
     		if (isset($this->object->sici))
     		{
     			echo '<li><a href="' . $config['web_root'] . 'sici/' . $this->object->sici . '">' .  $this->object->sici . '</a></li>' . "\n";
     		}
     		if (isset($this->object->url))
     		{
     			echo '<li><a href="' . $this->object->url . '" target="_new">' .  $this->object->url . '</a></li>' . "\n";
     		}
     		if (isset($this->object->pdf))
     		{
     			echo '<li><a href="' . $this->object->pdf . '" target="_new">' .  $this->object->pdf . '</a></li>' . "\n";
     		}
     		if (isset($this->object->doi))
     		{
     			echo '<li><a href="http://dx.doi.org/' . $this->object->doi . '" target="_new">' .  $this->object->doi . '</a></li>' . "\n";
     		}
     		if (isset($this->object->hdl))
     		{
     			echo '<li><a href="http://hdl.handle.net/' . $this->object->hdl . '" target="_new">' .  $this->object->hdl . '</a></li>' . "\n";
     		}
     		if (isset($this->object->lsid))
     		{
     			echo '<li><a href="' . $config['web_root'] . $this->object->lsid . '">' . $this->object->lsid . '</a></li>' . "\n";
     		}
     		if (isset($this->object->pmid))
     		{
     			echo '<li><a href="http://www.ncbi.nlm.nih.gov/pubmed/' . $this->object->pmid . '" target="_new">' . $this->object->pmid . '</a></li>' . "\n";
     		}
     		echo '</ul>' . "\n";*/
     //------------------------------------------------------------------------------------------
     // Linking
     /*
     echo '<div>' . "\n";
     echo '<span><a href="' . $config['web_root'] . 'reference/' . $this->id . '/backlinks" title="References">Cites (' . num_cites($this->id) . ')</a></span>';
     echo ' | ';
     echo '<span><a href="' . $config['web_root'] . 'reference/' . $this->id . '/forwardlinks" title="Forward links">Cited by (' . num_cited_by($this->id) . ')</a></span>';
     echo '</div>' . "\n";
     */
     //------------------------------------------------------------------------------------------
     if ($this->in_bhl) {
         //--------------------------------------------------------------------------------------
         echo '<h2>Viewer</h2>';
         echo '<p id="viewer_status"></p>' . "\n";
         echo '<table width="100%" >';
         echo '<tr  valign="top"><td>';
         echo bhl_reference_viewer($this->id, $this->page);
         echo '</td>';
         echo '<td>';
         echo $this->DisplayEditForm();
         echo '</td></tr>';
         echo '</table>';
         if (0) {
             //--------------------------------------------------------------------------------------
             $tag_cloud = name_tag_cloud($this->taxon_names);
             if ($tag_cloud != '') {
                 echo '<h2>Taxon name tag cloud</h2>';
                 echo '<p class="explanation">Taxonomic names extracted from OCR text for document using uBio tools.</p>';
                 echo $tag_cloud;
                 echo '<h2>Taxonomic classification</h2>';
                 if ($config['use_gbif']) {
                     echo '<p class="explanation">GBIF classification for taxonomic names in document</p>';
                 } else {
                     echo '<p class="explanation">Catalogue of Life classification for taxonomic names in document</p>';
                 }
                 echo '<div id="taxon_names"></div>';
                 echo '<script type="text/javascript">make_tag_tree();</script>';
             }
         }
         //--------------------------------------------------------------------------------------
         if (count($this->localities) != 0) {
             echo '<h2>Localities</h2>';
             echo '<p class="explanation">Localities extracted from OCR text.</p>';
             echo '<div id="map_canvas" style="width: 600px; height: 300px"></div>';
         }
         //--------------------------------------------------------------------------------------
         if (count($this->specimens) != 0) {
             echo '<h2>Specimens</h2>';
             echo '<p class="explanation">Specimen codes extracted from OCR text.</p>';
             echo '<ul style="-moz-column-width: 13em; -webkit-column-width: 13em; -moz-column-gap: 1em; -webkit-column-gap: 1em;">';
             foreach ($this->specimens as $occurrence) {
                 echo '<li';
                 if (isset($occurrence->occurrenceID)) {
                     //echo $occurrence->occurrenceID;
                     echo ' class="gbif"';
                 } else {
                     echo ' class="blank"';
                 }
                 echo '>';
                 echo '<a href="specimen/' . rawurlencode($occurrence->code) . '">' . $occurrence->code . '</a>';
                 echo '</li>';
             }
             echo '</ul>';
         }
     } else {
         echo '<table width="100%" >';
         echo '<tr><td valign="top" width="600">';
         $have_content = false;
         // PDF displayed using Google Docs
         if (!$have_content) {
             // If we have a PDF display it using Google Docs Viewer http://docs.google.com/viewer
             if ($this->object->url) {
                 if (preg_match('/\\.pdf$/', $this->object->url)) {
                     echo '<iframe src="http://docs.google.com/viewer?url=';
                     echo urlencode($this->object->url) . '&embedded=true" width="600" height="700" style="border: none;">' . "\n";
                     echo '</iframe>' . "\n";
                     $have_content = true;
                 }
             }
         }
         if (!$have_content) {
             if (isset($this->object->abstract)) {
                 echo '<h3>Abstract</h3>' . "\n";
                 echo '<div>' . $this->object->abstract . '</div>' . "\n";
                 $have_content = true;
             }
         }
         if (!$have_content) {
             echo '<span>[No text or abstract to display]</span>';
         }
         echo '</td>';
         echo '<td>';
         echo $this->DisplayEditForm();
         echo '</td></tr>';
         echo '</table>';
     }
     /*
     //------------------------------------------------------------------------------------------
     // Nomenclature (experimental)
     $acts = acts_in_publication($this->id);
     if (count($acts) > 0)
     {
     	echo '<h2>Names published</h2>' . "\n";
     	echo '<p class="explanation">New names or combinations published in this reference.</p>' . "\n";
     	echo '<table cellspacing="0" cellpadding="2">' . "\n";
     	echo '<tr><th>Name</th><th>Identifier</th></tr>' . "\n";
     	foreach ($acts as $tn)
     	{
     		echo '<tr>';
     		echo '<td style="border-bottom:1px solid rgb(228,228,228);"><a href="' . $config['web_root'] . 'name/' . urlencode($tn->ToHTML()) . '">' . $tn->ToHTML() . '</td>';
     		
     		echo '<td style="border-bottom:1px solid rgb(228,228,228);">' . $tn->global_id . '</td>';
     		
     		echo '</tr>' . "\n";
     	}
     	echo '</table>' . "\n";
     }
     */
 }
예제 #8
0
파일: index.php 프로젝트: rdmpage/afd
function display_publication($publication)
{
    global $couch;
    global $config;
    echo html_html_open();
    echo html_head_open();
    echo html_title($publication->title . ' - ' . $config['site_name']);
    echo html_include_css('css/main.css');
    echo html_include_css('css/viewer.css');
    echo html_include_script('js/jquery-1.4.4.min.js');
    echo html_include_script('js/viewer.js');
    echo html_head_close();
    echo html_body_open();
    if (1) {
        echo '<div style="position:relative;">';
        // Metadata
        echo '<div style="position:absolute;top:0px;left:620px;padding:10px;">';
        echo '<div><span><a href="' . $config['web_root'] . '">' . $config['site_name'] . '</a></span></div>';
        echo '<p></p>';
        echo '<span style="font-weight:bold;font-size:18px;">' . $publication->title . '</span>';
        echo '<div>' . 'by ' . reference_authors_to_text_string($publication->authors, false, true) . '</div>';
        $outlet = $publication->publication_outlet;
        // This ensures we double urlencode "&"
        $outlet = str_replace("&", urlencode("&"), $outlet);
        echo '<div>' . '<a href="' . $config['web_root'] . 'publication_outlet/' . urlencode($outlet) . '">' . '<i>' . $publication->publication_outlet . '</i>' . '</a>' . ' ' . $publication->volume . ':' . $publication->pages . ' (' . $publication->year . ')' . '</div>';
        // External links ---------------------------------------------------------------------------------------
        echo '<div>';
        echo '<ul>';
        if ($publication->_id) {
            echo '<li><a href="http://lsid.tdwg.org/summary/urn:lsid:biodiversity.org.au:afd.publication:' . $publication->_id . '" target="_new">urn:lsid:biodiversity.org.au:afd.publication:' . $publication->_id . '</li>';
        }
        if (isset($publication->identifiers)) {
            if (isset($publication->identifiers->doi)) {
                echo '<li>' . '<a href="http://dx.doi.org/' . $publication->identifiers->doi . '" target="_new">doi:' . $publication->identifiers->doi . '</a></li>';
            }
            if (isset($publication->identifiers->hdl)) {
                echo '<li>' . '<a href="http://hdl.handle.net/' . $publication->identifiers->hdl . '" target="_new">hdl:' . $publication->identifiers->hdl . '</a></li>';
            }
            if (isset($publication->identifiers->biostor)) {
                echo '<li>' . '<a href="http://biostor.org/reference/' . $publication->identifiers->biostor . '" target="_new">BioStor</a></li>';
            }
            if (isset($publication->pageIdentifiers)) {
                echo '<li>' . '<a href="http://biodiversitylibrary.org/page/' . $publication->pageIdentifiers[0] . '" target="_new">BHL</a></li>';
            }
        }
        if (isset($publication->urls)) {
            foreach ($publication->urls as $url) {
                if (preg_match('/http:\\/\\/ci.nii.ac.jp\\/naid\\//', $url)) {
                    echo '<li>' . '<a href="' . $url . '" target="_new">' . $url . '</a></li>';
                }
                if (preg_match('/http:\\/\\/gallica.bnf.fr\\//', $url)) {
                    echo '<li>' . '<a href="' . $url . '" target="_new">' . $url . '</a></li>';
                }
                if (preg_match('/http:\\/\\/www.jstor.org\\//', $url)) {
                    echo '<li>' . '<a href="' . $url . '" target="_new">' . $url . '</a></li>';
                }
            }
        }
        echo '</div>';
        echo reference_to_coins($publication);
        echo '<div><a href="http://biostor.org/openurlhook.php?' . reference_to_openurl($publication) . '&amp;webhook=' . urlencode($config['web_server'] . $config['web_root'] . 'webhook.php') . '" target="_new">OpenURL Hook</a></div>';
        //------------------------------------------------------------------------------------------
        // Names
        $resp = $couch->send("GET", "/" . $config['couchdb'] . "/_design/publication/_view/taxonNames?key=" . urlencode('"' . $publication->_id . '"'));
        $names = json_decode($resp);
        if (count($names->rows) > 0) {
            echo '<h3>Names published</h3>';
            echo '<ul>';
            foreach ($names->rows as $row) {
                echo '<li>' . '<a href="id/' . $row->value->_id . '">' . $row->value->taxonName . '</a></li>';
            }
            echo '</ul>';
        }
        echo '</div>';
        // --- end metadata
        // Viewer
        echo '<div style="position:absolute;top:0px;left:0px;width:600px;">';
        $has_fulltext = isset($publication->identifiers->biostor) || isset($publication->pdf);
        if (!$has_fulltext) {
            if (isset($publication->identifiers->doi)) {
                $url = 'http://dx.doi.org/' . $publication->identifiers->doi;
                echo '<div style="width:600px;height:800px;border:1px solid rgb(192,192,192);">';
                echo '<iframe src="' . $url . '" width="600" height="800" style="border: none;">';
                echo '</iframe>';
                echo '</div>';
            } else {
                if (count($publication->urls) > 0) {
                    $display_url = '';
                    foreach ($publication->urls as $url) {
                        if (preg_match('/http:\\/\\/ci.nii.ac.jp\\/naid\\//', $url)) {
                            $display_url = $url;
                            break;
                        }
                        if (preg_match('/http:\\/\\/gallica.bnf.fr\\//', $url)) {
                            $display_url = $url;
                            break;
                        }
                        if (preg_match('/http:\\/\\/www.jstor.org\\//', $url)) {
                            $display_url = $url;
                            break;
                        }
                    }
                    if ($display_url != '') {
                        echo '<div style="width:600px;height:800px;border:1px solid rgb(192,192,192);">';
                        echo '<iframe src="' . $display_url . '" width="600" height="800" style="border: none;">';
                        echo '</iframe>';
                        echo '</div>';
                    }
                } else {
                    echo '<div style="width:600px;height:800px;border:1px solid rgb(192,192,192);">
					<div style="position:absolute;top:300px;left:0px;width:600px;color:rgb(192,192,192);text-align:center;font-size:72px;">No content</div>
					</div>';
                }
            }
        } else {
            // PDF
            if (isset($publication->pdf)) {
                echo '<div>';
                echo '<iframe src="http://docs.google.com/viewer?url=';
                echo str_replace(' ', '%20', $publication->pdf) . '&embedded=true" width="600" height="800" style="border: none;">';
                echo '</iframe>';
                echo '</div>';
            } else {
                // BioStor
                if (isset($publication->identifiers->biostor)) {
                    echo '<script> pages=[' . join(",", $publication->pageIdentifiers) . ']; </script>';
                    echo '				
	<div style="position:relative;width:600px;height:800px;">
		<div id="header" >
			<div style="float:right;padding:8px;margin-right:10px;">
				<span id="page_counter">1/?</span>
				<span>&nbsp;</span>
				<span>&nbsp;</span>
				<img id="previous_page" src="images/previous.png" border="0" onclick="previous();" title="Show previous page">
				<span>&nbsp;</span>
				<img id="next_page" src="images/next.png" border="0" onclick="next();" title="Show next page">
				<span>&nbsp;</span>
				<span>&nbsp;</span>
				<span>&nbsp;</span>
				<img src="images/fourpages.png" border="0" onclick="show_all_pages();" title="Show all pages">
				<span>&nbsp;</span>
				<img src="images/onepage.png" border="0" onclick="show_page(-1);"  title="Fit page to viewer">
			</div>
		</div>
	
		<div id="page_container">
			<img id="page_image" />
			<div id="all_pages" ></div>
		</div>
	</div>
	
	<script>
	show_page(0);
	</script>';
                }
            }
        }
        echo '</div>
		</div>';
    } else {
        //----------------------------------------------------------------------------------------------
        // Home
        echo '<span><a href="' . $config['web_root'] . '">' . $config['site_name'] . '</a></span>';
        echo html_search_box();
        //----------------------------------------------------------------------------------------------
        // Object
        echo '<div>';
        echo '<h1>' . $publication->title . '</h1>';
        echo '<div>' . 'by ' . reference_authors_to_text_string($publication->authors, false, true) . '</div>';
        echo '<div>' . '<i>' . $publication->publication_outlet . '</i>' . ' ' . $publication->volume . ':' . $publication->pages . ' (' . $publication->year . ')' . '</div>';
        //echo '<div>' . $publication->_id . '</div>';
        /*
        if (isset($publication->abstract))
        {
        	echo '<div>' . $publication->abstract . '</div>';				
        }
        */
        // External links
        echo '<ul>';
        if (isset($publication->identifiers)) {
            if (isset($publication->identifiers->doi)) {
                echo '<li>' . '<a href="http://dx.doi.org/' . $publication->identifiers->doi . '" target="_new">doi:' . $publication->identifiers->doi . '</a></li>';
            }
            if (isset($publication->identifiers->hdl)) {
                echo '<li>' . '<a href="http://hdl.handle.net/' . $publication->identifiers->hdl . '" target="_new">hdl:' . $publication->identifiers->hdl . '</a></li>';
            }
            if (isset($publication->identifiers->biostor)) {
                echo '<li>' . '<a href="http://biostor.org/reference/' . $publication->identifiers->biostor . '" target="_new">BioStor</a></li>';
            }
            if (isset($publication->pageIdentifiers)) {
                echo '<li>' . '<a href="http://biodiversitylibrary.org/page/' . $publication->pageIdentifiers[0] . '" target="_new">BHL</a></li>';
            }
        }
        if (isset($publication->urls)) {
            foreach ($publication->urls as $url) {
                if (preg_match('/http:\\/\\/ci.nii.ac.jp\\/naid\\//', $url)) {
                    echo '<li>' . '<a href="' . $url . '" target="_new">' . $url . '</a></li>';
                }
            }
        }
        echo '</ul>';
        echo '</div>';
        //----------------------------------------------------------------------------------------------
        // Names
        $resp = $couch->send("GET", "/" . $config['couchdb'] . "/_design/publication/_view/taxonNames?key=" . urlencode('"' . $publication->_id . '"'));
        $names = json_decode($resp);
        if (count($names->rows) > 0) {
            echo '<h2>Names published</h2>';
            echo '<ul>';
            foreach ($names->rows as $row) {
                echo '<li>' . '<a href="id/' . $row->value->_id . '">' . $row->value->taxonName . '</a></li>';
            }
            echo '</ul>';
        }
        //----------------------------------------------------------------------------------------------
        // Content
        echo '<h2>Content</h2>';
        $has_fulltext = isset($publication->identifiers->biostor) || isset($publication->pdf);
        if (!$has_fulltext) {
            if (isset($publication->identifiers->doi)) {
                $url = 'http://dx.doi.org/' . $publication->identifiers->doi;
                echo '<div>';
                echo '<iframe src="' . $url . '" width="100%" height="700" style="border: none;">';
                echo '</iframe>';
                echo '</div>';
            }
        } else {
            // PDF
            if (isset($publication->pdf)) {
                echo '<div>';
                echo '<iframe src="http://docs.google.com/viewer?url=';
                echo urlencode($publication->pdf) . '&embedded=true" width="700" height="700" style="border: none;">';
                echo '</iframe>';
                echo '</div>';
            } else {
                // BioStor
                if (isset($publication->identifiers->biostor)) {
                    echo '<script> pages=[' . join(",", $publication->pageIdentifiers) . ']; </script>';
                    echo '				
<div style="position:relative;width:700px;height:700px;">
	<div id="header" >
		<div style="float:right;padding:8px;margin-right:10px;">
			<span id="page_counter">1/?</span>
			<span>&nbsp;</span>
			<span>&nbsp;</span>
			<img id="previous_page" src="images/previous.png" border="0" onclick="previous();" title="Show previous page">
			<span>&nbsp;</span>
			<img id="next_page" src="images/next.png" border="0" onclick="next();" title="Show next page">
			<span>&nbsp;</span>
			<span>&nbsp;</span>
			<span>&nbsp;</span>
			<img src="images/fourpages.png" border="0" onclick="show_all_pages();" title="Show all pages">
			<span>&nbsp;</span>
			<img src="images/onepage.png" border="0" onclick="show_page(-1);"  title="Fit page to viewer">
		</div>
	</div>

	<div id="page_container">
		<img id="page_image" />
		<div id="all_pages" ></div>
	</div>
</div>

<script>
show_page(0);
</script>';
                }
            }
        }
    }
    echo html_body_close();
    echo html_html_close();
}
예제 #9
0
        $image = bhl_fetch_page_image($reference->PageID);
        $imageURL = $image->thumbnail->url;
    } else {
        // if it's an article we could use journal image
        $imageURL = 'http://bioguid.info/issn/image.php?issn=' . $reference->issn;
    }
    echo '<td valign="top"><img style="border:1px solid rgb(192,192,192);" src="' . $imageURL . '" width="40" />';
    echo '</td>';
    echo '<td valign="top">';
    echo '<a href="' . $config['web_root'] . 'reference/' . $reference_id . '">' . $reference->title . '</a><br/>';
    echo '<span>' . reference_authors_to_text_string($reference);
    if (isset($reference->year)) {
        echo ' (' . $reference->year . ')';
    }
    echo ' ' . reference_to_citation_text_string($reference) . '</span>';
    echo ' ' . reference_to_coins($reference);
    if (0) {
        echo '<div>';
        echo bhl_pages_with_name_thumbnails($reference_id, $this->object->NameBankID);
        echo '</div>';
    }
    echo '</td>';
    echo '</tr>';
}
echo '</table>';
echo html_body_close(true);
// true to show Disqus comments
echo html_html_close();
?>