From 44d5d40dea599ad510a66e630d541cc18d97af3a Mon Sep 17 00:00:00 2001 From: Martin Monperrus Date: Tue, 3 Jul 2012 11:13:20 +0200 Subject: [PATCH] added support for disabling the default message --- bibtexbrowser.php | 32 +++++++++++++++++++++----------- 1 file changed, 21 insertions(+), 11 deletions(-) diff --git a/bibtexbrowser.php b/bibtexbrowser.php index 71412af..ce1de4a 100755 --- a/bibtexbrowser.php +++ b/bibtexbrowser.php @@ -61,6 +61,8 @@ define('BIBTEXBROWSER','v__MTIME__'); // only displaying the n newest entries @define('BIBTEXBROWSER_NEWEST',5); +@define('BIBTEXBROWSER_NO_DEFAULT', false); + // do we add [bibtex] links ? // suggested by Sascha Schnepp @define('BIBTEXBROWSER_BIBTEX_LINKS',true); @@ -141,6 +143,23 @@ function zetDB($bibtex_filenames) { return $db; } +/** @nodoc */ +function default_message() { + + if (BIBTEXBROWSER_NO_DEFAULT) { return; } + + ?> +
+ Congratulations! bibtexbrowser is correctly installed!
+ Now you have to pass the name of the bibtex file as parameter (e.g. bibtexbrowser.php?bib=mybib.php)
+ You may browse:
+ '.$bibfile.'
'; + } + echo "
"; +} + /** @nodoc */ function _zetDB($bibtex_filenames) { @@ -155,17 +174,8 @@ function _zetDB($bibtex_filenames) { // default bib file, if no file is specified in the query string. if (!isset($bibtex_filenames) || $bibtex_filenames == "") { - ?> -
- Congratulations! bibtexbrowser is correctly installed!
- Now you have to pass the name of the bibtex file as parameter (e.g. bibtexbrowser.php?bib=mybib.php)
- You may browse:
- '.$bibfile.'
'; - } - echo "
"; - return; // we cannot set the db wtihout a bibfile + default_message(); + exit; } // first does the bibfiles exist: