Browse Source

added support for disabling the default message

hg/35a367e65a464cf6cdf277c73f977a6828b723fe/bookmarks/master
Martin Monperrus 13 years ago
parent
commit
3dd9e01389
  1. 32
      bibtexbrowser.php

32
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; }
?>
<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 */
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 == "") {
?>
<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>";
return; // we cannot set the db wtihout a bibfile
default_message();
exit;
}
// first does the bibfiles exist:

Loading…
Cancel
Save