Gossamer Forum
Home : Products : DBMan : Customization :

Help with Short/Long Mod??

Quote Reply
Help with Short/Long Mod??
Hey all...I hope someone can help.

I have the short long mod installed and working fine. I am interested

in having my short record display the field it normally does for me, but

I would like the short record results to link to another short record for another field.

Here is what I mean... I click on "T" which displays all artists beginnning with 'T' from the field 'artist'.

Now, I would like to click on one of these displayed artists, and be given another list of links derived from another field called 'song_title'.

From there I could click on the song title and be given the lyrics to that song from the field called 'lyrics'. I Hope this makes sense....Crazy

My head hurts from searchin' this forum...

Thanks in advance.....

-Sean
Quote Reply
Re: [BigBullyGuy] Help with Short/Long Mod?? In reply to
Have you tried search the DBMan FAQ? It could save hours of time rather than searching through the forum.

If you look under the section "Viewing" you will find a thread called "Grouped short short long display - (sub list_makes,sub list_models)"

This should provide the solution you are looking for. There may also be other threads relating to this under that section also.

Hope this helps

Unoffical DBMan FAQ
http://redundantcartridge.com/dbman/
Quote Reply
Re: [LoisC] Help with Short/Long Mod?? In reply to
Thanks again for your quick reply Lois. I found it where you said I would. I can't seem to get it to work though.

I don't receive any errors, only the search success page with no listings at all. I replaced the three fields and position numbers with mine, but

to no avail. I read it over and over looking for mistakes. Any help in finding my error would be greatly appreciated.

Sorry for the long message.



--Many thanx......Sean



Here is what I have now for those scripts:

sub html_view_success {
# --------------------------------------------------------
# This page displays the results of a successful search.
# You can use the following variables when displaying your
# results:
#
# $numhits - the number of hits in this batch of results.
# $maxhits - the max number of hits displayed.
# $db_total_hits - the total number of hits.
# $db_next_hits - html for displaying the next set of results.
#

my (@hits) = @_;
my ($numhits) = ($#hits+1) / ($#db_cols+1);
my ($maxhits); $in{'mh'} ? ($maxhits = $in{'mh'}) : ($maxhits = $db_max_hits);
$in{'nh'} ? ($nh = $in{'nh'}) : ($nh = 1);

$page_title = "Search Results";
&html_page_top;

if ($in{'Song_Title'} or $in{$db_key}) {

# Go through each hit and convert the array to hash and send to
# html_record for printing.
if (($db_total_hits == 1) || ($maxhits == 1)) {
&html_record_long(&array_to_hash(0, @hits));
}

else {
print qq|<p><$font>Your search returned <b>$db_total_hits</b> matches.</font>|;
if ($db_next_hits) { print "<br><$font>Pages: $db_next_hits</font>"; }
$i = 1;
print "<table>";
for (0 .. $numhits - 1) {
print "<tr>";
&html_record (&array_to_hash($_, @hits));
print "</tr>";
++$i;
}
print "</table>";
if ($db_next_hits) { print "<br><$font>Pages: $db_next_hits</font>";}
}
}
elsif ($in{'Album'}) {
&list_Song_Titles;
}
elsif ($in{'Artist'}) {
&list_Albums;
}
&html_footer;
&html_page_bottom;
}

sub list_Song_Titles {
# --------------------------------------------------------
open (DB, "<$db_file_name") or
&cgierr("error. unable to open db file: $db_file_name.\nReason: $!");
if ($db_use_flock) { flock(DB, 1); }
@lines = <DB>;
close DB;

$Song_Title_fieldnum = 4; # Change this to match the field number of your Song_Title field
$Album_fieldnum = 5; # Change this to match the field number of your Album field

foreach $line (@lines) {
chomp($line);
@data = &split_decode($line);
if ($data[$Album_fieldnum] eq $in{'Album'}) {
if (!(grep $_ eq $data[$Song_Title_fieldnum], @Song_Title_list)) {
push (@Song_Title_list, $data[$Song_Title_fieldnum]);
}
}
}
foreach $Song_Title (@Song_Title_list) {
$Song_Title_link = &urlencode($Song_Title);
$Album_link = &urlencode($in{'Album'});
print qq|<a href="$db_script_link_url&Album=$Album_link&Song_Title=$Song_Title_link&view_records=1">$Song_Title</a><BR>|;
}

}

sub list_Albums {
# --------------------------------------------------------
open (DB, "<$db_file_name") or
&cgierr("error. unable to open db file: $db_file_name.\nReason: $!");
if ($db_use_flock) { flock(DB, 1); }
@lines = <DB>;
close DB;

$Album_fieldnum = 4; # Change this to match the field number of your Song_Title field
$Artist_fieldnum = 5; # Change this to match the field number of your Album field

foreach $line (@lines) {
chomp($line);
@data = &split_decode($line);
if ($data[$Artist_fieldnum] eq $in{'Artist'}) {
if (!(grep $_ eq $data[$Album_fieldnum], @Album_list)) {
push (@Album_list, $data[$Album_fieldnum]);
}
}
}
foreach $Album (@Album_list) {
$Album_link = &urlencode($Album);
$Artist_link = &urlencode($in{'Artist'});
print qq|<a href="$db_script_link_url&Album=$Album_link&Artist=$Artist_link&view_records=1">$Song_Title</a><BR>|;
}

}

Here is a portion of my config file:

%db_def = (
ID => [0, 'numer', 5, 8, 1, '', ''],
Artist => [3, 'alpha', 50, 255, 1, '', ''],
Song_Title => [4, 'alpha', 50, 255, 1, '', ''],
Album => [5, 'alpha', 50, 255, 0, '', ''],
Date => [1, 'date', 12, 15, 1, &get_date, ''],
Genre => [2, 'alpha', 0, 255, 1, '', ''],
Lyrics => [6, 'alpha', '40x5', 32000, 0, '', ''],
Submitted_By => [7, 'alpha', -2, 50, 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!
$db_key = 'ID';
# Track the key? Should DBMan keep a counter of the next key to use? This isn't
# neccessary if you can guarantee that your entry in the key field will be unique
# (i.e. a userid).
$db_key_track = 1;
# Database delimeter.
$db_delim = '|';
# Use file locking (1 = Yes, 0 = No). Should be used, but won't work on Win95.
$db_use_flock = 0;
# Auto generate the html forms (1 = Yes, 0 = No).
$db_auto_generate = 0;
# Display Benchmarking Information (1 = Yes, 0 = No).
$db_benchmark = 0;
# Display Debugging Information (1 = Yes, 0 = No).
$db_debug = 0;

# Select fields. Field name => 'comma seperated list of drop down options'.
%db_select_fields = (
Genre => 'African,Alternative,Blues,Caribbean,Childrens,Classical,Country,Electronic,Folk and Traditional,Hard Rock,Classic Rock,Soft Rock,Heavy Metal,Industrial,Jazz,Latin,R&B and Soul,Rap,Hip-Hop,Reggae,Religious,',
# Type => 'Web,Newsgroup,Mailing List,FTP,Gopher'
);

# Radio fields. Field name => comma seperated list of radio buttons.
# %db_radio_fields = ( Validated => 'Yes,No' );

# Checkbox fields. Field name => Checkbox value.
# %db_checkbox_fields = ( Popular => 'Yes' );

# Default maximum number of hits returned in a search.
$db_max_hits = 110;
# Bold search results (1 = Yes, 0 = No).
$db_bold = 0;
# Regular and title fonts used in auto_generatrion and html.pl.
$font = 'font face="verdana,arial,helvetica" size="2"';
$font_title = 'font face="verdana,arial,helvetica" size="4"';
Quote:
Quote:
Quote Reply
Re: [BigBullyGuy] Help with Short/Long Mod?? In reply to
I'm glad you posted the poriton of your .cfg file. First of all you need to number your fields consecutively so that the database functions correctly.

ID => [ 0, 'numer', 5, 8, 1, '', ''],
Artist => [ 1, 'alpha', 50, 255, 1, '', ''],
Song_Title => [ 2, 'alpha', 50, 255, 1, '', ''],
Album => [ 3, 'alpha', 50, 255, 0, '', ''],
Date => [ 4, 'date', 12, 15, 1, &get_date, ''],
Genre => [ 5, 'alpha', 0, 255, 1, '', ''],
Lyrics => [ 6, 'alpha', '40x5', 32000, 0, '', ''],
Submitted_By => [ 7, 'alpha', -2, 50, 0, '', '']

Since you only have one select field change the end of it from:

Religious,',

to:

Religious'

See if those changes make a difference. It's always best to have your database up and tested before trying to add other mods to it. And to keep a backup copy as you add new mods just in case. That way you can track down problems along the way :)

Unoffical DBMan FAQ
http://redundantcartridge.com/dbman/
Quote Reply
Re: [LoisC] Help with Short/Long Mod?? In reply to
Thank you for all your replies Lois. I can't tell you how much I appreciate your help.

I tried your suggestions, but I still get no results in my short record. I have been backing up good and working

copies of my dbman folder. My short record mod worked prior to installing this latest mod. Any other ideas

you may have will gladly be accepted..... Wink



Thanx again,

Sean
Quote Reply
Re: [BigBullyGuy] Help with Short/Long Mod?? In reply to
I can't help wondering if you are using the user friendly mod or not? If so then the subs:
&html_page_top;
&html_footer;
&html_page_bottom;

should not be keeping your pages from displaying. if you are not using the user friendly mod you would need to use the same codes you have in your others subs so the page tops and bottoms would be inserted.

When you view the source of the page for your short display does it show any clues as to errors, etc.

Can you provide the url to where you have this setup so it can be viewed?

I'm also wondering if you wouldn't need it all the first search under Genre.. then Artist and then Album. And whether all the fields you are wanted displayed should be required fields.

Unoffical DBMan FAQ
http://redundantcartridge.com/dbman/
Quote Reply
Re: [LoisC] Help with Short/Long Mod?? In reply to
Hi again Lois....

Ok I made it so you can see my dbman before and after I added the mod. Links are at the bottom.

There is not much there in the way of a database yet as I am obviously still in testing.

I am using the user friendly mod. I was not at first, but I thought it might help to get another mod

working if I used it.



I guess I would like to add the Genre field as well. But I would like it to be a separate search from Artist.

I mean that, I would like one to initiate a Genre search, and another for Artist search. Essentially the same,

except that the Artist search would not include Genre, (database entries would of course show genre though..)

but the Genre would include Artist and others under it.



Ok here is the link for my dbman before adding this last mod:

http://www.seesongs.com/cgi-bin/dbman1/db.cgi

Use 'T' for testing database.....

And here is the link after the mod was added:

http://www.seesongs.com/cgi-bin/dbman/db.cgi



Thanks for taking the time....hope somehow I can return the favor one day. Smile

--Sean

Last edited by:

BigBullyGuy: Sep 20, 2002, 7:28 PM
Quote Reply
Re: [BigBullyGuy] Help with Short/Long Mod?? In reply to
Looking at both files I noticed:

On your search results or for the display of your html_record_long are you setting up your display using a copy of your html_record_form?

It look like it's not displaying the actual field results but instead showing the fields as if it was the input form for example:

<TR><TD ALIGN="Right" VALIGN="TOP" WIDTH="150"><font face="verdana,arial,helvetica" size="2">ID:</FONT></TD>
<TD VALIGN="TOP" WIDTH="475">&nbsp;<INPUT TYPE="TEXT" NAME="ID" VALUE="78" SIZE="3" MAXLENGTH="3"></TD></TR>

Rather than having something like:

<TR><TD><$font>ID:</FONT></TD><TD>&nbsp;$rec{'ID'}</TD></TR>

I think you need to fix these problems before you can get other mods working. If you want I would be willing to help you but you would need to make txt copies of your files available. This would include again your .cfg, html.pl, default.db.

If you prefer you can send the url list via private message.

Unoffical DBMan FAQ
http://redundantcartridge.com/dbman/
Quote Reply
Re: [LoisC] Help with Short/Long Mod?? In reply to
Hi Lois...

I messaged you with the links...and I made the changes the way you said. I didn't

realize it was displaying the records that way. I must have just copied and pasted the input html.

Unfortunately, it still doesn't link the 2nd short record as the 'Albums'. Also, I noticed that the first short

record shows the same 'Artist' more than once. I would rather it didn't. Maybe there is a

quick fix for that? Thanx again in advance........



--Sean
Quote Reply
Re: [BigBullyGuy] Help with Short/Long Mod?? In reply to
I made some minor adjustments for your subs:

html_record_form

<TABLE WIDTH="450" CELLPADDING=0 CELLSPACING=0 BORDER=1 BGCOLOR="#FFFFCC">
<TR><TD ALIGN="Right" VALIGN="TOP" WIDTH="150"><$font>ID:</FONT></TD>
<TD VALIGN="TOP" WIDTH="475">&nbsp;<INPUT TYPE="TEXT" NAME="ID" VALUE="$rec{'ID'}" SIZE="5" MAXLENGTH="8"></TD></TR>
<TR><TD ALIGN="Right" VALIGN="TOP"><$font>Date:</FONT></TD>
<TD VALIGN="TOP">&nbsp;<INPUT TYPE="TEXT" NAME="Date" VALUE="$rec{'Date'}" SIZE="12" MAXLENGTH="12"></TD></TR>
<TR><TD ALIGN="Right" VALIGN="TOP"><$font>Genre:</FONT></TD>
<TD VALIGN="TOP">&nbsp;|; print &build_select_field("Genre",$rec{'Genre'}); print qq|</TD></TR>
<TR><TD ALIGN="Right" VALIGN="TOP"><$font>Artist:</FONT></TD>
<TD VALIGN="TOP">&nbsp;<INPUT TYPE="TEXT" NAME="Artist" VALUE="$rec{'Artist'}" SIZE="50" MAXLENGTH="255"></TD></TR>
<TR><TD ALIGN="Right" VALIGN="TOP"><$font>Song Title:</FONT></TD>
<TD VALIGN="TOP">&nbsp;<INPUT TYPE="TEXT" NAME="Song_Title" VALUE="$rec{'Song_Title'}" SIZE="50" MAXLENGTH="255"></TD></TR>
<TR><TD ALIGN="Right" VALIGN="TOP"><$font>Album:</FONT></TD>
<TD VALIGN="TOP">&nbsp;<INPUT TYPE="TEXT" NAME="Album" VALUE="$rec{'Album'}" SIZE="50" MAXLENGTH="255"></TD></TR>
<TR><TD ALIGN="Right" VALIGN="TOP"><$font>Lyrics:</FONT></TD>
<TD VALIGN="TOP">&nbsp;<TEXTAREA NAME="Lyrics" ROWS="5" COLS="40" WRAP="VIRTUAL" MAXLENGTH="32000">$rec{'Lyrics'}</TEXTAREA></TD></TR>
</TABLE>

html_record_long

# add the following to display the line breaks in Lyrics textarea after my (%rec) = @_;

$rec{'Lyrics'} =~ s/\n/<BR>/g;

<TABLE WIDTH="750" CELLPADDING=0 CELLSPACING=0 BORDER=1 BGCOLOR="#FFFFCC">
<TR><TD ALIGN="Center"><$font>ID:</FONT></TD><TD>&nbsp;$rec{'ID'}</TD></TR>
<TR><TD ALIGN="Center"><$font>Genre:</FONT></TD><TD>&nbsp;$rec{'Genre'}</TD></TR>
<TR><TD ALIGN="Center"><$font>Artist:</FONT></TD><TD>&nbsp;$rec{'Artist'}</TD></TR>
<TR><TD ALIGN="Center"><$font>Album:</FONT></TD><TD>&nbsp;$rec{'Album'}</TD></TR>
<TR><TD ALIGN="Center"><$font>Song Title:</FONT></TD><TD>&nbsp;$rec{'Song_Title'}</TD></TR>
<TR><TD ALIGN="Center"><$font>Lyrics:</FONT></TD><TD>&nbsp;$rec{'Lyrics'}</TD></TR>
<TR><TD ALIGN="Center"><$font>Date:</FONT></TD><TD>&nbsp;$rec{'Date'}</TD></TR>
</TABLE>

=========

On your home page you can create a list of Alpa links using the following code:

<$font><B>Browse by Artist:</B></font><P>|;

$fieldnum = 3; ## the number of the field you want to search by
$fieldname = Artist; ## actual alpha string of the corresponding field above

open (DB, "<$db_file_name") or &cgierr("unable to open $db_file_name. Reason: $!");
if ($db_use_flock) {
flock(DB, 1);
}
LINE: while (<DB> ) {
next if /^#/;
next if /^\s*$/;
$line = $_;
chomp ($line);
@fields = &split_decode ($line);
$letter = substr($fields[$fieldnum],0,1);
if (!(grep $_ eq $letter, @alphabet)) {
push (@alphabet, $letter);
}
}
close DB;

$i = 65; while ( $i < 91 ) {
if (grep $_ eq chr($i), @alphabet) {
print qq|<$font><A HREF="$db_script_link_url&sb=$sort_field&so=$sortfield&$fieldname=%5E|;
print chr($i);
print qq|&re=on&view_records=1">[|;
print chr($i);
print qq|]</A></font>\n|;
}
else {
print "<$font> [" . chr($i) . "]</font> ";
}
++$i;
}
print qq|

=============

I'm a little confused as to how you are setting up your database as far as permissions. Are you letting the default users add records?

In your .cfg file you have:

$auth_user_field = 9;

Are you using the 'Submitted_By' field to hold the userid or a name? If it's a userid field to identify the record with a user then change to:

$auth_user_field = 7;

You would also want to make this field required if registered users are the only ones who will be adding records. This way they can modify their own records.

If you are not having a registered user enter records and not using a userid field, you may want to change your permissions and also change:

$auth_user_field = -1;

Let's get these things figured out and then work to get the other display going.

It might be easiest to setup a custom search form on your home page so visitors can pick a genre, an artist or a song title. Then perhaps have the short display show Artist Name plus the album?

Unoffical DBMan FAQ
http://redundantcartridge.com/dbman/

Last edited by:

LoisC: Sep 21, 2002, 9:49 PM
Quote Reply
Re: [LoisC] Help with Short/Long Mod?? In reply to
I made all the changes just as you showed.

The Lyrics line break works perfectly now. Cool

Creating the list of Alpha links did not work for me. I deleted 'print qq|' at the very end and somehow it worked.

Believe me I have no idea, I only deleted small sections of code to narrow down the syntax error until it worked .



As far as permissions go, I would like for a user to be required to sign in if they want to add a record.

This would allow their user name to be attached to the record. The only other permissions would be

that the person who made the record would be allowed to edit/delete it. With the only exception being me or another

admin being able to edit the database remotely.

Quote:
It might be easiest to setup a custom search form on your home page so visitors can pick a genre, an artist or a song title. Then perhaps have the short display show Artist Name plus the album?


Yes, this was my intent. I would like to set up links for searching by Artist, Genre, and Song Title. Possibly Album also?



Thanks a million Lois...Smile You are saving me probably weeks of work being that I can't spend as much time as I would like to every day.

--Sean
Quote Reply
Re: [BigBullyGuy] Help with Short/Long Mod?? In reply to
Sorry about the stray print qq| line .. I copied and pasted and didn't realize I left it there.

Other Changes:

$admin_email = "admin@seesongs.com";

to either:

$admin_email = "admin\@seesongs.com";

or

$admin_email = 'admin@seesongs.com';

-------------

Okay if you want only registered users to add records add another field to your .cfg file:

after:

Submitted_By => [7, 'alpha', -2, 50, 0, '', ''], ## add comma at end

add:
'UserID' => [ 8,'alpha',10,13,1,'',''],

DON'T FORGET TO MANUALLY EDIT YOUR DB FILE TO ADD THESE EXTRA FIELDS! It wasn't holding either the submitted by and now the userid field.

Change: $auth_user_field = 8;


For permissions set to:

@auth_default_permissions = (1,0,0,0,0);
@auth_signup_permissions = (1,1,1,1,0);

--------------

In your html_record_form add:

Missing before: - was wondering why search wasn't working :)

<TR><TD ALIGN="Right" VALIGN="TOP"><$font>Submitted_By:</FONT></TD>
<TD VALIGN="TOP">&nbsp;<INPUT TYPE="TEXT" NAME="Song_Title" VALUE="$rec{'Submitted_By'}" SIZE="50" MAXLENGTH="255"></TD></TR>

<TR><TD ALIGN="Right" VALIGN="TOP"><$font>UserID:</FONT></TD>
<TD VALIGN="TOP">&nbsp;UserID: &nbsp;<input type="TEXT" name="UserID" SIZE="10" VALUE="$rec{'UserID'}" MAXLENGTH="13"></TD></TR>

or if you only want it viewed by admin use (before end of table):

if ($per_admin) { print qq|
<TR><TD><$font>User ID:</font></TD><TD><INPUT TYPE="TEXT" NAME="UserID" SIZE="10" VALUE="$rec{'UserID'}" MAXLENGTH="13"></TD></TR>
}
else { print qq|
<TR><TD colspan=2><input type="hidden" NAME="UserID" VALUE="$rec{'UserID'}"></TD></TR> |;
}

print qq| </TABLE>|;

---------------------

In your html_record_long add:

the main layout is table width=500 in sub html_page_top
So the record dispaly table should be a width less than 500

<TABLE WIDTH="455" CELLPADDING=0 CELLSPACING=0 BORDER=1 BGCOLOR="#FFFFCC">

Add:

if ($per_admin) { print qq|
<TR><TD ALIGN="Center"><$font>User ID:</FONT></TD><TD>&nbsp;$rec{'UserID'}</TD></TR>|;
}

-------------

Then to Add userid automatically when adding records: Changes in db.cgi

In sub get_defaults replace:

foreach $field (keys %db_defaults) {
$default{$field} = $db_defaults{$field};
}

with:

foreach $field (keys %db_defaults) {
$default{$field} = $db_defaults{$field};
####### add userid in add form ###########
unless ($per_admin) { ($auth_user_field >=0) and ($db_defaults{$db_cols[$auth_user_field]} = $db_userid); }
}


In sub add_record instead of:

# Set the userid to the logged in user.
##### ($auth_user_field >= 0) and ($in{$db_cols[$auth_user_field]} = $db_userid);

use:

# Set the userid to the logged in user (except if admin).
unless ($per_admin) { ($auth_user_field >= 0) and ($in{$db_cols[$auth_user_field]} = $db_userid); }

More to come .. working on your custom search form.

Unoffical DBMan FAQ
http://redundantcartridge.com/dbman/

Last edited by:

LoisC: Sep 22, 2002, 11:32 AM
Quote Reply
Re: [LoisC] Help with Short/Long Mod?? In reply to
I like using a custom search form because it saves getting false results when no records match.

Create a new sub:

sub html_short_search_form { #### custom search form
# --------------------------------------------------------
# The form fields that will be displayed each time a record is edited (including searching).

print qq|<P><CENTER><$font><B>Search $html_title</B></font><P>
<FORM ACTION="$db_script_url" METHOD="GET">
<INPUT TYPE=HIDDEN NAME="db" value="$db_setup">
<INPUT TYPE=HIDDEN NAME="uid" value="$db_uid">
<INPUT TYPE=HIDDEN NAME="view_records" value=1>

<TABLE cellpadding=2 cellspacing=0 width=400 border=0>
<TR><TD><$font>Record ID:</font></TD><TD><INPUT TYPE="TEXT" NAME="ID" SIZE="3" VALUE="$rec{'ID'}"></TD></TR>
<TR><TD><$font>Genre:</FONT></TD><TD>|; print &build_select_field_from_db("Genre",$rec{'Genre'}); print qq|</TD></TR>
<TR><TD><$font>Artist:</FONT></TD><TD>|; print &build_select_field_from_db("Artist",$rec{'Artist'}); print qq|</TD></TR>
<TR><TD><$font>Album:</FONT></TD><TD><INPUT TYPE="TEXT" NAME="Album" SIZE="25" VALUE="$rec{'Album'}"></TD></TR>
<TR><TD><$font>Song_Title:</FONT></TD><TD>|; print &build_select_field_from_db("Song_Title",$rec{'Song_Title'}); print qq|</TD></TR>
<TR><TD><$font>Lyrics:</FONT></TD><TD><INPUT TYPE="TEXT" NAME="Lyrics" SIZE="25" VALUE="$rec{'Lyrics'}"></TD></TR>
<TR align=center><TD colspan=2><INPUT TYPE="SUBMIT" NAME="view_records" VALUE="$submit_button"></TD></TR></TABLE></FORM></CENTER><P> |;
}

You can modify the fields to either show the values within the database or use them as text fields to input their search.


On your home page you can call the search form using:

&html_short_search_form;

before your footer --- you might want to rename "View" to "Search" database in your footer.

You can also use this view for all searches by changing these subs in your html.pl file:

sub html_view_failure {
sub html_view_search {

sub html_view_search { ## use with short search form
# --------------------------------------------------------
# This page is displayed when a user requests to search the database for viewing. Note: all searches must use GET method.
#
$page_title= "Search the Database";
&html_page_top;
$submit_button = "Search Records";
$reset_button = "Reset Form";

print qq|<$font>You can use our keyword search box, or use the search box below to choose within specific fields to perform your search.</font><P>

<form action="$db_script_url" method="GET" name="form1">
<input type=hidden name="db" value="$db_setup">
<input type=hidden name="uid" value="$db_uid">
<input type="hidden" name="sb" value="$sort_field">
<input type="hidden" name="so" value="$sortorder"> |;

# &html_record_form();
&html_search_options;

print qq| <P><center><INPUT TYPE="SUBMIT" NAME="view_records" VALUE="$submit_button"></center></form><P> |;

&html_short_search_form;
&html_footer;
&html_page_bottom;
}

sub html_view_failure { ## use with short search form
# --------------------------------------------------------
# The search for viewing failed. The reason is stored in $message and a new search form is printed out.

my ($message) = $_[0];

$page_title = "Search Failed";
&html_page_top;
$submit_button = "Search Records";
$reset_button = "Reset Form";

print qq|<P><$font>There were problems with the search. Reason:</font> <$font_error><B>$message</B></FONT><P>
<$font>Please fix any errors and submit the record again.</font><P> |;

&html_short_search_form;
&html_footer;
&html_page_bottom;
}

-----------

Now you just have to fine tune your short display.

If you want column heading above the short display see the FAQ under the section "Viewing" look for a thread called 'Short display table headings'

Glad to see your database is coming together for you :)

Unoffical DBMan FAQ
http://redundantcartridge.com/dbman/
Quote Reply
Re: [LoisC] Help with Short/Long Mod?? In reply to
Lois....I can't thank you enough for so much work.

How long does something like what you just did take you? I am starting

to feel bad having you do my work for me with nothing in return. Unsure



On a lighter note, I am impressed that with so many additions to my code you had not one syntax error. Cool

Only 2 problems remain. First is, my alpha search displays the same Artist one time for each record entered.

It would be better if each Artist was only displayed once, no matter how many entries there were for each Artist.



2nd problem is that when I click on an Artist in the short display, I am taken directly to the long display. It should take

me to another short record with Albums. Then ideally, to another short record of Song Titles. Or, the best would be

if the short record displaying Artists would take you to a list of Song Titles, with each Song Title listed under it's

respectful Album. Or am I asking too much??? Crazy



Oh, I found the thread called 'Short display table headings' . But using your advise I did not install it before what I

had was working perfectly. Wink



Also, I updated the .txt files I posted for you with the new editions. Hope you can get me though this last part of my database. Smile

Talk to you soon ... Sean

Last edited by:

BigBullyGuy: Sep 22, 2002, 5:51 PM
Quote Reply
Re: [BigBullyGuy] Help with Short/Long Mod?? In reply to
Let me go look at your files again. From the short list it looks like the database is corrupted (i.e. fields not showing in the correct location)

I'll also see if I can get those other functions working.

This forum has always been great in helping others to get their databases up and running, so don't feel bad, it's just want we do here :)

We'll continue this via private messages.

Unoffical DBMan FAQ
http://redundantcartridge.com/dbman/

Last edited by:

LoisC: Sep 24, 2002, 8:11 PM