I did this on my site. (check my homepage)
this is a hack of a hack
it builds a seperate page which lists the newest links, which can then be called via ssi to any page
in nph-build.cgi
just before
# Create Home Page Add this
Code:
# Create Newest Include
$use_html ?
print qq|Building <A HREF="$build_root_url/newest_include.html">Newest include</A> . . .\n| :
print qq|Building Total Links . . .\n|;
&build_newest_include;
print "\tDone\n\n";
at the very bottom just before
1; Add this
Code:
sub build_newest_include {
# --------------------------------------------------------
my ($subcat, @rootcat);
local ($total);
print "\tOpening page: $build_root_path/newest_include.html\n";
my $LastX = 4;
open (DB, "<$db_file_name") or &cgierr("unable to open database:$db_file_name.\nReason: $!");
my @lines = <DB>;
close DB;
for ($i=$#lines; $i>=$#lines - $LastX; $i--) {
chomp $lines[$i];
@tmp = &split_decode ($lines[$i]);
%tmp = &array_to_hash (0, @tmp);
$lastlinkInclude .= &site_html_link (%tmp);
}
open (newest_include, ">$build_root_path/newest_include.html") or &cgierr ("unable to open home page: $build_root_path/newest_include.html. Reason: $!");
print newest_include &site_newest_include;
close newest_include;
print "\tClosing page.\n";
}
in site_html_template.pl
just before
sub site_html_home { add
Code:
sub site_newest_include {
# --------------------------------------------------------
# This routine will build the newest links for the homepage via ssi
return &load_template ('newest.html', {
lastlinkInclude => $lastlinkInclude,
%globals
});
}
you need to make a template called newest.html
mine just says <%lastlinkInclude%> but you could make it anything just as long as you put <%lastlinkInclude%> where you want the links to be
now include it into your homepage like this
<!--#include virtual="PathToLinksDir/pages/newest_include.html"--> hope I didn't leave out anything
------------------
bartour.hypermart.net [This message has been edited by Mutt (edited December 16, 1999).]
[This message has been edited by Mutt (edited December 16, 1999).]