Gossamer Forum
Home : Products : DBMan : Installation :

I need help with a difficult problem.

Quote Reply
I need help with a difficult problem.
I have the dbman cgi script and I want to use it for a song lyric site, I need to edit the script a lot to get what I want.
What I need is the following:
On my search section of my new site I want a form with 2 fields
1- Artist Name:
2- Song Title:
You can use either field #1 or #2 to search the database with lyrics.
So for example: a person types in field #1 (Artist Name) -> Madonna and then press SEARCH.
The result should contain just the artist-song and url in the artist-song
result:
Madonna-Beautiful Stranger
Madonna-La Isla Bonita

the link has to be already in the result part, not in a seperated row of a table

I have renamed my files to .txt so you can view them.

default.cfg - http://home-1.worldonline.nl/...manfiles/default.txt
html.pl - http://home-1.worldonline.nl/.../dbmanfiles/html.txt
db.cgi - http://home-1.worldonline.nl/...83/dbmanfiles/db.txt

Could you please edit them the right way if you have time or tell me how to do it, thanks in advance.

David
Quote Reply
Re: I need help with a difficult problem. In reply to
1) For the search form, copy the sub html_record and create a new sub-routine called sub html_search_form. Use the following codes:

Code:
sub html_search_form {
# --------------------------------------------------------
# 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>Artist:</FONT></TD>
<TD> <$font>$rec{'Artist'}</Font></TD></TR>
<TR><TD ALIGN="Right" VALIGN="TOP"><$font_color>Title: </FONT></TD>
<TD> <$font>$rec{'Title'}</Font></TD></TR>
</TABLE>
|;
}

1a) Then in your sub html_view_search, replace the following codes:

Code:
|; &html_record_form(); print qq|

WITH the following codes:

Code:
|; &html_search_form(); print qq|

1c) Follow steps in 1b) with editing the sub html_view_failure routine.

2) For the search results, use the following codes in your sub html_record routine:

Code:
<TABLE WIDTH="475" CELLPADDING=0 CELLSPACING=0 BORDER=1 BGCOLOR="#FFFFCC">
<TR><TR><TD><$font_color>Artist:</FONT></TD> <TD> <$font>$rec{'Artist'} - $rec{'Title'}</Font></TD></TR>
</TABLE>

You can add the $rec{'URL'} around one the fields above, in the following manner:

Code:
<a href="$rec{'URL'}">$rec{'Artist'}</a>

BTW: Since you have DBMAN successfully installed, you should use the Discussion Forum to discuss modification and customization issues. This forum is primarily for overcoming the initial hurdles and obstacles of installing DBMAN for the first time.

Also, a great site to use in customizing your DBMAN project is:

www.jpdeni.com/dbman/

Hope this helps.

Regards,

------------------
Eliot Lee
Anthro TECH,L.L.C
www.anthrotech.com
----------------------