#####################################################################
# Column Record Display
# by JPDeni
# Written 19 April 2000
#
# Allows you to display search results in either horizontal or
# vertical columns.
#####################################################################
# Many people have asked about how to make their search results
# appear in rows, such as
#
# Record1 Record2 Record3 Record4
# Record5 Record6 Record7 Record8
# Record9 Record10 Record11 Record12
#
# You can have any number of columns that you want. Just remember
# that some folks have resolutions set on their monitors that may
# not fit a wide table and the search results will scroll off the
# edge of the browser window.
# In sub html_view_success, there are two lines that say
if ($db_next_hits) { print "
<$font>Pages: $db_next_hits"; }
# Between those lines is where your records print out.
# Replace whatever is between those lines with the following:
#--------------------------------------------------------------------
$i = 1;
$cols = 4; # Change this to the number of columns you want
print "
";
for (0 .. $numhits - 1) {
unless ($_%$cols) {
print "";
}
&html_record (&array_to_hash($_, @hits));
if ($_%$cols==($cols-1)) {
print "
\n";
}
++$i;
}
if ($numhits%$cols) {
for ($j=($cols-1);$j>=$numhits%$cols ;$j--) {
print " | ";
}
print "\n";
}
print "
";
#--------------------------------------------------------------------
#####################################################################
#
# It is also possible to create vertical rows of records, like
#
# Record1 Record7
# Record2 Record8
# Record3 Record9
# Record4 Record10
# Record5 Record11
# Record6 Record12
# You may have 2 or 3 columns.
# This works best if you just have one line of a record in the list or
# if you have a complete table in sub html_record.
# Between the lines
if ($db_next_hits) { print "
<$font>Pages: $db_next_hits"; }
# in sub html_view_success, replace the code with
#--------------------------------------------------------------------
$cols = 2; # Change this to 3 if you want three columns
for (1 .. $cols-1) {
$new_cell[((int($numhits/$cols) * $_)+1)+(($numhits%$cols)>0)] = "";
}
$i=1;
print "| \n";
for (0 .. $numhits - 1) {
print $new_cell[$i];
&html_record (&array_to_hash($_, @hits));
++$i;
}
print " | ";
#--------------------------------------------------------------------
# If you are using the short/long display mod, you'll need to make
# some other adjustments. Note that changes below are
# *only* for those using the short/long display mod.
# In the mod, there is a line
print " | "; # do not remove this! It is necessary to make the records display properly
# and a line
print " | "; # do not remove this! It is necessary to make the records display properly
# Remove these lines.
# In sub html_delete_form, change
print "";
# to
print "";
#--------------------------------------------------------------------
# Also, in sub html_modify_form, change
print "";
# to
print "";