diff --git a/bibtexbrowser-documentation.wiki b/bibtexbrowser-documentation.wiki index af5c054..72fc6b6 100755 --- a/bibtexbrowser-documentation.wiki +++ b/bibtexbrowser-documentation.wiki @@ -82,27 +82,25 @@ Create a bib file with the publication records (e.g. csgroup2008.bib) and upload =====FAQ===== ====How to embed Bibtexbrowser into a website?==== -To embed Bibtexbrowser into a website, you need to use it as a library: +To embed Bibtexbrowser into a website, you car use it as a library:
 <?php
 $_GET['library']=1;
+define('BIBTEXBROWSER_BIBTEX_LINKS',false); // no [bibtex] link by default
 require_once('bibtexbrowser.php');
 global $db;
 $db = new BibDataBase();
 $db->load('biblio.bib');
-?>
-
-Then, you have to call bibtexbrowser on you own: -
-<?php
 // printing all 2014 entries
+// can also be $query = array('year'=>'.*');
 $query = array('year'=>'2014');
 $entries=$db->multisearch($query);
 uasort($entries, 'compare_bib_entries'); 
+
 foreach ($entries as $bibentry) { 
-  echo $bibentry->toHTML(); 
+  echo $bibentry->toHTML()."<br/>"; 
 }
 ?>
 
diff --git a/bibtexbrowser.php b/bibtexbrowser.php index 36cade4..6ce13f2 100755 --- a/bibtexbrowser.php +++ b/bibtexbrowser.php @@ -140,7 +140,7 @@ if (defined('ENCODING')) { @define('BIBTEXBROWSER_AUTHOR_LINKS','homepage'); // BIBTEXBROWSER_LAYOUT defines the HTML rendering layout of the produced HTML -// may be table/list/ordered_list/definition (for ,
    ,
    resp.). +// may be table/list/ordered_list/definition/none (for
,
    ,
    , nothing resp.). // for list/ordered_list, the abbrevations are not taken into account (see ABBRV_TYPE) // for ordered_list, the index is given by HTML directly (in increasing order) @define('BIBTEXBROWSER_LAYOUT','table'); @@ -1587,8 +1587,9 @@ class BibEntry { /** Outputs HTML line according to layout */ - function toHTML() { + function toHTML($wrapped=false) { $result = ''; + if ($wrapped) { switch(BIBTEXBROWSER_LAYOUT) { // open row case 'list': $result .= '
  1. '; @@ -1603,6 +1604,8 @@ class BibEntry { $result .= '
    '; if (ABBRV_TYPE=='none') { die ('Cannot define an empty term!'); } break; + case 'none': + break; } $result .= $this->anchor(); switch(BIBTEXBROWSER_LAYOUT) { // close bibref and open bibitem @@ -1613,7 +1616,7 @@ class BibEntry { $result .= $this->getAbbrv().'
    '; break; } - + } // may be overridden using configuration value of BIBLIOGRAPHYSTYLE $result .= bib2html($this); @@ -1621,6 +1624,7 @@ class BibEntry { // may be overridden using configuration value of BIBTEXBROWSER_LINK_STYLE $result .= ' '.bib2links($this); + if ($wrapped) { switch(BIBTEXBROWSER_LAYOUT) { // close row case 'list': $result .= '
  2. '."\n"; @@ -1634,6 +1638,9 @@ class BibEntry { case 'definition': $result .= '
    '."\n"; break; + case 'none': + break; + } } return $result; } @@ -2987,7 +2994,7 @@ class SimpleDisplay { // by default, index are in decreasing order // so that when you add a publicaton recent , the indices of preceding publications don't change $bib->setIndex($count-($i++)); - echo $bib->toHTML(); + echo $bib->toHTML(true); $pred = $bib; } // end foreach @@ -4057,7 +4064,7 @@ class PagedDisplay { $index = ($this->page-1)*bibtexbrowser_configuration('PAGE_SIZE') + $i; if (isset($this->entries[$index])) { $bib = $this->entries[$index]; - echo $bib->toHTML(); + echo $bib->toHTML(true); } else { //break;