hola,
you're right glennu, it's much easier with ssi... but i think it would slow down my site...
anyway... i'v got the what's new on homepage by modifing
the
sub site_html_home in
site_html_templates.pl like this (modifications are in red...):
In Reply To:
sub site_html_home {
# --------------------------------------------------------
# This routine will build a home page. It is not meant to have any
# links on it, only subcategories.
# Start What's New results...
# 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 $category (sort keys %new_links) {
LINK: for ($i = 0; $i < ($#{$new_links{$category}}+1) / ($#db_cols + 1); $i++) {
$total++;
%tmp = &array_to_hash ($i, @{$new_links{$category}});
${$link_output{$tmp{'Date'}}}{$category} .= &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/$long_date");
}
else {
$link_results .= "<p><strong>$long_date</strong>\n<blockquote>";
}
CATEGORY: foreach $category (sort keys %{$link_output{$date}}) {
$category_clean = &build_clean ($category);
$link_results .= qq|<P><A HREF="$build_root_url/$category/$build_index">$category_clean</A>\n|;
$link_results .= ${$link_output{$date}}{$category};
}
# Crete the new page, and do a bit of HTML work for the main page.
if ($build_span_pages) {
$main_link_results .= qq|<li><a href="$build_new_url/$date$build_extension">$long_date</a> ($total).|;
$main_total += $total;
}
else {
$link_results .= "</blockquote>";
}
}
if ($build_span_pages) {
$link_results = "<ul>$main_link_results</ul>";
$total = $main_total;
}
$title_linked = &build_linked_title ("New");
# Stop What's New results... return &load_template ('home.html', {
category => $category,
grand_total => $grand_total,
long_date => $long_date,
bhlnew => $link_results,
bhltotal => $total, %globals
});
}
you also need tho put
<%bhlnew%> and
<%bhltotal%> tags in your
home.html template...
i'd like to know if everyhing is correct...
i mean... to clean out what it is not necessary, and so on...
please, give me your feedback...
i'm not a perl programmer and, really,
i still have not realized how it can works!!!
there is one more mod i need:
since i've got the link to the new links added on the homepage,
i don't need anymore the what's new index.html file...
how can i stop the build of this page???
thanks,
ciao