added support for disabling the default message
This commit is contained in:
+21
-11
@@ -61,6 +61,8 @@ define('BIBTEXBROWSER','v__MTIME__');
|
|||||||
// only displaying the n newest entries
|
// only displaying the n newest entries
|
||||||
@define('BIBTEXBROWSER_NEWEST',5);
|
@define('BIBTEXBROWSER_NEWEST',5);
|
||||||
|
|
||||||
|
@define('BIBTEXBROWSER_NO_DEFAULT', false);
|
||||||
|
|
||||||
// do we add [bibtex] links ?
|
// do we add [bibtex] links ?
|
||||||
// suggested by Sascha Schnepp
|
// suggested by Sascha Schnepp
|
||||||
@define('BIBTEXBROWSER_BIBTEX_LINKS',true);
|
@define('BIBTEXBROWSER_BIBTEX_LINKS',true);
|
||||||
@@ -141,6 +143,23 @@ function zetDB($bibtex_filenames) {
|
|||||||
return $db;
|
return $db;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** @nodoc */
|
||||||
|
function default_message() {
|
||||||
|
|
||||||
|
if (BIBTEXBROWSER_NO_DEFAULT) { return; }
|
||||||
|
|
||||||
|
?>
|
||||||
|
<div id="bibtexbrowser_message">
|
||||||
|
Congratulations! bibtexbrowser is correctly installed!<br/>
|
||||||
|
Now you have to pass the name of the bibtex file as parameter (e.g. bibtexbrowser.php?bib=mybib.php)<br/>
|
||||||
|
You may browse:<br/>
|
||||||
|
<?php
|
||||||
|
foreach (glob("*.bib") as $bibfile) {
|
||||||
|
$url="?bib=".$bibfile; echo '<a href="'.$url.'">'.$bibfile.'</a><br/>';
|
||||||
|
}
|
||||||
|
echo "</div>";
|
||||||
|
}
|
||||||
|
|
||||||
/** @nodoc */
|
/** @nodoc */
|
||||||
function _zetDB($bibtex_filenames) {
|
function _zetDB($bibtex_filenames) {
|
||||||
|
|
||||||
@@ -155,17 +174,8 @@ function _zetDB($bibtex_filenames) {
|
|||||||
|
|
||||||
// default bib file, if no file is specified in the query string.
|
// default bib file, if no file is specified in the query string.
|
||||||
if (!isset($bibtex_filenames) || $bibtex_filenames == "") {
|
if (!isset($bibtex_filenames) || $bibtex_filenames == "") {
|
||||||
?>
|
default_message();
|
||||||
<div id="bibtexbrowser_message">
|
exit;
|
||||||
Congratulations! bibtexbrowser is correctly installed!<br/>
|
|
||||||
Now you have to pass the name of the bibtex file as parameter (e.g. bibtexbrowser.php?bib=mybib.php)<br/>
|
|
||||||
You may browse:<br/>
|
|
||||||
<?php
|
|
||||||
foreach (glob("*.bib") as $bibfile) {
|
|
||||||
$url="?bib=".$bibfile; echo '<a href="'.$url.'">'.$bibfile.'</a><br/>';
|
|
||||||
}
|
|
||||||
echo "</div>";
|
|
||||||
return; // we cannot set the db wtihout a bibfile
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// first does the bibfiles exist:
|
// first does the bibfiles exist:
|
||||||
|
|||||||
Reference in New Issue
Block a user