Here's what I have in my sub html_record_long. :) Are you sure the problem is there? The links on sub html_record seem to be the problem? Just what I concluded, I could be wrong! :)
In Reply To:
sub html_record_long {
# --------------------------------------------------------
# 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.
$row_color[0] = "FFFFFF";
$row_color[1] = "DEDCDC";
print qq|
|;
my (%rec) = @_; # Load any defaults to put in the VALUE field.
if ($db_total_hits > 1) {
# create links to previous and next records
$next_url = $ENV{'QUERY_STRING'};
$next_url =~ s/\&nh=\d+//;
$next_url =~ s/\&StatSort=\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>
<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>
|;
}
($db_auto_generate and print &build_html_record(%rec) and return);
my $font_color = 'Font face="Times New Roman, Arial, Helvetica" Size=2 Color=#800000';
my $font = 'Font face="Times New Roman, Arial, Helvetica" Size=2';
print qq|
<table border="0" cellspacing="0" width="275">
<tr>
<td bgcolor="#800000" width="226"><font color="#FFFFFF"><b>$rec{'First'} $rec{'Last'}</b></font></td>
<td bgcolor="#800000" width="122" align="right"><font color="#FFFFFF"><b>$rec{'Position'}</b></font></td>
<td bgcolor="#800000" width="3" align="right"> </td>
</tr>
<tr>
<td bgcolor="#000000" width="226"><font color="#FFFFFF"><b><a href="http://www.warningtrack.net/teams/indians" style="color: #FFFFFF">$rec{'Team'}</a></b></font></td>
<td bgcolor="#000000" width="122" align="right"><font color="#FFFFFF"><b>#$rec{'Jersey'}</b></font></td>
<td bgcolor="#000000" width="3" align="right"> </td>
</tr>
</table> <p>
|;
&switch_to_hitting;
$StatSort = $in{'StatSort'};
$sort_link = $ENV{'QUERY_STRING'};
$sort_link =~ s/\&StatSort=\d+//;
undef %in;
$rec{'PlayerID'} =~ s/<?.B>//g;
$in{'PlayerID'} = $rec{'PlayerID'};
if ($StatSort) { $in{'sb'} = $StatSort;}else { $in{'sb'} = 2;}
$in{'mh'} = 100;
my ($status2,@hits2) = &query("view");
if ($status2 eq "ok") {
my ($numhits2) = ($#hits2+1) / ($#db_cols+1);
print "<table cellspacing=0 width=420><tr>";
for ($k=2;$k<=$#db_cols;++$k) { print qq|<td bgcolor=#800000 align=center> <font color=#FFFFFF size=2><b> <a href="$db_script_url?$sort_link&StatSort=$k" style="color: #FFFFFF">$db_cols[$k]</a></b></font></td>|; }
print "</tr>";
for (0 .. $numhits2 - 1) {
%rec2 = &array_to_hash($_, @hits2);
print qq|<tr bgcolor="$row_color[$color]">\n|;
$color= !$color; for ($k=2;$k<=$#db_cols;++$k) {
print "<td align=center><font size=2>$rec2{$db_cols[$k]}</font></td>";
}
}
print "</table>";
}
&switch_to_pitching;
if ($StatSort) { $in{'sb'} = $StatSort;}else { $in{'sb'} = 2;}
my ($status3,@hits3) = &query("view");
if ($status3 eq "ok") {
my ($numhits3) = ($#hits3+1) / ($#db_cols+1);
print "<table cellspacing=0 width=420><tr>";
for ($k=2;$k<=$#db_cols;++$k) {
print qq|<td align=center bgcolor=#800000 width=52><font size=2 color=#FFFFFF><b><a href="$db_script_url?$sort_link&StatSort=$k" style="color: #FFFFFF">$db_cols[$k]</a></b></font></td>|;
}
print "</tr>";
for (0 .. $numhits3 - 1) {
%rec3 = &array_to_hash($_, @hits3);
unless ($j) {
print qq|<tr bgcolor="DEDCDC">|;
$j = 1;
}
else {
print qq|<tr bgcolor="FFFFFF">|;
$j = 0;
}
print qq|<tr bgcolor="$row_color[$color]">\n|;
$color= !$color; for ($k=2;$k<=$#db_cols;++$k){
print "<td align=center><font size=2>$rec3{$db_cols[$k]}</font></td>";
}
}
print "</table>";
}
&switch_to_players;
print qq|
<p><TABLE WIDTH="475" CELLPADDING=0 CELLSPACING=0 BORDER=0 BGCOLOR="#FFFFFF">
|;
if ($per_admin) {
print qq|
<TR><TD ALIGN="Left" VALIGN="TOP" WIDTH="20%"><$font_color><b>PlayerID:</b></FONT></TD>
<TD WIDTH="80%"> <$font>$rec{'PlayerID'}</font></TD></TR>
<TR><TD ALIGN="Left" VALIGN="TOP" WIDTH="20%"><$font_color><b>RosterID:</b></FONT></TD>
<TD WIDTH="80%"> <$font>$rec{'RosterID'}</font></TD></TR>
|;
}
print qq|
<TR><TD ALIGN="Left" VALIGN="TOP" WIDTH="20%"><font size=2 color=000080><b>Height:</b></FONT></TD>
<TD WIDTH="80%"> <$font>$rec{'Height'}</font></TD></TR>
<TR><TD ALIGN="Left" VALIGN="TOP" WIDTH="20%"><font size=2 color=000080><b>Weight:</b></FONT></TD>
<TD WIDTH="80%"> <$font>$rec{'Weight'} lbs.</fFont></TD></TR>
<TR><TD ALIGN="Left" VALIGN="TOP" WIDTH="20%"><font size=2 color=000080><b>Batting:</b></FONT></TD>
<TD WIDTH="80%"> <$font>$rec{'Batting'}</font></TD></TR>
<TR><TD ALIGN="Left" VALIGN="TOP" WIDTH="20%"><font size=2 color=000080><b>Throwing:</b></FONT></TD>
<TD WIDTH="80%"> <$font>$rec{'Throwing'}</font></TD></TR>
<TR><TD ALIGN="Left" VALIGN="TOP" WIDTH="20%"><font size=2 color=000080><b>Birthdate:</b></FONT></TD>
<TD WIDTH="80%"> <$font>$rec{'Birthdate'}</font></TD></TR>
</TABLE>|;
if ($per_add) {
if ($rec{'Position'} eq 'Pitcher') {
print qq|<p><b><font size=3><a href="$db_script_url?db=pitching&uid=$db_uid&PlayerID=$rec{'PlayerID'}&add_form=1">Add Pitching Stats for $rec{'First'} $rec{'Last'}</a></font></b><p>
|;
}
else {
print qq|<p><b><font size=3><a href="$db_script_url?db=hitting&uid=$db_uid&PlayerID=$rec{'PlayerID'}&add_form=1">Add Hitting Stats for $rec{'First'} $rec{'Last'}</a></font></b><p> |;
}
}
print qq|
|;
}
:) I must say, this is an amazing use of DBMan...are there any others this complex? This one boggles the mind...that StatSort thing of yours is awesome...you'll definetly be credited in our "About" section as a MAJOR help in building our site as a whole! :)