Just gave that code a quick test and had a similar problem of building only one detailed page. I seem to remember having a similar problem after I hacked the detailed sub to build "comments" a while back. Anyway just a suggestion but shoving the code into nph_build.cgi instead seems to work so in the build detailed sub you'd have:
sub build_detailed_view {
# --------------------------------------------------------
# This routine build a single page for every link.
#
my (@values, $id, %rec, %rel, $related, $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);
$title_linked = &build_linked_title ("$rec{'Category'}/$rec{'Title'}");
$related = "";
@rel = split(/~/, $rec{'Related'});
foreach $related_link (@rel) {
my (%rel) = &get_record ($related_link);
$related .= &site_html_related_link (%rel);
}
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, $related);
close DETAIL;
$use_html ?
print qq~<a href="$build_detail_url/$id$build_extension" target="_blank">$id</a> ~ :
print qq~$id ~;
(++$count % 10) or print "\n\t";
}
close DB;
print "\n";
}
Then in site_html_templates use:
sub site_html_detailed {
# --------------------------------------------------------
# This routine will build a single page per link. It's only
# really useful if you have a long review for each link --
# or more information then can be displayed in a summary.
#
my %rec = @_;
return &load_template ('detailed.html', {
total => $total,
grand_total => $grand_total,
title_linked => $title_linked,
related => $related,
%rec,
%globals
} );
}
Good Luck!
Glenn
Host Links
http://cgi-resource.co.uk/links