From: Christian Scholz <christian@cs...> - 2006-01-12 14:31:22
some questions from a n00b:
-> how can I make my own citation-styles (with name) and add them to the
-> what is the easiest way to group books for special subjects? I'm
thinking of a drop down list with some subjects, from which the user can
choose one to see all refs of that subject. Keywords are not really what
I need for that. I made an additional field to the refs-table - but how
do I make an additional Textfield in the Insert-Mask and how do I add a
drop-down menu (like the groups menu) to the main menu?
I'm not new to PHP and MySQL, but I'm just confused where to find what I
need in the sources.. I hope someone can help me.
to answer your first question:
> -> how can I make my own citation-styles (with name) and add them to the
Currently, citation styles are written as a PHP function. The function
is called 'citeRecord()'. For each style, there's a separate file with
a dedictated version of this function. These citation style files are
located within the 'cite/' sub-directory of your refbase root directory.
To build your own style, you may want to have a look at the existing
citation style files and modify one of them to suit your needs. Note
that the refbase version in the CVS repository allows for some citation
styling that wasn't possible in v0.8.0. So if you're starting with a
fresh installation of refbase, you may want to start with the CVS
[ Speaking of the (distant) future, we have plans to enhance the ]
[ citation support so that citation styles can be defined more easily. ]
[ One option would be to integrate with the XBib project: ]
[ <http://xbiblio.sourceforge.net/> ]
Copy your newly created citation style into the 'cite/' sub-directory
of your refbase root directory. Then, in order to add your citation
style file to the "Cite using style" drop-down, execute the following
MySQL command from within your SQL command line interpreter:
INSERT INTO styles VALUES (NULL, 'STYLENAME', 'true', 'STYLEFILE', '1', '1'=
In the above MySQL command, replace STYLENAME with the actual name of
your citation style. This name will appear in the drop-down. STYLEFILE
must be replaced with the file name of your citation style file. You
can change the first number ('1') in the above command to change the
position at which your style name will be displayed in the drop-down.
To see all available styles, execute this command:
SELECT * FROM styles;
Now, login as admin via the refbase web interface, choose "Manage
Users" and activate your new style for all those users who shall see
this style. Batch activation could be also done via the MySQL command
line but if you've got only a few users, it's easier done via the web
GUI. If you've enabled/disabled any citation styles for the admin user,
you'll have to logout and login again in order to see your changes.
Btw, you can globally disable existing styles by setting the
'style_enabled' field to "false". E.g., if you want to disable the
"Polar Biol" citation style, execute:
UPDATE styles SET style_enabled =3D "false" WHERE style_name =3D "Polar Bio=
Hope that helps, Matthias
> -> what is the easiest way to group books for special subjects? I'm
> thinking of a drop down list with some subjects, from which the user
> can choose one to see all refs of that subject.
This sounds as if *public* keywords or groups (think "tags") would be a
solution to your problem. This has been discussed recently on the
developer list, but unfortunately, where not there yet.
> Keywords are not really what I need for that.
Yes, I understand. However, I think that, currently, the best
workaround would be to use one of the existing fields for your
purposes. Why not use special keywords for your purposes, then setup a
drop-down on the main page which queries these keywords? You could even
use just plain URLs that'll display your subject sets. Using the CVS
version, you could use an URL like this:
where '...' would be your subject name.
> I made an additional field to the refs-table
We have plans to support custom fields in the future. But, using the
current refbase version, it may be difficult to smoothly integrate a
> but how do I make an additional Textfield in the Insert-Mask and how
> do I add a drop-down menu (like the groups menu) to the main menu?
You would have to hack the scripts 'record.php' and 'index.php'. If you
want a dynamic subject menu, then you may have to write functions to
extract and process your custom field. Have a look at the 'groupSearch'
form on the main page ('index.php') to see how its done there (user
groups are stored as session variables upon login). The whole thing may
not be an easy task, sorry.