Try this bit, have no idea if it'll work, though. Changes in red. Maybe it'll give ya some direction...?
Code:
sub build_new_page {
# --------------------------------------------------------
# Creates a "What's New" page. Set $build_span_pages to 1 in links.cfg
# and it will create a seperate page for each date.
#
my (%link_output, $category_clean, $long_date, $category, $date,
$number_links, $main_link_results, $main_total, %span_totals);
local ($total, $link_results, $title_linked); # Let's build the What's New directory.
if ($build_new_path =~ m,^$build_root_path/(.*)$,) {
&build_dir ($1);
}
# Now we go through all the new_links (which are organized by category), and
# build the html in array indexed by date then category.
$total = 0;
CATEGORY: foreach $
subcategory (sort keys %new_links) { LINK: for ($i = 0; $i < ($#{$new_links{$
subcategory}}+1) / ($#db_cols + 1); $i++) {
$total++;
%tmp = &array_to_hash ($i, @{$new_links{$
subcategory}});
${$link_output{$tmp{'Date'}}}{$
subcategory} .= &site_html_link (%tmp) . "\n";
$span_totals{$tmp{'Date'}}++;
}
}
# Then we go through each date, and build the links for that date. If we are spanning
# pages, we will create a seperate page for each date and need to set up a few other
# variables (like title and total). We will also want to reset links_results each time.
DATE: foreach $date (sort { &date_to_unix($b) <=> &date_to_unix($a) } keys %link_output) {
$long_date = &long_date ($date);
if ($build_span_pages) {
$link_results = "";
$total = $span_totals{$date};
$title_linked = &build_linked_title ("New/$date");
}
else {
$link_results .= "<p><strong>$long_date</strong>\n<blockquote>";
}
CATEGORY: foreach $
subcategory (sort keys %{$link_output{$date}}) {
$category_clean = &build_clean ($
subcategory);
$link_results .= qq|<P><A HREF="$build_root_url/$
subcategory/$build_index">$category_clean</A>\n|;
$link_results .= ${$link_output{$date}}{$
subcategory};
}
Leonard
aka PerlFlunkie