here is the entire piece of code. I have changed the Database so it is running this code at
log on as guest/guest.
Code:
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.
# This is the "short display" -- the list of records that are returned
# from a search.
my (%rec) = @_; # Load any defaults to put in the VALUE field.
($db_auto_generate and print &build_html_record(%rec) and return);
$rec{$db_key} =~ s/<.?B>//g;
# create link to full display
$record_number = ((($nh - 1) * $db_max_hits) + $i);
$long_url = $ENV{'QUERY_STRING'};
$long_url =~ s/\&nh=\d+//;
$long_url =~ s/\&mh=\d+//;
$long_url = "$db_script_url?$long_url&nh=$record_number&mh=1";
print "<TD>"; # do not remove this! It is necessary to make the records display properly
# Below is where you define what you want to appear for each record in the "short" display.
# You can make this whatever you want, and display as many fields as you would like.
# Choose which of the fields you would like for users to click on to reach the full display
# of records and use that field name in place of "Title" below.
#
# Be sure that you use <a href="$long_url"> for the link to your full record display.
# <-- Start of short display formatting -- >
print qq|
<a href="$long_url">$rec{'Nick'}</a>
|;
# if you want to display your fields in columns, use the following format:
# print qq|
# $rec{'Field'}</td>
# <td>$rec{'Field'}</td>
# <td>$rec{'Field'}</td>
# <td>$rec{'Field'}|;
# Add or remove columns as needed. Be sure you add the $long_url link to one of your fields
# <-- End of short display formatting -- >
print "</TD>"; # do not remove this! It is necessary to make the records display properly
}
sub html_record_long {
#----------------------------------------------------------------
my (%rec) = @_;
if ($db_total_hits > 1) {
# create links to previous and next records
$next_url = $ENV{'QUERY_STRING'};
$next_url =~ s/\&nh=\d+//;
$next_hit = $nh + 1;
$prev_hit = $nh - 1;
if ($prev_hit) {
$previous = qq~<a href="$db_script_url?$next_url&nh=$prev_hit"><$font>Previous</font></a>~;
}
else { $previous = " "; }
if ($next_hit <= $db_total_hits) {
$next = qq~<a href="$db_script_url?$next_url&nh=$next_hit"><$font>Next</font></a>~;
}
else { $next = " "; }
# create link back to short display
$list_url = $next_url;
$list_url =~ s/\&mh=\d+//;
$mh = $db_max_hits;
$lh = int(($nh-1)/$mh) + 1;
$list = qq~<a href="$db_script_url?$list_url&nh=$lh"><$font>Back to record list</font></a>~;
# print out the links
print qq|
<table width=100%>
<tr><td width=50%>$previous</td>
<td width=50% align=right>$next</td></tr>
<tr><td colspan=2 align=center>$list</td></tr>
<tr><td colspan=2 align=center><$font>Record $nh of $db_total_hits</font></table>
|;
}
# Below is where you define your form.
# <-- Start of record display -->
my (%rec) = @_; # Load any defaults to put in the VALUE field.
($db_auto_generate and print &build_html_record(%rec) and return);
$rec{$db_key} =~ s/<.?B>//g;
my $font_color = 'Font face="Verdana, Arial, Helvetica" Size=2 Color=#FFFFFF';
my $font = 'Font face="Verdana, Arial, Helvetica" Size=2 Color=#FFFFFF';
print qq|
<TABLE WIDTH="475" CELLPADDING=0 CELLSPACING=0 BORDER=1 BGCOLOR="#000000">
<TR><TD ALIGN="Right" VALIGN="TOP" WIDTH="20%"><$font_color>Nick:</FONT></TD>
<TD WIDTH="80%"> <$font>$rec{'Nick'}</Font></TD></TR>
<TR><TD ALIGN="Right" VALIGN="TOP"><$font_color>Name:</FONT></TD>
<TD> <$font>$rec{'Name'}</Font></TD></TR>
<TR><TD ALIGN="Right" VALIGN="TOP"><$font_color>Homepage:</FONT></TD>
<TD> <$font><A HREF="$rec{'Homepage'}">$rec{'Homepage'}</A></Font></TD></TR>
<TR><TD ALIGN="Right" VALIGN="TOP"><$font_color>Clan: </FONT></TD>
<TD> <$font><a href="$rec{'Clanpage'}">$rec{'Clan'}</a></Font></TD></TR>
<TR><TD ALIGN="Right" VALIGN="TOP"><$font_color>DOB:</FONT></TD>
<TD> <$font>$rec{'DOB'}</Font></TD></TR>
<TR><TD ALIGN="Right" VALIGN="TOP"><$font_color>ICQ:</FONT></TD>
<TD> <$font>$rec{'ICQ'} <A HREF="http://msg.mirabilis.com/scripts/contact.dll?msgto=$rec{'ICQ'}">
<img src="http://wwp.icq.com/scripts/online.dll?icq=$rec{'ICQ'}&img=5" VALIGN="center"></a></Font></TD></TR>
<TR><TD ALIGN="Right" VALIGN="TOP"><$font_color>Weapon:</FONT></TD>
<TD> <$font>$rec{'Weapon'}</Font></TD></TR>
<TR><TD ALIGN="Right" VALIGN="TOP"><$font_color>Item:</FONT></TD>
<TD> <$font>$rec{'Item'}</Font></TD></TR>
<TR><TD ALIGN="Right" VALIGN="TOP"><$font_color>Map:</FONT></TD>
<TD> <$font>$rec{'Map'}</Font></TD></TR>
<TR><TD ALIGN="Right" VALIGN="TOP"><$font_color>Comments:</FONT></TD>
<TD> <$font>$rec{'Comments'}</Font></TD></TR>
<TR><TD ALIGN="Right" VALIGN="TOP"><$font_color>Email:</FONT></TD>
<TD> <$font><A HREF="mailto:$rec{'Email'}">$rec{'Email'}</A></Font></TD></TR>
|;
# to close off a previous print qq| statement
$ALLOWED_EXT =~ s/\\.//g;
$ALLOWED_EXT =~ s/\$//g;
@extensions = split (/\Q|\E/o,$ALLOWED_EXT);
GRAPHIC: foreach $extension (@extensions) {
if (-e "$SAVE_DIRECTORY/$rec{$db_key}.$extension") {
print qq|
<TR><TD ALIGN="Right" VALIGN="TOP"><$font_color>Picture:</FONT></TD>
<TD> <$font><a href="$SAVE_DIRECTORY_URL/$rec{$db_key}.$extension">Click for picture.</a></Font></TD></TR>
|;
last GRAPHIC;
}
}
print qq|
</TABLE>
|;
}