Browse Source

*** empty log message ***

replace/c24a8d1de403113542ba0936e844151de2785013
Martin Monperrus 16 years ago
parent
commit
d1e268a7bf
  1. 21
      bibtexbrowser.php

21
bibtexbrowser.php

@ -3,7 +3,7 @@
bibtexbrowser is a PHP script that creates publication lists from Bibtex files. For feature requests, bug reports, or patch proposals, [[http://www.monperrus.net/martin/|please drop me an email ]] or comment this page. bibtexbrowser is a PHP script that creates publication lists from Bibtex files. For feature requests, bug reports, or patch proposals, [[http://www.monperrus.net/martin/|please drop me an email ]] or comment this page.
[[#Download|Download section]] [[#Download|Download section]]
11
=====Major features===== =====Major features=====
* **(11/2009)** Optimize your presence on Google Scholar: bibtexbrowser generates [[http://www.monperrus.net/martin/accurate+bibliographic+metadata+and+google+scholar|Google Scholar metadata]] * **(11/2009)** Optimize your presence on Google Scholar: bibtexbrowser generates [[http://www.monperrus.net/martin/accurate+bibliographic+metadata+and+google+scholar|Google Scholar metadata]]
* **(11/2009)** More and more academics use bibliographic software like [[http://www.zotero.org/|Zotero]] or [[http://www.mendeley.com/|Mendeley]]. bibtexbrowser generates [[http://ocoins.info/|COinS]] for automatic import of bibliographic entries. * **(11/2009)** More and more academics use bibliographic software like [[http://www.zotero.org/|Zotero]] or [[http://www.mendeley.com/|Mendeley]]. bibtexbrowser generates [[http://ocoins.info/|COinS]] for automatic import of bibliographic entries.
@ -765,7 +765,11 @@ class BibEntry {
/** Sets a type of this bib entry. */ /** Sets a type of this bib entry. */
function setType($value) { function setType($value) {
$this->fields[Q_TYPE] = $value;
// 2009-10-25 added trim
// to support space e.g. "@article {"
// as generated by ams.org
// thanks to Jacob Kellner
$this->fields[Q_TYPE] =trim($value);
} }
/** Tries to build a good URL for this entry */ /** Tries to build a good URL for this entry */
@ -929,13 +933,20 @@ class BibEntry {
/** Returns the verbatim text of this bib entry. */ /** Returns the verbatim text of this bib entry. */
return $this->text; return $this->text;
} }
/** Returns true if this bib entry contains the given phrase /** Returns true if this bib entry contains the given phrase
* in the given field. if $field is null, all fields are considered. * in the given field. if $field is null, all fields are considered.
* Note that this method is NOT case sensitive */ * Note that this method is NOT case sensitive */
function hasPhrase($phrase, $field = null) { function hasPhrase($phrase, $field = null) {
// 2010-01-25
// bug found by jacob kellner
// we have to search in the formatted fileds and not in the raw entry
// i.e. all latex markups are not considered for searches
// i.e. added join(" ",$this->getFields())
// and html_entity_decode
if (!$field) { if (!$field) {
return preg_match('/'.$phrase.'/i',$this->getConstants().$this->getText());
return preg_match('/'.$phrase.'/i',$this->getConstants().' '.html_entity_decode(join(" ",$this->getFields()),ENT_NOQUOTES,ENCODING));
//return stripos($this->getText(), $phrase) !== false; //return stripos($this->getText(), $phrase) !== false;
} }
if ($this->hasField($field) && (preg_match('/'.$phrase.'/i',$this->getField($field)) ) ) { if ($this->hasField($field) && (preg_match('/'.$phrase.'/i',$this->getField($field)) ) ) {
@ -1169,7 +1180,7 @@ function formatAuthorCommaSeparated($author){
* $_GET['library']=1; * $_GET['library']=1;
* $_GET['bib']='metrics.bib'; * $_GET['bib']='metrics.bib';
* $_GET['all']=1; * $_GET['all']=1;
* include('bibtexbrowser.php');
* include( 'bibtexbrowser.php' );
* new IndependentYearMenu(); * new IndependentYearMenu();
* new Dispatcher(); * new Dispatcher();
* *

Loading…
Cancel
Save