Code:
sub build_detailed_view {
# --------------------------------------------------------
# This routine build a single page for every link.
#
my (@values, $id, %rec, $count);
if ($build_detail_path =~ m,^$build_root_path/(.*)$,) {
&build_dir ($1);
}
print "\t";
open (DB, "<$db_file_name") or &cgierr("unable to open database: $db_file_name. Reason: $!");
LINE: while (<DB> ) {
/^#/ and next LINE; # Skip comment Lines.
/^\s*$/ and next LINE; # Skip blank lines.
chomp;
@values = &split_decode ($_);
$id = $values[$db_key_pos];
%rec = &array_to_hash (0, @values); next LINE unless ($rec{'Detailed'} eq 'Yes'); # Add me!
$title_linked = &build_linked_title ("$rec{'Category'}/$rec{'Title'}");
open (DETAIL, ">$build_detail_path/$id$build_extension") or &cgierr ("Unable to build detail page: $build_detail_path/$id$build_extension. Reason: $!");
print DETAIL &site_html_detailed (%rec);
close DETAIL;
$use_html ?
print qq~<a href="$build_detail_url/$id$build_extension">$id</a> ~ :
print qq~$id ~;
(++$count % 10) or print "\n\t";
}
close DB;
print "\n";
}
HTH
------------------
Craig Antill
10 Tenths Motorsport (1.1) -
www.Ten-Tenths.com/links/ THE Directory (2.0b3) -
www.gardenbuildings.com/ [This message has been edited by Craig Antill (edited February 16, 1999).]