diff --git a/bibtexbrowser-documentation.wiki b/bibtexbrowser-documentation.wiki index 6273dc1..06d5a6b 100644 --- a/bibtexbrowser-documentation.wiki +++ b/bibtexbrowser-documentation.wiki @@ -265,17 +265,6 @@ return } -====How to use the change the title of the result page?==== - -You may create your own title function in ''bibtexbrowser.local.php'' (see "creating a bibtexbrowser.local.php" below): -
-define('BIBLIOGRAPHYTITLE','my_title_function');
-function my_title_function($query) {
-  return "Publications of the Nuclear Research Group";
-}
-
-See function DefaultBibliographyTitle for inspiration. - ====How to get the individual bib pages embedded as well?==== ''define('BIBTEXBROWSER_URL',""); '' @@ -331,6 +320,25 @@ foreach ($entries as $bibentry) { ?> +====How to use the change the title of the result page?==== + +You may create your own title function in ''bibtexbrowser.local.php'' (see "creating a bibtexbrowser.local.php" below): +
+define('BIBLIOGRAPHYTITLE','my_title_function');
+function my_title_function($query) {
+  return "Publications of the Nuclear Research Group";
+}
+
+See function DefaultBibliographyTitle for inspiration. + +====How to disallow crawler indexing?==== + +Add in ''bibtexbrowser.local.php'' (see "creating a bibtexbrowser.local.php" below): +
+define('BIBTEXBROWSER_ROBOTS_NOINDEX', true);
+
+ + =====Related tools===== diff --git a/bibtexbrowser.php b/bibtexbrowser.php index bd0ac19..e39e06a 100755 --- a/bibtexbrowser.php +++ b/bibtexbrowser.php @@ -70,6 +70,9 @@ function bibtexbrowser_configure($key, $value) { @define('ABBRV_TYPE','index');// may be year/x-abbrv/key/none/index/keys-index +// are robots allowed to crawl and index bibtexbrowser generated pages? +@define('BIBTEXBROWSER_ROBOTS_NOINDEX',false); + //the default view in the "main" (right hand side) frame @define('BIBTEXBROWSER_DEFAULT_FRAME','year=latest'); // year=latest,all and all valid bibtexbrowser queries @@ -2335,7 +2338,10 @@ class MenuManager { return ''; } - + function metadata() { + return array(array('robots','noindex')); + } + /** function called back by HTMLTemplate */ function display() { echo $this->searchView().'
'; @@ -2675,6 +2681,12 @@ class SimpleDisplay { $this->setEntries($bibdatabase->bibdb); } + function metadata() { + if (BIBTEXBROWSER_ROBOTS_NOINDEX) { + return array(array('robots','noindex')); + } + } + /** sets the entries to be shown */ function setEntries(&$entries) { $this->entries = $entries; @@ -2976,6 +2988,10 @@ class BibEntryDisplay { function metadata() { $result=array(); + if (BIBTEXBROWSER_ROBOTS_NOINDEX) { + $result[] = array('robots','noindex'); + } + if (METADATA_GS) { // the description may mix with the Google Scholar tags // we remove it @@ -3601,7 +3617,7 @@ usage: getTitle() * $title: title of the page */ -function HTMLTemplate(&$content,$metatags=array()/* an array name=>value*/) { +function HTMLTemplate(&$content) { // when we load a page with AJAX // the HTTP header is taken into account, not the @@ -3618,6 +3634,11 @@ echo ' metadata(); +} foreach($metatags as $item) { list($name,$value) = $item; echo ''."\n"; @@ -3707,6 +3728,7 @@ class BibtexDisplay { foreach($this->entries as $bibentry) { echo $bibentry->getText()."\n"; } exit; } + } /** creates paged output, e.g: [[http://localhost/bibtexbrowser/testPagedDisplay.php?page=1]] @@ -4145,7 +4167,7 @@ class Dispatcher { $menu = createMenuManager(); $menu->setDB($_GET[Q_DB]); $fun = $this->wrapper; - $fun($menu,array(array('robots','noindex'))); + $fun($menu); return 'END_DISPATCH'; } @@ -4183,7 +4205,7 @@ class Dispatcher { $bibdisplay = createBibEntryDisplay(); $bibdisplay->setEntries($entries); $fun = $this->wrapper; - $fun($bibdisplay,$bibdisplay->metadata()); + $fun($bibdisplay); } return 'END_DISPATCH'; }