Skip to content
Snippets Groups Projects
Commit 4af94e6c authored by Gerhard Gonter's avatar Gerhard Gonter
Browse files
parents
No related branches found
No related tags found
No related merge requests found
Showing with 1695 additions and 0 deletions
AUTHORS 0 → 100644
This file lists current & previous members of the refbase development team
and other contributors.
Please avoid sending e-mail with refbase-related questions directly to them;
your questions are likely to be answered much faster if you post them to one
of the mailing lists or forums:
<http://support.refbase.net/>
msteffens:Matthias Steffens <refbase@extracts.de>:
Project manager, lead developer, application engineering & design
karnesky:Richard Karnesky <karnesky@gmail.com>:
Project manager, application engineering, MODS XML export, Endnote style,
COinS, update.php, some bugfixes & docs
pnault:Pierre Nault <pnault@users.sourceforge.net>:
Localization efforts, some bugfixes
Previous developers:
Michael Bartz <michaelbartz@users.sourceforge.net>:
Advisor
wendebaum:Jochen Wendebaum <wendebaum@users.sourceforge.net>:
Internationalization, german localization
Daniel Stepputtis <antedon@users.sourceforge.net>:
Documentation & general support
Thanks to:
- Joachim Almergren <jlacan@users.sourceforge.net>:
Various patches
- Oleksandr Moskalenko <oleksa@users.sourceforge.net>:
Troubleshooting and patch for directory renaming
- Dave Burt:
Fix for MODS encoding
- Nicholaus Lance Hepler <nhelper@gmail.com>:
Patch to retrieve information from PubMed before CrossRef
- Yibiao Bai <mountangellib@gmail.com> and Yong Fan, Shanxi Agricultural
University Library, China:
Chinese localization.
- Alexander Belozerov <alexander.belozerov@gmail.com>:
Russian localization.
- Masahiro Mikami <ZBN15427@nifty.com>:
Japanese localization.
- Chris Putnam <cdputnam@scripps.edu>:
Developer of Bibutils, a set of command line programs that interconvert
between various bibliography formats using a common XML intermediate.
<http://www.scripps.edu/~cdputnam/software/bibutils/bibutils.html>
- Mark Grimshaw <sirfragalot@users.sourceforge.net>:
Developer of MINIMALRTF, a minimal set of RTF coding methods to produce
Rich Text Format documents on the fly. <http://bibliophile.sourceforge.net>
- Wayne Munro at R&OS New Zealand:
Developer of the module-free pdf-PHP class that allows to dynamically create
PDF documents with PHP. <http://www.ros.co.nz/pdf>
- Ryan Parman and Geoffrey Sneddon:
Developers of the SimplePie PHP class that allows to manage RSS and Atom feeds
with PHP. <http://simplepie.org>
- Thomas Fuchs and contributors:
Developers of the script.aculo.us JavaScript framework. <http://script.aculo.us>
- Sam Stephenson and contributors:
Developers of the Prototype JavaScript framework. <http://www.prototypejs.org/>
- nijel and garvinhicking of the phpMyAdmin project:
Developers of zip.inc.php, which is used to zip OpenDocument files.
<http://www.phpmyadmin.net>
- Ryan Thrash:
Developer of the "Simple Rounded Corner CSS Boxes".
<http://www.modxcms.com/simple-rounded-corner-css-boxes.html>
see also the ThrashBox online generator at <http://www.spiffybox.com/>
- Hugh E. Williams and David Lane, authors of the book "Web Database Applications
with PHP and MySQL", published by O'Reilly & Associates, whose example code
helped getting started. <http://www.oreilly.com/catalog/webdbapps2/>
Many other people have contributed to this project with feature requests, bug
reports, testing, and helpful suggestions.
BUGS 0 → 100644
We are aware of the following problems, bugs and/or limitations:
- The clickable search links do not maintain the current sort order,
and they do not maintain the currently chosen fields in List view.
- For the main page, only partial HTML is returned when clicking one of the
clickable search links within the "more info" section underneath each
citation.
- The advanced search form employs lots of dynamic drop-down menus to ease
user entry of data. This works well for small databases (<10,000 records)
but may cause significant speed problems for larger databases!
- There's no support for transactions. This means that multiple users will be
able to edit the same record at the same time. This will usually cause the
record to be overwritten by the last submitter, but it could cause
surprising results. Please remember to reload record data if you kept a
record's "edit" form open for a long period of time.
- The 'allow_edit_call_number' permission setting isn't honoured yet.
- The process of internationalization and localization has not been completed
yet.
- Working simultaneously in different browser windows or tabs may cause some
unexpected results (due to referrer-related issues). You can avoid problems
if you reload the current browser window/tab before doing anything else in
that window/tab.
COPYING 0 → 100644
GNU GENERAL PUBLIC LICENSE
Version 2, June 1991
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
License is intended to guarantee your freedom to share and change free
software--to make sure the software is free for all its users. This
General Public License applies to most of the Free Software
Foundation's software and to any other program whose authors commit to
using it. (Some other Free Software Foundation software is covered by
the GNU Library General Public License instead.) You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
this service if you wish), that you receive source code or can get it
if you want it, that you can change the software or use pieces of it
in new free programs; and that you know you can do these things.
To protect your rights, we need to make restrictions that forbid
anyone to deny you these rights or to ask you to surrender the rights.
These restrictions translate to certain responsibilities for you if you
distribute copies of the software, or if you modify it.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must give the recipients all the rights that
you have. You must make sure that they, too, receive or can get the
source code. And you must show them these terms so they know their
rights.
We protect your rights with two steps: (1) copyright the software, and
(2) offer you this license which gives you legal permission to copy,
distribute and/or modify the software.
Also, for each author's protection and ours, we want to make certain
that everyone understands that there is no warranty for this free
software. If the software is modified by someone else and passed on, we
want its recipients to know that what they have is not the original, so
that any problems introduced by others will not reflect on the original
authors' reputations.
Finally, any free program is threatened constantly by software
patents. We wish to avoid the danger that redistributors of a free
program will individually obtain patent licenses, in effect making the
program proprietary. To prevent this, we have made it clear that any
patent must be licensed for everyone's free use or not licensed at all.
The precise terms and conditions for copying, distribution and
modification follow.
GNU GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License applies to any program or other work which contains
a notice placed by the copyright holder saying it may be distributed
under the terms of this General Public License. The "Program", below,
refers to any such program or work, and a "work based on the Program"
means either the Program or any derivative work under copyright law:
that is to say, a work containing the Program or a portion of it,
either verbatim or with modifications and/or translated into another
language. (Hereinafter, translation is included without limitation in
the term "modification".) Each licensee is addressed as "you".
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running the Program is not restricted, and the output from the Program
is covered only if its contents constitute a work based on the
Program (independent of having been made by running the Program).
Whether that is true depends on what the Program does.
1. You may copy and distribute verbatim copies of the Program's
source code as you receive it, in any medium, provided that you
conspicuously and appropriately publish on each copy an appropriate
copyright notice and disclaimer of warranty; keep intact all the
notices that refer to this License and to the absence of any warranty;
and give any other recipients of the Program a copy of this License
along with the Program.
You may charge a fee for the physical act of transferring a copy, and
you may at your option offer warranty protection in exchange for a fee.
2. You may modify your copy or copies of the Program or any portion
of it, thus forming a work based on the Program, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
a) You must cause the modified files to carry prominent notices
stating that you changed the files and the date of any change.
b) You must cause any work that you distribute or publish, that in
whole or in part contains or is derived from the Program or any
part thereof, to be licensed as a whole at no charge to all third
parties under the terms of this License.
c) If the modified program normally reads commands interactively
when run, you must cause it, when started running for such
interactive use in the most ordinary way, to print or display an
announcement including an appropriate copyright notice and a
notice that there is no warranty (or else, saying that you provide
a warranty) and that users may redistribute the program under
these conditions, and telling the user how to view a copy of this
License. (Exception: if the Program itself is interactive but
does not normally print such an announcement, your work based on
the Program is not required to print an announcement.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Program,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Program, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote it.
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Program.
In addition, mere aggregation of another work not based on the Program
with the Program (or with a work based on the Program) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
3. You may copy and distribute the Program (or a work based on it,
under Section 2) in object code or executable form under the terms of
Sections 1 and 2 above provided that you also do one of the following:
a) Accompany it with the complete corresponding machine-readable
source code, which must be distributed under the terms of Sections
1 and 2 above on a medium customarily used for software interchange; or,
b) Accompany it with a written offer, valid for at least three
years, to give any third party, for a charge no more than your
cost of physically performing source distribution, a complete
machine-readable copy of the corresponding source code, to be
distributed under the terms of Sections 1 and 2 above on a medium
customarily used for software interchange; or,
c) Accompany it with the information you received as to the offer
to distribute corresponding source code. (This alternative is
allowed only for noncommercial distribution and only if you
received the program in object code or executable form with such
an offer, in accord with Subsection b above.)
The source code for a work means the preferred form of the work for
making modifications to it. For an executable work, complete source
code means all the source code for all modules it contains, plus any
associated interface definition files, plus the scripts used to
control compilation and installation of the executable. However, as a
special exception, the source code distributed need not include
anything that is normally distributed (in either source or binary
form) with the major components (compiler, kernel, and so on) of the
operating system on which the executable runs, unless that component
itself accompanies the executable.
If distribution of executable or object code is made by offering
access to copy from a designated place, then offering equivalent
access to copy the source code from the same place counts as
distribution of the source code, even though third parties are not
compelled to copy the source along with the object code.
4. You may not copy, modify, sublicense, or distribute the Program
except as expressly provided under this License. Any attempt
otherwise to copy, modify, sublicense or distribute the Program is
void, and will automatically terminate your rights under this License.
However, parties who have received copies, or rights, from you under
this License will not have their licenses terminated so long as such
parties remain in full compliance.
5. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Program or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Program (or any work based on the
Program), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Program or works based on it.
6. Each time you redistribute the Program (or any work based on the
Program), the recipient automatically receives a license from the
original licensor to copy, distribute or modify the Program subject to
these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties to
this License.
7. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Program at all. For example, if a patent
license would not permit royalty-free redistribution of the Program by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Program.
If any portion of this section is held invalid or unenforceable under
any particular circumstance, the balance of the section is intended to
apply and the section as a whole is intended to apply in other
circumstances.
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system, which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
8. If the distribution and/or use of the Program is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Program under this License
may add an explicit geographical distribution limitation excluding
those countries, so that distribution is permitted only in or among
countries not thus excluded. In such case, this License incorporates
the limitation as if written in the body of this License.
9. The Free Software Foundation may publish revised and/or new versions
of the General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the Program
specifies a version number of this License which applies to it and "any
later version", you have the option of following the terms and conditions
either of that version or of any later version published by the Free
Software Foundation. If the Program does not specify a version number of
this License, you may choose any version ever published by the Free Software
Foundation.
10. If you wish to incorporate parts of the Program into other free
programs whose distribution conditions are different, write to the author
to ask for permission. For software which is copyrighted by the Free
Software Foundation, write to the Free Software Foundation; we sometimes
make exceptions for this. Our decision will be guided by the two goals
of preserving the free status of all derivatives of our free software and
of promoting the sharing and reuse of software generally.
NO WARRANTY
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
REPAIR OR CORRECTION.
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
convey the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Also add information on how to contact you by electronic and paper mail.
If the program is interactive, make it output a short notice like this
when it starts in an interactive mode:
Gnomovision version 69, Copyright (C) year name of author
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, the commands you use may
be called something other than `show w' and `show c'; they could even be
mouse-clicks or menu items--whatever suits your program.
You should also get your employer (if you work as a programmer) or your
school, if any, to sign a "copyright disclaimer" for the program, if
necessary. Here is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
`Gnomovision' (which makes passes at compilers) written by James Hacker.
<signature of Ty Coon>, 1 April 1989
Ty Coon, President of Vice
This General Public License does not permit incorporating your program into
proprietary programs. If your program is a subroutine library, you may
consider it more useful to permit linking proprietary applications with the
library. If this is what you want to do, use the GNU Library General
Public License instead of this License.
This diff is collapsed.
INSTALL 0 → 100644
How to install?
---------------
- You'll need a web server and an existing PHP and MySQL installation.
If you require help on installation of these packages please visit
<http://httpd.apache.org>, <http://php.net> and <http://mysql.com>.
- Move all refbase-0.9.7 files to your web directory.
- Open the file 'initialize/db.inc.php' in a text editor and edit the values
of the variables '$databaseName', '$username' and '$password' to fit your
needs.
(Note that you might be able to use the refbase package without modifying
these variables, but we highly recommend not to use the default values!)
- Now, open a web browser and access the 'install.php' script by typing:
<http://SERVER_ADDRESS/PATH_ON_SERVER/install.php>
(where the string 'SERVER_ADDRESS' is replaced by your server name and
'PATH_ON_SERVER' is the actual path to your refbase-0.9.7 web directory)
This should bring up the install form. Edit the contents of all text entry
fields to match your server setup and supply the MySQL admin password, then
click the 'Install' button to complete the installation process.
WIN32: Be sure to set a password for the MySQL root user. The path to MySQL
is probably '/Program Files/MySQL/bin/mysql.exe' or
'/wamp/mysql/bin/mysql.exe', or wherever you've installed MySQL.
- Please delete 'install.php' and 'update.php' from your webserver.
Solutions for known problems and general troubleshooting tips are given at:
<http://troubleshooting.refbase.net>
See also:
<http://requirements.refbase.net>
<http://install.refbase.net>
How to setup your own admin user?
---------------------------------
- After you've successfully installed the database (see above), open the main
page ('index.php') and login with:
Email = user@refbase.net
Password = start
You should now see a welcome message at the top right corner of the page
confirming your successful login.
- Click on 'Add User' which should bring up an empty form. At a minimum, you
have to specify the admin's first name & last name, his institutional
abbreviation as well as his email address and password. Then click the 'Add
User' button. You will be shown a receipt page with the account details you
just entered.
- Now open the file 'initialize/ini.inc.php' in a text editor and change the
value of the '$adminLoginEmail' variable to the email address you've
specified for your new admin user.
- Log out from the database, then login again using the email address and
password of your newly created admin account.
- You can now delete the initial user by choosing 'Manage Users' and clicking
the appropriate trash icon. (However, we recommend to keep this user until
you've explored the example records that come with the database)
See also:
<http://adduser.refbase.net>
How to configure the database?
------------------------------
In order to properly configure your database you'll need to edit the global
configuration file:
- Open the file 'initialize/ini.inc.php' & edit all values of the contained
variables to fit your needs. Please see the comments within the file for
further guidance.
Especially note that if you've chosen 'utf8' (Unicode) as default character
set on installation, you must re-save the file 'ini.inc.php' with Unicode
encoding (UTF-8, no BOM) and set variable '$contentTypeCharset' to 'UTF-8'.
See also:
<http://configure.refbase.net>
Import Options
--------------
refbase offers batch import of records via the web interface ('import.php') or
the command line ('contrib/command_line/refbase_import'). These scripts allow
to import records from various common bibliographic formats (BibTeX, Copac,
Endnote (tagged text & XML), MODS XML, RefWorks, RIS or SciFinder) as well as
from online databases (CSA Illumina, ISI Web of Science or PubMed (MEDLINE & XML)).
If you're coming from Endnote you may want to try out the Endnote style file
and PHP script that's included with refbase. This style file and PHP script
allows Endnote users to transfer data into refbase at the command line (see
the README file in the 'contrib/endnote' directory for further information).
In addition, refbase allows PHP developers to write their own import parsers
and use the provided templates to import their records into the refbase
database (see the 'contrib/import_templates' directory for available
templates).
If you can't use any of the above mentioned import options, you might be able
to convert your data into a tab-delimited text format that can be imported
directly into the MySQL database. Here are some notes how to prepare
tab-delimited data for direct upload into your newly created MySQL tables:
- Fields are separated by tabs, records are separated by returns
(if not specified otherwise within the LOAD DATA statement).
- The order of fields must resemble the field order specified in the MySQL
table 'refs'. Field information for table 'refs' is given at:
<http://wiki.refbase.net/index.php/Table_refs>
- DATE format must be YYYY-MM-DD and TIME format must be HH:MM:SS.
- Carriage returns *within* fields must be represented by a newline character
('\n', ASCII character 10).
- Empty fields must be indicated by \N.
- Character encoding: if you've chose 'latin1' as default character set upon
installation, higher ASCII chars must be encoded as ISO-8859-1 aka 'Western
(ISO Latin 1)', otherwise data should be encoded as Unicode (UTF-8, no BOM).
- File encoding must be UNIX.
- Assuming your data file is named 'refs.txt', you should be able to upload
your data via use of the 'mysql' command line interpreter:
LOAD DATA LOCAL INFILE "/PATH/TO/FILE/refs.txt" INTO TABLE refs;
or, alternatively, use something like the following from your shell:
mysqlimport --local -u root -p YOUR_DB_NAME "/PATH/TO/FILE/refs.txt"
Note that if you're going to use the mysqlimport data import program the
data file *must* be named 'refs.txt'.
See also:
<http://import.refbase.net>
Skins
-----
refbase ships with alternative skins to change the appearance of the program.
These are in the 'contrib/skins' directory. You can replace your
'includes/header.inc.php', 'includes/footer.inc.php' with these. You may also
need to copy files to the 'css' directory.
Please contribute other skins to <info@refbase.net>.
Extensions for other software
-----------------------------
In 'contribs/mediawiki', there is an extension for MediaWiki to more easily
include reference information from refbase in a wiki page. This will also
allow you to use Wikipedia's citation templates, which may have an appearance
that you like or might be easier for you (and the other users of your wiki) to
customize.
NEWS 0 → 100644
This diff is collapsed.
README 0 → 100644
refbase 0.9.7 README
====================
About refbase
-------------
refbase is a web-based solution for managing scientific literature,
references and citations.
Currently, the following features have been implemented for:
EVERYONE
- search the database using different search forms
- search within results
- browse found records and sort results by any database field
- view results in different views (list view, citations, details,
print view)
- display results in different citation styles & output formats
- export selected records to XML (Atom, MODS, OAI_DC, ODF) and (via
the GPLed Bibutils programs) to ADS, BibTeX, EndNote, ISI, RIS and
Word XML
- display rich text (i.e., italics, super/sub-script, greek letters)
- extract citations from a text & build an appropriate reference list
- track additions via RSS and generate custom RSS feeds from searches
- web services (SRU & OpenSearch) that allow clients to access a
refbase database using a standard query syntax and retrieve results
in structured XML format
- dissemination of bibliographic data via standard methods (COinS &
unAPI) allowing clients to automatically discover and extract data
from refbase
- search a refbase online database from the command line and retrieve
results in various export & citation formats
LOGGED IN USERS
- user-specific fields which are stored individually for each user
- import of records from common bibliographic formats and online
databases via the web interface or the command line
- automatic email announcements for newly added records
- save and recall search queries
- adding records to user-specific groups
- add/edit/delete records as well as file upload & download links
ADMINISTRATOR
- user management interface provided to the database admin
- set access permissions on a per-user basis
More information is given at:
<http://features.refbase.net>
Credits
-------
See AUTHORS
Requirements
------------
refbase requires:
- a web server (like the Apache HTTP Server <http://httpd.apache.org/>)
- PHP <http://www.php.net/> (version 5.2.0 or greater) with enabled
session support & installed PHP MySQL module
- MySQL <http://www.mysql.com/> (version 4.1.x or greater required for
Unicode support)
- for import and export of various formats (e.g., Endnote & BibTeX):
Bibutils <http://www.refbase.net/index.php/Bibutils>
(version 3.21 or greater)
More detailed information is available at:
<http://requirements.refbase.net>
Installation & Import
---------------------
See INSTALL
Update
------
See UPDATE
New Features
------------
See NEWS
Changelog
---------
See ChangeLog
Known issues
------------
See BUGS
What is missing?
----------------
See TODO
License
-------
See COPYING
Further information
-------------------
For more information about the refbase project and pointers to working
examples of refbase please visit:
<http://www.refbase.net/> or <http://refbase.sourceforge.net/>
TODO 0 → 100644
Suggestions for improving refbase:
- Open up the refbase group (aka tagging) mechanism so that groups can be made
public, group-specific or private.
- Improved search capabilities which, e.g., allow for 'OR' searches and/or a
Google-like search syntax. One possible solution might be to offer support for
the Contextual Query Language (CQL) across the entire interface. More flexible
handling of accented characters and umlauts would be also desirable.
- Offer means to auto-detect duplicates on import, link duplicate entries with
their original ones and allow users to migrate their user-specific data from a
duplicate record to the original. It would be also nice if duplicate records
could be hidden from the interface.
- Improve the installation process so that the web-based installer works with
more server setups (including installation on shared hosts), and allows
setting important config options via the web interface.
- More user-specific and record-specific rights management.
- Provide additional citation styles, preferably via the use of a plugin
mechanism which would make it easy to add or edit citation styles. Support for
the Citation Style Language (CSL) would be desirable.
- Increase number of supported resource types and allow users to add their own
types. A hierarchical system with basic fallback types would be desirable.
- Provide a machine-readable interface (API) that not only allows clients to
query a refbase database and retrieve results in a structured format, but that
also allows modification of any database information.
- Provide better integration with desktop reference managers so that users could
search an online refbase database from within their desktop application, or
upload (and eventually synch) records to a refbase server directly from within
their desktop application.
- Upon add/edit, offer to auto-fill empty fields based on information available
in other fields/records/tables or via web services. Eventually, such a system
could also be used to validate data that were entered/imported by the user.
- Simplify manual data input by providing record type specific forms. These
forms could guide a user by only showing (or at least indicating) those fields
that are required for a particular record type (like journal articles, book
chapters or whole books).
- Allow users to upload multiple files per record.
- Allow users to specify multiple URLs for the same record, and eventually
provide a customizable system for auto-generation of links (based on the
record's metadata).
- Store record identifiers from foreign repositories (e.g. arXiv.org or
PubMed.gov) in some dedicated field(s), which would allow to easily
auto-generate links back to these repositories.
- Implement the OAI Protocol for Metadata Harvesting which would provide (yet
another) standard way for software to retrieve information from refbase.
- More localizations, i.e. translations of the refbase interface into other
languages.
- Cross-site searches (both through other copies of refbase and through other
bibliographic databases).
- Refactor for more code reuse (share more between cite/list/details views,
etc.), and eventually modularize the code to allow for other RDBMS, custom
database schemes and/or a plugin mechanism.
- Provide better interface customization via a templating/skin mechanism and/or
improved CSS styling.
- Allow the admin to add any custom fields and/or alter the layout of available
fields.
- More embedding of citation metadata in HTML pages in a machine-readable form
(such as embedded RDF or microformats) which may be processed by clients.
- Improved export through both revisions to the current MODS XML/bibutils system
and through adding more native export options which wouldn't require bibutils.
- User customization: provide a user-specific preferences page where one could
specify the default view and the default columns that are visible in query
results or the default fields that are visible in particular search forms.
- Easier import of bibliographic data from web sources via bookmarklets and/or
scrapers.
- Offer a notes/comment system where multiple notes (of unlimited length) would
be allowed for a particular record and where notes would be searchable, and
could be made public, group-specific or private.
- Enable remembering of marked records across different requests.
- Provide an administrative interface to deleted records.
A more detailed list of planned feature additions is given at:
<http://additions.refbase.net>
UPDATE 0 → 100644
Please follow the steps below to update an existing refbase installation to
refbase-0.9.7. The update script should also be able to update any refbase
version that was installed from SVN prior to the release of refbase-0.9.7. To
update versions of refbase prior to refbase-0.8.0, please update to
refbase-0.8.0 first.
- First of all, please make sure that you have a recent backup of your refbase
MySQL database! This can be accomplished by issuing the following command
from your shell:
mysqldump DATABASE_NAME -uADMINUSER -p --complete-insert --opt > refbase.sql
In the above line, replace DATABASE_NAME with the database name that you've
specified for the variable '$databaseName' (in file
'initialize/db.inc.php'). Similarly, replace ADMINUSER with the name of the
administrative user that has full access to the refbase MySQL database. As
an example, if the variable '$databaseName' is set to "literature" and your
administrative user is "root", the above line would read:
mysqldump literature -uroot -p --complete-insert --opt > refbase.sql
WARNING: If using MySQL 4.1.x, mysqldump's charset conversion may damage
data. If necessary, use the '--default-character-set=latin1' option
to avoid the conversion. More info is available at
<http://backup.refbase.net>.
- Backup your original configuration files 'initialize/db.inc.php' and
'initialize/ini.inc.php'. Optionally, you may want to backup all of your
existing refbase scripts.
- Move all refbase-0.9.7 files to your server's web directory.
- Open the file 'initialize/db.inc.php' in a text editor and re-enter the
values from your old 'db.inc.php' file for the variables '$databaseName',
'$username' and '$password'. Similarly, migrate all custom values that
you've entered within the old 'ini.inc.php' file to the new one.
- Now, open a web browser and access the 'update.php' script by typing:
<http://SERVER_ADDRESS/PATH_ON_SERVER/update.php>
(where the string 'SERVER_ADDRESS' is replaced by your server name and
'PATH_ON_SERVER' is the actual path to your refbase-0.9.5 web directory)
This should bring up the update form. Edit the contents of all text entry
fields to match your server setup and supply the MySQL admin password, then
click the 'Update' button to update the database.
WIN32: Be sure to set a password for the MySQL root user.
This will add the MySQL tables that were added in 0.9.x and alter existing
tables to match the table design used by refbase-0.9.x. A detailed log is
generated for all performed update actions. Your data should remain
untouched by this operation.
- After you've successfully performed the update, please remove the files
'update.php' & 'update.sql' (as well as 'install.php' & 'install.sql') from
your web directory.
- Note: The update process modifies some existing formats in table 'formats'
and adds additional ones. Please login as admin and make sure that suitable
import, export and citation formats are enabled for all of your users within
the "Display Options" section of the admin interface.
See also:
<http://update.refbase.net>
This diff is collapsed.
<?php
// Project: Web Reference Database (refbase) <http://www.refbase.net>
// Copyright: Matthias Steffens <mailto:refbase@extracts.de> and the file's
// original author(s).
//
// This code is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY. Please see the GNU General Public
// License for more details.
//
// File: ./cite/formats/cite_ascii.php
// Repository: $HeadURL: https://svn.code.sf.net/p/refbase/code/branches/bleeding-edge/cite/formats/cite_ascii.php $
// Author(s): Matthias Steffens <mailto:refbase@extracts.de>
//
// Created: 10-Jun-06, 02:54
// Modified: $Date: 2012-02-27 21:25:30 +0100 (Mon, 27 Feb 2012) $
// $Author: msteffens $
// $Revision: 1337 $
// This is a citation format file (which must reside within the 'cite/formats/' sub-directory of your refbase root directory). It contains a
// version of the 'citeRecords()' function that outputs a reference list from selected records in plain text format. Plain text output is
// mainly meant for command line interfaces such as the refbase command line client (<http://cli.refbase.net/>).
// --------------------------------------------------------------------
// --- BEGIN CITATION FORMAT ---
function citeRecords($result, $rowsFound, $query, $queryURL, $showQuery, $showLinks, $rowOffset, $showRows, $previousOffset, $nextOffset, $wrapResults, $citeStyle, $citeOrder, $citeType, $orderBy, $headerMsg, $userID, $viewType)
{
global $officialDatabaseName; // these variables are defined in 'ini.inc.php'
global $databaseBaseURL;
global $contentTypeCharset;
global $client;
// The array '$transtab_refbase_ascii' contains search & replace patterns for conversion from refbase markup to plain text
global $transtab_refbase_ascii; // defined in 'transtab_refbase_ascii.inc.php'
$plainTextData = ""; // make sure that our buffer variable is empty
// Header:
if (!empty($headerMsg))
{
// Decode any HTML entities:
// (these may occur in the header message e.g. if the user's preferred display language is not English but German or French, etc)
$headerMsg = decodeHTML($contentTypeCharset, $headerMsg); // function 'decodeHTML()' is defined in 'include.inc.php', and '$contentTypeCharset' is defined in 'ini.inc.php'
// Convert refbase markup in the header message into plain text:
$headerMsg = searchReplaceText($transtab_refbase_ascii, $headerMsg, true); // function 'searchReplaceText()' is defined in 'include.inc.php'
$plainTextData .= "$headerMsg\n\n"; // prefix any passed header message
}
// Initialize array variables:
$yearsArray = array();
$typeTitlesArray = array();
// Define inline text markup to be used by the 'citeRecord()' function:
$markupPatternsArray = array("bold-prefix" => "", // for plain text output, we'll omit any font-shape markup
"bold-suffix" => "",
"italic-prefix" => "",
"italic-suffix" => "",
"underline-prefix" => "",
"underline-suffix" => "",
"endash" => "-",
"emdash" => "-",
"ampersand" => "&",
"double-quote" => '"',
"double-quote-left" => '"',
"double-quote-right" => '"',
"single-quote" => "'",
"single-quote-left" => "'",
"single-quote-right" => "'",
"less-than" => "<",
"greater-than" => ">",
"newline" => "\n"
);
// Defines search & replace 'actions' that will be applied upon TEXT output to all those refbase fields that are listed
// in the corresponding 'fields' element:
$plainTextSearchReplaceActionsArray = array(
array('fields' => array("title", "publication", "abbrev_journal", "address", "keywords", "abstract", "orig_title", "series_title", "abbrev_series_title", "notes"),
'actions' => $transtab_refbase_ascii
)
);
// For CLI queries, we'll allow paging thru the result set, i.e. we honour the values of the CLI options '-S|--start' ('$rowOffset')
// and '-R|--rows' ('$showRows') ('$rowOffset' and '$showRows' are re-assigned in function 'seekInMySQLResultsToOffset()' in 'include.inc.php')
if (preg_match("/^cli/i", $client)) // if the query originated from a command line client such as the "refbase" CLI client ("cli-refbase-1.0")
$showMaxRows = $showRows; // show only rows up to the value given in '$showRows'
else
$showMaxRows = $rowsFound; // otherwise show all rows
// LOOP OVER EACH RECORD:
// Fetch one page of results (or less if on the last page)
// (i.e., upto the limit specified in $showMaxRows) fetch a row into the $row array and ...
for ($rowCounter=0; (($rowCounter < $showMaxRows) && ($row = @ mysql_fetch_array($result))); $rowCounter++)
{
foreach ($row as $rowFieldName => $rowFieldValue)
// Apply search & replace 'actions' to all fields that are listed in the 'fields' element of the arrays contained in '$plainTextSearchReplaceActionsArray':
foreach ($plainTextSearchReplaceActionsArray as $fieldActionsArray)
if (in_array($rowFieldName, $fieldActionsArray['fields']))
$row[$rowFieldName] = searchReplaceText($fieldActionsArray['actions'], $row[$rowFieldName], true); // function 'searchReplaceText()' is defined in 'include.inc.php'
// Order attributes according to the chosen output style & record type:
$record = citeRecord($row, $citeStyle, $citeType, $markupPatternsArray, false); // function 'citeRecord()' is defined in the citation style file given in '$citeStyleFile' (which, in turn, must reside in the 'cite' directory of the refbase root directory), see function 'generateCitations()'
// Print out the current record:
if (!empty($record)) // unless the record buffer is empty...
{
// Print any section heading(s):
if (preg_match("/year|type/i", $citeOrder))
{
list($yearsArray, $typeTitlesArray, $sectionHeading) = generateSectionHeading($yearsArray, $typeTitlesArray, $row, $citeOrder, "", "", "", "\n\n", "", "\n\n"); // function 'generateSectionHeading()' is defined in 'cite.inc.php'
$plainTextData .= $sectionHeading;
}
// Write plain TEXT paragraph:
if (preg_match("/^cli/i", $client)) // when outputting results to a command line client, we'll prefix the record with it's serial number (and it's user-specific cite key, if available)
{
// This is a stupid hack that maps the names of the '$row' array keys to those used
// by the '$formVars' array (which is required by function 'generateCiteKey()')
// (eventually, the '$formVars' array should use the MySQL field names as names for its array keys)
$formVars = buildFormVarsArray($row); // function 'buildFormVarsArray()' is defined in 'include.inc.php'
// Generate or extract the cite key for this record:
// NOTE: currently, the following placeholders are not available for citation output:
// <:keywords:>, <:issn:>, <:area:>, <:notes:>, <:userKeys:>
// if the cite key specification uses one of these placeholders, it will get ignored
$citeKey = generateCiteKey($formVars); // function 'generateCiteKey()' is defined in 'include.inc.php'
$plainTextData .= "[" . $row['serial'] . "] ";
if (!empty($citeKey))
// Use the custom cite key that's been build according to the user's individual export options:
$plainTextData .= "{" . $citeKey . "} ";
}
$plainTextData .= $record . "\n\n"; // create paragraph with encoded record text
}
}
if (preg_match("/^cli/i", $client)) // when outputting results to a command line client, we'll append some info about the number of rows displayed/found, the database name/URL and optionally display the SQL query
{
// Calculate the maximum result number on each page:
if (($rowOffset + $showRows) < $rowsFound)
$showMaxRow = ($rowOffset + $showRows); // maximum result number on each page
else
$showMaxRow = $rowsFound; // for the last results page, correct the maximum result number if necessary
if ($rowsFound == 1)
$footerInfoPart = " record found";
else
$footerInfoPart = " records found";
$rowsFoundInfo = ($rowOffset + 1) . "-" . $showMaxRow . " of " . $rowsFound . $footerInfoPart; // prints e.g. "1-5 of 23 records found"
$rowsFoundDelimiter = preg_replace("/./i", "-", $rowsFoundInfo); // generate a line of hyphens which has the same length as the string in '$rowsFoundInfo' (e.g. "-----------------------")
$plainTextData .= $rowsFoundDelimiter . "\n" . $rowsFoundInfo . "\n\n"; // append info about rows displayed/found
$plainTextData .= $officialDatabaseName . "\n" . $databaseBaseURL . "\n\n"; // append database name and URL (comment this line if you don't like that)
if ($showQuery == "1") // display SQL query:
$plainTextData .= "Query: " . $query . "\n\n";
}
return $plainTextData;
}
// --- END CITATION FORMAT ---
?>
This diff is collapsed.
<?php
// Project: Web Reference Database (refbase) <http://www.refbase.net>
// Copyright: Matthias Steffens <mailto:refbase@extracts.de> and the file's
// original author(s).
//
// This code is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY. Please see the GNU General Public
// License for more details.
//
// File: ./cite/formats/cite_latex.php
// Repository: $HeadURL: https://svn.code.sf.net/p/refbase/code/branches/bleeding-edge/cite/formats/cite_latex.php $
// Author(s): Matthias Steffens <mailto:refbase@extracts.de>
//
// Created: 10-Jun-06, 02:32
// Modified: $Date: 2012-02-27 21:25:30 +0100 (Mon, 27 Feb 2012) $
// $Author: msteffens $
// $Revision: 1337 $
// This is a citation format file (which must reside within the 'cite/formats/' sub-directory of your refbase root directory). It contains a
// version of the 'citeRecords()' function that outputs a reference list from selected records in LaTeX format.
//
// --------------------------------------------------------------------
// --- BEGIN CITATION FORMAT ---
function citeRecords($result, $rowsFound, $query, $queryURL, $showQuery, $showLinks, $rowOffset, $showRows, $previousOffset, $nextOffset, $wrapResults, $citeStyle, $citeOrder, $citeType, $orderBy, $headerMsg, $userID, $viewType)
{
global $contentTypeCharset; // defined in 'ini.inc.php'
global $client;
// The array '$transtab_refbase_latex' contains search & replace patterns for conversion from refbase markup to LaTeX markup & entities.
// Converts refbase fontshape markup (italic, bold) into LaTeX commands of the 'textcomp' package, super- and subscript as well as greek
// symbols get converted into the respective commands in math mode. You may need to adopt the LaTeX markup to suit your individual needs.
global $transtab_refbase_latex; // defined in 'transtab_refbase_latex.inc.php'
// The arrays '$transtab_latin1_latex' and '$transtab_unicode_latex' provide translation tables for best-effort conversion of higher ASCII
// characters from ISO-8859-1 (or Unicode, respectively) to LaTeX entities.
global $transtab_latin1_latex; // defined in 'transtab_latin1_latex.inc.php'
global $transtab_unicode_latex; // defined in 'transtab_unicode_latex.inc.php'
// Initialize array variables:
$yearsArray = array();
$typeTitlesArray = array();
// Define inline text markup to be used by the 'citeRecord()' function:
$markupPatternsArray = array("bold-prefix" => "\\textbf{",
"bold-suffix" => "}",
"italic-prefix" => "\\textit{",
"italic-suffix" => "}",
"underline-prefix" => "\\ul{", // the '\ul' command requires '\usepackage{soul}'
"underline-suffix" => "}",
"endash" => "--", // or use '{\\textendash}'
"emdash" => "---", // or use '{\\textemdash}'
"ampersand" => "&", // conversion of ampersands is done below, after the citation has been generated
"double-quote" => '"',
"double-quote-left" => "{\\textquotedblleft}",
"double-quote-right" => "{\\textquotedblright}",
"single-quote" => "'", // same as for ampersands
"single-quote-left" => "{\\textquoteleft}",
"single-quote-right" => "{\\textquoteright}",
"less-than" => "<",
"greater-than" => ">",
"newline" => "\n\n"
);
// Defines search & replace 'actions' that will be applied upon LaTeX output to all those refbase fields that are listed
// in the corresponding 'fields' element:
$latexSearchReplaceActionsArray = array(
array('fields' => array("title", "publication", "abbrev_journal", "address", "keywords", "abstract", "orig_title", "series_title", "abbrev_series_title", "notes"),
'actions' => $transtab_refbase_latex
)
);
// For CLI queries, we'll allow paging thru the result set, i.e. we honour the values of the CLI options '-S|--start' ('$rowOffset')
// and '-R|--rows' ('$showRows') ('$rowOffset' and '$showRows' are re-assigned in function 'seekInMySQLResultsToOffset()' in 'include.inc.php')
if (preg_match("/^cli/i", $client)) // if the query originated from a command line client such as the "refbase" CLI client ("cli-refbase-1.0")
$showMaxRows = $showRows; // show only rows up to the value given in '$showRows'
else
$showMaxRows = $rowsFound; // otherwise show all rows
// Setup the basic LaTeX document structure:
$latexData = "%&LaTeX\n"
. "\\documentclass{article}\n\n";
// NOTE: the "Vancouver" & "Harvard 1" citation styles make use of the '\ul' command which requires '\usepackage{soul}'
// TODO: figure out a better logic when to include the '\usepackage{soul}' statement (or should we simply always include it?)
if (preg_match("/^(Vancouver|Harvard 1)$/i", $citeStyle))
$latexData .= "\\usepackage{soul}\n";
if ($contentTypeCharset == "UTF-8")
$latexData .= "\\usepackage[utf8]{inputenc}\n";
else
$latexData .= "\\usepackage[latin1]{inputenc}\n";
$latexData .= "\\usepackage[T1]{fontenc}\n"
. "\\usepackage{textcomp}\n\n";
$latexData .= "\\begin{document}\n\n";
// Header:
if (!empty($headerMsg))
{
// Remove any colon (":") from end of header message:
$headerMsg = trimTextPattern($headerMsg, ":", false, true); // function 'trimTextPattern()' is defined in 'include.inc.php'
// Decode any HTML entities:
// (these may occur in the header message e.g. if the user's preferred display language is not English but German or French, etc)
$headerMsg = decodeHTML($contentTypeCharset, $headerMsg); // function 'decodeHTML()' is defined in 'include.inc.php', and '$contentTypeCharset' is defined in 'ini.inc.php'
// Convert refbase markup in the header message into appropriate LaTeX markup & entities:
$headerMsg = searchReplaceText($transtab_refbase_latex, $headerMsg, true); // function 'searchReplaceText()' is defined in 'include.inc.php'
// Attempt to convert higher ASCII chars (i.e., characters with an ASCII value of >= 128) in the header message to their corresponding LaTeX entities:
if ($contentTypeCharset == "UTF-8")
$headerMsg = searchReplaceText($transtab_unicode_latex, $headerMsg, false);
else
$headerMsg = searchReplaceText($transtab_latin1_latex, $headerMsg, false);
$latexData .= "\\title{" . $headerMsg . "}\n\n"
. "\\maketitle\n\n";
}
if (!preg_match("/type|year/i", $citeOrder))
$latexData .= "\\begin{thebibliography}{" . $showMaxRows . "}\n\n";
// LOOP OVER EACH RECORD:
// Fetch one page of results (or less if on the last page)
// (i.e., upto the limit specified in $showMaxRows) fetch a row into the $row array and ...
for ($rowCounter=0; (($rowCounter < $showMaxRows) && ($row = @ mysql_fetch_array($result))); $rowCounter++)
{
foreach ($row as $rowFieldName => $rowFieldValue)
// Apply search & replace 'actions' to all fields that are listed in the 'fields' element of the arrays contained in '$latexSearchReplaceActionsArray':
foreach ($latexSearchReplaceActionsArray as $fieldActionsArray)
if (in_array($rowFieldName, $fieldActionsArray['fields']))
$row[$rowFieldName] = searchReplaceText($fieldActionsArray['actions'], $row[$rowFieldName], true); // function 'searchReplaceText()' is defined in 'include.inc.php'
// Order attributes according to the chosen output style & record type:
$record = citeRecord($row, $citeStyle, $citeType, $markupPatternsArray, false); // function 'citeRecord()' is defined in the citation style file given in '$citeStyleFile' (which, in turn, must reside in the 'cite' directory of the refbase root directory), see function 'generateCitations()'
// Print out the current record:
if (!empty($record)) // unless the record buffer is empty...
{
// Print any section heading(s):
if (preg_match("/year|type/i", $citeOrder))
{
list($yearsArray, $typeTitlesArray, $sectionHeading) = generateSectionHeading($yearsArray, $typeTitlesArray, $row, $citeOrder, "", "", "\\section*{", "}\n\n", "\\subsection*{", "}\n\n"); // function 'generateSectionHeading()' is defined in 'cite.inc.php'
$latexData .= $sectionHeading;
}
// Attempt to convert higher ASCII chars (i.e., characters with an ASCII value of >= 128) to their corresponding LaTeX entities:
if ($contentTypeCharset == "UTF-8")
$recordEncoded = searchReplaceText($transtab_unicode_latex, $record, false); // function 'searchReplaceText()' is defined in 'include.inc.php'
else
$recordEncoded = searchReplaceText($transtab_latin1_latex, $record, false);
// Write LaTeX paragraph:
if (!preg_match("/type|year/i", $citeOrder))
{
// This is a stupid hack that maps the names of the '$row' array keys to those used
// by the '$formVars' array (which is required by function 'generateCiteKey()')
// (eventually, the '$formVars' array should use the MySQL field names as names for its array keys)
$formVars = buildFormVarsArray($row); // function 'buildFormVarsArray()' is defined in 'include.inc.php'
// Generate or extract the cite key for this record:
// NOTE: currently, the following placeholders are not available for citation output:
// <:keywords:>, <:issn:>, <:area:>, <:notes:>, <:userKeys:>
// if the cite key specification uses one of these placeholders, it will get ignored
$citeKey = generateCiteKey($formVars); // function 'generateCiteKey()' is defined in 'include.inc.php'
if (!empty($citeKey))
// Use the custom cite key that's been build according to the user's individual export options:
$latexData .= "\\bibitem{" . $citeKey . "} ";
else
// The '\bibitem' command requires a cite key, which is why we'll include the record's serial number
// even when the user's export options specify 'export_cite_keys=no' or 'autogenerate_cite_keys=no':
$latexData .= "\\bibitem{" . $row['serial'] . "} ";
}
$latexData .= $recordEncoded . "\n\n"; // create paragraph with encoded record text
}
}
if (!preg_match("/type|year/i", $citeOrder))
$latexData .= "\\end{thebibliography}\n\n";
$latexData .= "\\end{document}\n\n";
return $latexData;
}
// --- END CITATION FORMAT ---
?>
<?php
// Project: Web Reference Database (refbase) <http://www.refbase.net>
// Copyright: Matthias Steffens <mailto:refbase@extracts.de> and the file's
// original author(s).
//
// This code is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY. Please see the GNU General Public
// License for more details.
//
// File: ./cite/formats/cite_latex_bbl.php
// Repository: $HeadURL$
// Author(s): Matthias Steffens <mailto:refbase@extracts.de>
//
// Created: 20-Jul-07, 19:42
// Modified: $Date: 2012-02-27 21:25:30 +0100 (Mon, 27 Feb 2012) $
// $Author$
// $Revision: 1337 $
// This is a citation format file (which must reside within the 'cite/formats/' sub-directory of your refbase root directory). It contains a version of
// the 'citeRecords()' function that outputs a reference list from selected records in LateX .bbl format, to be used with LaTeX/BibTeX. The .bbl file
// generated by refbase can be used as a replacement of the BibTeX-generated .bbl file. Make sure to use "citeOrder=author" when generating the .bbl file.
// NOTE: In its current incarnation, this script outputs a .bbl variant that is intended to be used with the natbib package.
// You may want to adopt the style-specific settings below if necessary. The natbib package is available at:
// <http://www.ctan.org/tex-archive/macros/latex/contrib/natbib/>
// --------------------------------------------------------------------
// --- BEGIN CITATION FORMAT ---
function citeRecords($result, $rowsFound, $query, $queryURL, $showQuery, $showLinks, $rowOffset, $showRows, $previousOffset, $nextOffset, $wrapResults, $citeStyle, $citeOrder, $citeType, $orderBy, $headerMsg, $userID, $viewType)
{
global $contentTypeCharset; // defined in 'ini.inc.php'
global $client;
// The array '$transtab_refbase_latex' contains search & replace patterns for conversion from refbase markup to LaTeX markup & entities.
// Converts refbase fontshape markup (italic, bold) into LaTeX commands of the 'textcomp' package, super- and subscript as well as greek
// symbols get converted into the respective commands in math mode. You may need to adopt the LaTeX markup to suit your individual needs.
global $transtab_refbase_latex; // defined in 'transtab_refbase_latex.inc.php'
// The arrays '$transtab_latin1_latex' and '$transtab_unicode_latex' provide translation tables for best-effort conversion of higher ASCII
// characters from ISO-8859-1 (or Unicode, respectively) to LaTeX entities.
global $transtab_latin1_latex; // defined in 'transtab_latin1_latex.inc.php'
global $transtab_unicode_latex; // defined in 'transtab_unicode_latex.inc.php'
// --- Begin style-specific settings ----------------------------------
// NOTE: the given settings are meant to be used with the natbib package;
// you'll have to adopt these settings if you'd like to generate a
// .bbl file for another style/package
// 1) Define header with .bst style-specific declarations:
// NOTE: since this header is normally inserted by BibTeX from the used .bst style, I'm not sure if there's a variant of this header that's
// universally accepted by natbib. So, if necessary adopt it to your needs.
// -- by default, we use this header (as inserted by a .bst style that was generated from 'merlin.mbs' via the docstrip utility):
$bblHeader = "\\providecommand{\\natexlab}[1]{#1}" . "\n"
. "\\providecommand{\\url}[1]{\\texttt{#1}}" . "\n"
. "\\providecommand{\\urlprefix}{URL }" . "\n"
. "\\providecommand{\\eprint}[2][]{\\url{#2}}" . "\n\n";
// -- here's another header example (as inserted by 'elsart-harv.bst'):
// $bblHeader = "\\expandafter\\ifx\\csname natexlab\\endcsname\\relax\\def\\natexlab#1{#1}\\fi" . "\n"
// . "\\expandafter\\ifx\\csname url\\endcsname\\relax" . "\n"
// . " \\def\\url#1{\\texttt{#1}}\\fi" . "\n"
// . "\\expandafter\\ifx\\csname urlprefix\\endcsname\\relax\\def\\urlprefix{URL }\\fi" . "\n\n";
// 2) Define name of \bibitem command:
$bibItemCommand = "\\bibitem"; // use "\\harvarditem" for the Harvard family of styles
// 3) Define variables and placeholder strings which together will form the \bibitem option string:
// -- variables:
$betweenShortAuthorsDelim = " & "; // used to connect individual author names in the short author list
$betweenFullAuthorsDelim = ", "; // used to connect multiple authors in the full author list
$betweenLastAuthorsDelim = " & "; // used to connect the second-to-last author with the last author in the full author list
$etalIdentifierString = " et~al."; // appended to the first author's last name if the record's number of authors exceeds the number given in '$maxAuthorCountInShortAuthorList'
$maxAuthorCountInShortAuthorList = 2; // maximum number of authors to be used in the short author list
// -- placeholder strings:
// (please see the refbase online documentation for more info about placeholders and their syntax: <http://placeholders.refbase.net/>)
$year = "<:year[4]:>"; // year format, e.g. "1990"
$shortAuthorList = "<:authors[" . $maxAuthorCountInShortAuthorList . "|" . $betweenShortAuthorsDelim . "|" . $etalIdentifierString . "]:>"; // format of the short author list which is used as text citation, e.g. "Jones", "Jones and Baker" or "Jones et al."
$fullAuthorList = "<:authors[0|_#_§_~_|]:>"; // format of the full author list, e.g. "Jones, Baker, and Williams"
// NOTE: in the above placeholder string, we use the string "_#_§_~_" as author delimiter which allows us to uniquely identify that delimiter again below, and replace it with the contents of either '$betweenFullAuthorsDelim' or '$betweenLastAuthorsDelim' (depending on its position)
// 4) Define \bibitem option format:
// -- extended natbib 5.3 style:
$bibItemOptionShort = "[{" . $shortAuthorList . "}(" . $year . ")" . "]"; // e.g.: \bibitem[{Jones et al.}(1990)]{key}...
$bibItemOptionFull = "[{" . $shortAuthorList . "}(" . $year . "){" . $fullAuthorList . "}]"; // e.g.: \bibitem[{Jones et al.}(1990){Jones, Baker, and Williams}]{key}...
// NOTE: since the author lists may contain parentheses, we need to enclose them in curly brackets to work around a natbib limitation
// -- native natbib style:
// $bibItemOptionShort = "[" . $shortAuthorList . "(" . $year . ")" . "]"; // e.g.: \bibitem[Jones et al.(1990)]{key}...
// $bibItemOptionFull = "";
// -- apalike style:
// $bibItemOptionShort = "[" . $shortAuthorList . ", " . $year . "]"; // e.g.: \bibitem[Jones et al., 1990]{key}...
// $bibItemOptionFull = "";
// -- newapa or chicago styles:
// $bibItemOptionShort = "[\\protect\\citeauthoryear{" . $fullAuthorList . "}{" . $shortAuthorList . "}{" . $year . "}" . "]"; // this assumes that it's not allowed to omit the full author list, though I dunno)
// $bibItemOptionFull = "[\\protect\\citeauthoryear{" . $fullAuthorList . "}{" . $shortAuthorList . "}{" . $year . "}" . "]"; // e.g.: \bibitem[\protect\citeauthoryear{Jones, Baker, and Williams}{Jones et al.}{1990}]{key}...
// -- named style:
// $bibItemOptionShort = "[\\protect\\citeauthoryear{" . $shortAuthorList . "}{" . $year . "}" . "]"; // e.g.: \bibitem[\protect\citeauthoryear{Jones et al.}{1990}]{key}...
// $bibItemOptionFull = "";
// -- astron style:
// $bibItemOptionShort = "[\\protect\\astroncite{" . $shortAuthorList . "}{" . $year . "}" . "]"; // e.g.: \bibitem[\protect\astroncite{Jones et al.}{1990}]{key}...
// $bibItemOptionFull = "";
// -- authordate style:
// $bibItemOptionShort = "[\\protect\\citename{" . $shortAuthorList . ", }" . $year . "]"; // e.g.: \bibitem[\protect\citename{Jones et al., }1990]{key}...
// $bibItemOptionFull = "";
// -- harvard style:
// $bibItemOptionShort = "[" . $shortAuthorList . "]{" . $fullAuthorList . "}{" . $year . "}"; // this assumes that it's not allowed to omit the full author list, though I dunno)
// $bibItemOptionFull = "[" . $shortAuthorList . "]{" . $fullAuthorList . "}{" . $year . "}"; // e.g.: \harvarditem[Jones et al.]{Jones, Baker, and Williams}{1990}{key}...
// 5) Define deduplication prefix and suffix strings:
// Identical text citation strings get uniquified by appending letters to the year, e.g. duplicate occurrences
// of "Jones et al. 1990" should become "Jones et al. 1990a" and "Jones et al. 1990b" in the final output.
// These prefix/suffix strings will be inserted before/after the deduplication letter:
$dedupPrefix = "{\\natexlab{"; // these prefix/suffix strings are required by natbib; if any custom command (such as '\natexlab') is used, make sure that the command is also defined above in variable '$bblHeader'
$dedupSuffix = "}}";
// --- End style-specific settings ------------------------------------
// Initialize array variables:
$yearsArray = array();
$typeTitlesArray = array();
$bibItemsArray = array();
// Define inline text markup to be used by the 'citeRecord()' function:
$markupPatternsArray = array("bold-prefix" => "\\textbf{",
"bold-suffix" => "}",
"italic-prefix" => "\\textit{",
"italic-suffix" => "}",
"underline-prefix" => "\\ul{", // the '\ul' command requires '\usepackage{soul}'
"underline-suffix" => "}",
"endash" => "--", // or use '{\\textendash}'
"emdash" => "---", // or use '{\\textemdash}'
"ampersand" => "&", // conversion of ampersands is done below, after the citation has been generated
"double-quote" => '"',
"double-quote-left" => "{\\textquotedblleft}",
"double-quote-right" => "{\\textquotedblright}",
"single-quote" => "'", // same as for ampersands
"single-quote-left" => "{\\textquoteleft}",
"single-quote-right" => "{\\textquoteright}",
"less-than" => "<",
"greater-than" => ">",
"newline" => "\n\n"
);
// Defines search & replace 'actions' that will be applied upon LaTeX output to all those refbase fields that are listed
// in the corresponding 'fields' element:
$latexSearchReplaceActionsArray = array(
array('fields' => array("title", "publication", "abbrev_journal", "address", "keywords", "abstract", "orig_title", "series_title", "abbrev_series_title", "notes"),
'actions' => $transtab_refbase_latex
)
);
// For CLI queries, we'll allow paging thru the result set, i.e. we honour the values of the CLI options '-S|--start' ('$rowOffset')
// and '-R|--rows' ('$showRows') ('$rowOffset' and '$showRows' are re-assigned in function 'seekInMySQLResultsToOffset()' in 'include.inc.php')
if (preg_match("/^cli/i", $client)) // if the query originated from a command line client such as the "refbase" CLI client ("cli-refbase-1.0")
$showMaxRows = $showRows; // show only rows up to the value given in '$showRows'
else
$showMaxRows = $rowsFound; // otherwise show all rows
// Setup the basic .bbl document structure:
$latexData = "\\begin{thebibliography}{" . $showMaxRows . "}\n\n";
// Add header with .bst style-specific declarations:
$latexData .= $bblHeader;
// LOOP OVER EACH RECORD:
// Fetch one page of results (or less if on the last page)
// (i.e., upto the limit specified in $showMaxRows) fetch a row into the $row array and ...
for ($rowCounter=0; (($rowCounter < $showMaxRows) && ($row = @ mysql_fetch_array($result))); $rowCounter++)
{
foreach ($row as $rowFieldName => $rowFieldValue)
// Apply search & replace 'actions' to all fields that are listed in the 'fields' element of the arrays contained in '$latexSearchReplaceActionsArray':
foreach ($latexSearchReplaceActionsArray as $fieldActionsArray)
if (in_array($rowFieldName, $fieldActionsArray['fields']))
$row[$rowFieldName] = searchReplaceText($fieldActionsArray['actions'], $row[$rowFieldName], true); // function 'searchReplaceText()' is defined in 'include.inc.php'
// Order attributes according to the chosen output style & record type:
$record = citeRecord($row, $citeStyle, $citeType, $markupPatternsArray, false); // function 'citeRecord()' is defined in the citation style file given in '$citeStyleFile' (which, in turn, must reside in the 'cite' directory of the refbase root directory), see function 'generateCitations()'
// Print out the current record:
if (!empty($record)) // unless the record buffer is empty...
{
// This is a stupid hack that maps the names of the '$row' array keys to those used
// by the '$formVars' array (which is required by function 'generateCiteKey()')
// (eventually, the '$formVars' array should use the MySQL field names as names for its array keys)
$formVars = buildFormVarsArray($row); // function 'buildFormVarsArray()' is defined in 'include.inc.php'
// Generate or extract the cite key for this record:
// NOTE: currently, the following placeholders are not available for citation output:
// <:keywords:>, <:issn:>, <:area:>, <:notes:>, <:userKeys:>
// if the cite key specification uses one of these placeholders, it will get ignored
$citeKey = generateCiteKey($formVars); // function 'generateCiteKey()' is defined in 'include.inc.php'
// The '\bibitem' command requires a cite key, which is why we'll include the record's serial number
// even when the user's export options specify 'export_cite_keys=no' or 'autogenerate_cite_keys=no':
// NOTE: maybe we should always generate a cite key here, even if 'export_cite_keys=no' or 'autogenerate_cite_keys=no'??
if (empty($citeKey))
$citeKey = $row['serial'];
// Generate the \bibitem option string that's used to build the proper text citation:
$bibItemOptionShortString = parsePlaceholderString($formVars, $bibItemOptionShort, "<:authors[2| and | et~al.]:><(:year:)>"); // function 'parsePlaceholderString()' is defined in 'include.inc.php'
if (!empty($bibItemOptionFull) AND preg_match("/^[^;]+(;[^;]+){" . $maxAuthorCountInShortAuthorList . "}/", $row['author'])) // if the 'author' field does contain more authors as specified in '$maxAuthorCountInShortAuthorList'
{
// include full author list:
$bibItemOptionString = parsePlaceholderString($formVars, $bibItemOptionFull, "<:authors[2| and | et~al.]:><(:year:)><:authors[0|, |]:>");
$bibItemOptionString = preg_replace("/_#_§_~_(?!.*?_#_§_~_)/", $betweenLastAuthorsDelim, $bibItemOptionString); // replace last occurrence of "_#_§_~_"
$bibItemOptionString = preg_replace("/_#_§_~_/", $betweenFullAuthorsDelim, $bibItemOptionString); // replace all other occurrences of "_#_§_~_"
}
else // only include short author list:
$bibItemOptionString = $bibItemOptionShortString;
// In case of duplicate text citation strings, append a letter to the year in the \bibitem option string as well as in the formatted reference:
// NOTE: - this is not fool proof and currently only works if there are no more than 26 duplicate text citations (letters a-z)
// - the below replace actions get triggered on the first four-digit number that happens to be identical to the record's year, but depending on the reference format, this may not be the actual year of the reference but some other number!
for ($i=0; isset($bibItemsArray[$bibItemOptionShortString]); $i++)
{
// Update the existing \bibitem entry (that has an identical text citation string) and append an "a" to it's year items:
if ($i == 0)
{
$dedupPrefixQuoted = preg_quote($dedupPrefix, "/"); // escape meta characters (including '/' that is used as delimiter for the PCRE replace functions below and which gets passed as second argument)
$dedupSuffixQuoted = preg_quote($dedupSuffix, "/");
$oldBibItemOptionShortString = preg_replace("/^\[(.+)\]$/", "\\1", $bibItemOptionShortString); // remove square brackets from short \bibitem option string (which is required for the subsequent 'str_replace()' action to work with short and full option strings)
$newBibItemOptionShortString = preg_replace("/(" . $row['year'] . ")(" . $dedupPrefixQuoted . "[a-z]*" . $dedupSuffixQuoted . ")*/", "\\1" . $dedupPrefix . "a" . $dedupSuffix, $oldBibItemOptionShortString, 1);
$bibItemsArray[$bibItemOptionShortString] = str_replace($oldBibItemOptionShortString, $newBibItemOptionShortString, $bibItemsArray[$bibItemOptionShortString]);
$bibItemsArray[$bibItemOptionShortString] = preg_replace("/(" . $row['year'] . ")(" . $dedupPrefixQuoted . "[a-z]*" . $dedupSuffixQuoted . ")*(?!.*?" . $row['year'] . ")/", "\\1" . $dedupPrefix . "a" . $dedupSuffix, $bibItemsArray[$bibItemOptionShortString], 1); // note that this will fail if the formatted reference contains a number after the year that is identical to the year!
}
// Append a letter to the year items of the current \bibitem entry:
$bibItemOptionShortString = preg_replace("/(" . $row['year'] . ")(" . $dedupPrefixQuoted . "[a-z]*" . $dedupSuffixQuoted . ")*/e", "'\\1$dedupPrefix'.chr(98 + $i).'$dedupSuffix'", $bibItemOptionShortString, 1); // the 'e' modifier allows to execute PHP code within the replacement pattern
$bibItemOptionString = preg_replace("/(" . $row['year'] . ")(" . $dedupPrefixQuoted . "[a-z]*" . $dedupSuffixQuoted . ")*/e", "'\\1$dedupPrefix'.chr(98 + $i).'$dedupSuffix'", $bibItemOptionString, 1);
$record = preg_replace("/(" . $row['year'] . ")(" . $dedupPrefixQuoted . "[a-z]*" . $dedupSuffixQuoted . ")*/e", "'\\1$dedupPrefix'.chr(98 + $i).'$dedupSuffix'", $record, 1);
}
// Attempt to convert higher ASCII chars (i.e., characters with an ASCII value of >= 128) to their corresponding LaTeX entities:
if ($contentTypeCharset == "UTF-8")
$recordEncoded = searchReplaceText($transtab_unicode_latex, $record, false); // function 'searchReplaceText()' is defined in 'include.inc.php'
else
$recordEncoded = searchReplaceText($transtab_latin1_latex, $record, false);
// We have to make sure that the \bibitem option string also contains proper LaTeX entities:
if ($contentTypeCharset == "UTF-8")
$bibItemOptionStringEncoded = searchReplaceText($transtab_unicode_latex, $bibItemOptionString, false);
else
$bibItemOptionStringEncoded = searchReplaceText($transtab_latin1_latex, $bibItemOptionString, false);
// Copy the current \bibitem entry to the array of generated \bibitem entries:
$bibItemsArray[$bibItemOptionShortString] = $bibItemCommand . $bibItemOptionStringEncoded . "{" . $citeKey . "} " . $recordEncoded;
}
}
$latexData .= implode("\n\n", $bibItemsArray) . "\n\n";
$latexData .= "\\end{thebibliography}\n\n";
return $latexData;
}
// --- END CITATION FORMAT ---
?>
<?php
// Project: Web Reference Database (refbase) <http://www.refbase.net>
// Copyright: Matthias Steffens <mailto:refbase@extracts.de> and the file's
// original author(s).
//
// This code is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY. Please see the GNU General Public
// License for more details.
//
// File: ./cite/formats/cite_markdown.php
// Repository: $HeadURL: https://svn.code.sf.net/p/refbase/code/branches/bleeding-edge/cite/formats/cite_markdown.php $
// Author(s): Matthias Steffens <mailto:refbase@extracts.de>
//
// Created: 10-Jun-06, 02:58
// Modified: $Date: 2012-02-27 21:25:30 +0100 (Mon, 27 Feb 2012) $
// $Author: msteffens $
// $Revision: 1337 $
// This is a citation format file (which must reside within the 'cite/formats/' sub-directory of your refbase root directory). It contains a
// version of the 'citeRecords()' function that outputs a reference list from selected records in Markdown format. Markdown is a plain text
// formatting syntax as well as a software tool that converts the plain text formatting back to HTML (<http://daringfireball.net/projects/markdown/>)
// --------------------------------------------------------------------
// --- BEGIN CITATION FORMAT ---
function citeRecords($result, $rowsFound, $query, $queryURL, $showQuery, $showLinks, $rowOffset, $showRows, $previousOffset, $nextOffset, $wrapResults, $citeStyle, $citeOrder, $citeType, $orderBy, $headerMsg, $userID, $viewType)
{
global $contentTypeCharset; // defined in 'ini.inc.php'
global $client;
// The array '$transtab_refbase_markdown' contains search & replace patterns for conversion from refbase markup to Markdown markup & entities
global $transtab_refbase_markdown; // defined in 'transtab_refbase_markdown.inc.php'
$markdownData = ""; // make sure that our buffer variable is empty
// Header:
if (!empty($headerMsg))
{
// Decode any HTML entities:
// (these may occur in the header message e.g. if the user's preferred display language is not English but German or French, etc)
$headerMsg = decodeHTML($contentTypeCharset, $headerMsg); // function 'decodeHTML()' is defined in 'include.inc.php', and '$contentTypeCharset' is defined in 'ini.inc.php'
// Convert refbase markup in the header message into appropriate Markdown markup & entities:
$headerMsg = searchReplaceText($transtab_refbase_markdown, $headerMsg, true); // function 'searchReplaceText()' is defined in 'include.inc.php'
$markdownData .= "# $headerMsg #\n\n";
}
// Initialize array variables:
$yearsArray = array();
$typeTitlesArray = array();
// Define inline text markup to be used by the 'citeRecord()' function:
$markupPatternsArray = array("bold-prefix" => "**",
"bold-suffix" => "**",
"italic-prefix" => "_",
"italic-suffix" => "_",
"underline-prefix" => "<u>",
"underline-suffix" => "</u>",
"endash" => "&ndash;",
"emdash" => "&mdash;",
"ampersand" => "&",
"double-quote" => '"',
"double-quote-left" => "&ldquo;",
"double-quote-right" => "&rdquo;",
"single-quote" => "'",
"single-quote-left" => "&lsquo;",
"single-quote-right" => "&rsquo;",
"less-than" => "<",
"greater-than" => ">",
"newline" => " \n"
);
// Defines search & replace 'actions' that will be applied upon Markdown output to all those refbase fields that are listed
// in the corresponding 'fields' element:
$markdownSearchReplaceActionsArray = array(
array('fields' => array("title", "publication", "abbrev_journal", "address", "keywords", "abstract", "orig_title", "series_title", "abbrev_series_title", "notes"),
'actions' => $transtab_refbase_markdown
)
);
// For CLI queries, we'll allow paging thru the result set, i.e. we honour the values of the CLI options '-S|--start' ('$rowOffset')
// and '-R|--rows' ('$showRows') ('$rowOffset' and '$showRows' are re-assigned in function 'seekInMySQLResultsToOffset()' in 'include.inc.php')
if (preg_match("/^cli/i", $client)) // if the query originated from a command line client such as the "refbase" CLI client ("cli-refbase-1.0")
$showMaxRows = $showRows; // show only rows up to the value given in '$showRows'
else
$showMaxRows = $rowsFound; // otherwise show all rows
// LOOP OVER EACH RECORD:
// Fetch one page of results (or less if on the last page)
// (i.e., upto the limit specified in $showMaxRows) fetch a row into the $row array and ...
for ($rowCounter=0; (($rowCounter < $showMaxRows) && ($row = @ mysql_fetch_array($result))); $rowCounter++)
{
foreach ($row as $rowFieldName => $rowFieldValue)
// Apply search & replace 'actions' to all fields that are listed in the 'fields' element of the arrays contained in '$markdownSearchReplaceActionsArray':
foreach ($markdownSearchReplaceActionsArray as $fieldActionsArray)
if (in_array($rowFieldName, $fieldActionsArray['fields']))
$row[$rowFieldName] = searchReplaceText($fieldActionsArray['actions'], $row[$rowFieldName], true); // function 'searchReplaceText()' is defined in 'include.inc.php'
// Order attributes according to the chosen output style & record type:
$record = citeRecord($row, $citeStyle, $citeType, $markupPatternsArray, false); // function 'citeRecord()' is defined in the citation style file given in '$citeStyleFile' (which, in turn, must reside in the 'cite' directory of the refbase root directory), see function 'generateCitations()'
// Print out the current record:
if (!empty($record)) // unless the record buffer is empty...
{
// Print any section heading(s):
if (preg_match("/year|type/i", $citeOrder))
{
$headingPrefix = "";
$headingSuffix = "";
if (!empty($headerMsg)) // if there's a custom header message available, we decrease the heading level of sections & subsections by one (since the header message has level 1)
{
$sectionMarkupPrefix = "## ";
$sectionMarkupSuffix = " ##\n\n";
$subSectionMarkupPrefix = "### ";
$subSectionMarkupSuffix = " ###\n\n";
}
else // no custom header message given
{
$sectionMarkupPrefix = "# ";
$sectionMarkupSuffix = " #\n\n";
$subSectionMarkupPrefix = "## ";
$subSectionMarkupSuffix = " ##\n\n";
}
list($yearsArray, $typeTitlesArray, $sectionHeading) = generateSectionHeading($yearsArray, $typeTitlesArray, $row, $citeOrder, $headingPrefix, $headingSuffix, $sectionMarkupPrefix, $sectionMarkupSuffix, $subSectionMarkupPrefix, $subSectionMarkupSuffix); // function 'generateSectionHeading()' is defined in 'cite.inc.php'
$markdownData .= $sectionHeading;
}
// Write plain TEXT paragraph:
$markdownData .= $record . "\n\n"; // create paragraph with encoded record text
}
}
return $markdownData;
}
// --- END CITATION FORMAT ---
?>
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment