Gossamer Forum
Home : Products : DBMan : Installation :

Use for Dbman Glossary?

Quote Reply
Use for Dbman Glossary?
Is Dbman a good way to run a glossary of terms? Is there an easy way to set it up just to be a searchable glossary or would another program suit better?

Thanks you guys are alot of help!
Quote Reply
Re: Use for Dbman Glossary? In reply to
Seems to me that DBMan would be a great way to set up a glossary of terms.


------------------
JPD
Quote Reply
Re: Use for Dbman Glossary? In reply to
DBMan would be very nice for a glossary of term. And the information to build the look and feel would be min.. when you 'viewed' you could type in the term you wish and have it search all of the database. only two fields would be need (as to how I think it might be set up)

field1=word(term)
field2=defination of the word or term

if it was set up to bold the returns you could also have other terms in field 2 such as also see:whateverasimiliartermwouldbe

that would allow them to see other terms. Very good idea and one that I might borrow for a dictionary I am setting up for a client for a Role Playing Game he is building.

------------------
Thanks in Advance

Daniel J.
http://www.blackrose.net
webmaster@blackrose.net
Quote Reply
Re: Use for Dbman Glossary? In reply to
You could also have a team of users (or in this case 'editors') who could contribute to the glossary. By setting $auth_modify_own on, they would only be able to edit their own entries too.

Or is that just getting silly? Smile

Cheers,

Alex
Quote Reply
Re: Use for Dbman Glossary? In reply to
I have edited all of the fields out in the default.cfg file in 1 place and just made them into fields
Word
&
Definition
I changed one section it html.pl too

When I add a record it shows this
word
definition
your record was added.
But it's blank and then I can't search and find it. Did I leave something out?
Heres my default.cfg that I changed:

# --------------------------------------------------------
# Definition of your database. Format is
# field_name => ['position', 'field_type', 'form-length', 'maxlength', 'not_null', 'default', 'valid_expr']
%db_def = (
'word' => [0, 'alpha', 20, 50, 0, '', '' ],
'defintion' => [1, 'alpha', '40x3', 500, 0, '', '' ]
);

# The column name for the database key. Can be any column, but it must be unique!
# You can't have two records with the same key value!

and my html.pl

# not be as nice). See the README for more info.

my (%rec) = @_;
($db_auto_generate and print &build_html_record_form(%rec) and return);

my $font = 'Font face="Verdana, Arial, Helvetica" Size=2 Color=#003399';

print qq|
<TABLE WIDTH="450" CELLPADDING=0 CELLSPACING=0 BORDER=1 BGCOLOR="#FFFFCC">
<TR><TD ALIGN="Right" VALIGN="TOP"><$font>Word:</FONT></TD>
<TD VALIGN="TOP"> <INPUT TYPE="TEXT" NAME="Word" VALUE="$rec{'Word'}" SIZE="40" MAXLENGTH="255"></TD></TR>
<TR><TD ALIGN="Right" VALIGN="TOP"><$font>Definition:</FONT></TD>
<TD VALIGN="TOP"> <TEXTAREA NAME="Definition" ROWS="4" COLS="40" WRAP="VIRTUAL" MAXLENGTH="255">$rec{'Definition'}</TEXTAREA></TD></TR>
</TABLE>
|;
}

sub html_record {
# --------------------------------------------------------
# How a record will be displayed. This is used primarily in
# returning search results and how it is formatted. The record to
# be displayed will be in the %rec hash.

my (%rec) = @_; # Load any defaults to put in the VALUE field.
($db_auto_generate and print &build_html_record(%rec) and return);

my $font_color = 'Font face="Verdana, Arial, Helvetica" Size=2 Color=#003399';
my $font = 'Font face="Verdana, Arial, Helvetica" Size=2';

print qq|
<TABLE WIDTH="475" CELLPADDING=0 CELLSPACING=0 BORDER=1 BGCOLOR="#FFFFCC">
<TR><TD ALIGN="Right" VALIGN="TOP"><$font_color>Word:</FONT></TD>
<TD> <$font>$rec{'Word'}</Font></TD></TR>

<TR><TD ALIGN="Right" VALIGN="TOP"><$font_color>Definition:</FONT></TD>
<TD> <$font>$rec{'Definition'}</Font></TD></TR>

</TABLE>
|;
}

##########################################################
## Home Page ##
##########################################################


Quote Reply
Re: Use for Dbman Glossary? In reply to
Hi mike,

It is probably this

%db_def = (
'word' => [0, 'alpha', 20, 50, 0, '', '' ],
'defintion' => [1, 'alpha', '40x3', 500, 0, '', '' ]
);

defintion or definition???

-JO
Quote Reply
Re: Use for Dbman Glossary? In reply to
Actually, now that I look at it again, it should be Definition in your .cfg since you are using $rec{'Definition'} later on.

Cheers
-JO
Quote Reply
Re: Use for Dbman Glossary? In reply to
I think I should take a break now... Smile

You will have the same problems with word in .cfg and $rec{'Word'}

Dbman is case sensitive...

I think I am through for now Wink
Quote Reply
Re: Use for Dbman Glossary? In reply to
Also sounds like you may not have set:

$db_key = 'Word';

and Jamie is right about being case sensitive. Make sure you use the same case throughout (either always 'Word' or 'word').

Cheers,

Alex
Quote Reply
Re: Use for Dbman Glossary? In reply to
Ok I changed all of that and its working. Now
how do I change it so that the Word field isn't adding a number to it every time? I dont want numbers because the whole thing will be more alphabetical. Or should I have record numbers? Plus how do I make it when you search for a term that when another technical term comes up in the definition that it is linked in some way to be clicked and taken to the defintion of that word?
Thanks!
Quote Reply
Re: Use for Dbman Glossary? In reply to
Also, Can I use SSI calls in the output record code? IF so how?
Quote Reply
Re: Use for Dbman Glossary? In reply to
 
Code:
Mary Shelley wrote <a href="http://www.server.com/cgi-bin/dbman/
db.cgi&db=default&uid=default&Word=Frankenstein
&view_records=1">Frankenstein</a> while on a
trip to Geneva.

Of course, if your glossary database is different, you would change the db= to the name of your database.

Be aware of the problems with spaces in URLs. If you have a phrase in your glossary, you'll have to replace the spaces with + signs:

Code:
...Word=Percy+Shelley
&view_records=1">Percy Shelley</a>





------------------
JPD
Quote Reply
Re: Use for Dbman Glossary? In reply to
could the linking be done like this

<a href="http://site.com/cgi-bin/db.cgi?whatever"> or similar to access the word contained in a definition? I dont care about permissions except I want to be the only one that modifies, adds ,deletes, etc... Also how do I make it so when some one follows the url to the database that they don't get prompted at all for a password. They dont have to type guest,guest or anything they're just ready to go.
Quote Reply
Re: Use for Dbman Glossary? In reply to
In your .cfg file, set

$auth_no_authentication = 0;
$auth_allow_default = 1;
@auth_default_permissions = (1,0,0,0,0)
$auth_signup = 0;
$auth_view_own = 0;
$auth_modify_own = 0;
$auth_user_field = -1;

Quote:
<a href="http://site.com/cgi-bin/db.cgi?whatever">

If your database is at site.com/cgi-bin/db.cgi, that would be the right thing to include in the link.

The "whatever" is the important stuff. You need to include:
db=default (or whatever the name of the database is)
uid=default (must be this)
Word=[the word you want to be looked up]
view_records=1 (can be anything, except 0)

with &s between the elements.



------------------
JPD
Quote Reply
Re: Use for Dbman Glossary? In reply to
Thanks

Why does it still ask for login when I go to
it?
http://bandradio.com/cgi-bin/db/db.cgi Is that the wrong way to have it called by users?

Also, Can I use SSI calls in the output record code? IF so how?
Quote Reply
Re: Use for Dbman Glossary? In reply to
 
Quote:
Why does it still ask for login when I go to it? http://bandradio.com/cgi-bin/db/db.cgi

Because that is the URL for the login page.

Quote:
Is that the wrong way to have it called by users?

Yes. If you want users to view records without having to login, use
http://bandradio.com/cgi-bin/db/db.cgi?db=default&uid=default

Can't help you with SSIs.

You might try doing a search here on the forum. I know there's been a lot of discussion about them from time to time. Also in the Perl-CGI forum.



------------------
JPD