Hi all,
How would I display a list of the last ten links. I want to add this list to my home.html. With the LastLinks SSI script I was able to add the last ten links, but they are displayed in the links.html template format. I was hoping to be able to display the last ten links in a new template style, which would only use the 'Title' (of the link) and the 'Location' (eg. cat1:sub6:subdir9).
Here is the code I am using for the LastLinks SSI script:
#!/usr/bin/perl
#================================
use strict;
use lib '/usr/home/eddie/www/cgi-bin/admin';
use Links qw/$DB $IN/;
Links::init('/usr/home/eddie/www/cgi-bin/admin');
use Links::SiteHTML;
local $SIG{__DIE__} = \&Links::fatal;
main();
#================================
sub main {
#---------------------------------------------------
# Display the newest link.
my ($sth,$tab,$output);
$tab = $DB->table('Links');
$tab->select_options('ORDER BY ID DESC', 'LIMIT 10');
$sth = $tab->select( { isValidated => 'Yes' } );
while (my $rec = $sth->fetchrow_hashref) {
$output .= Links::SiteHTML::display('link', $rec);
}
print $IN->header();
print $output;
}
Anyone have any ideas how how I can do this?
Thanks in advance,
Eddie
How would I display a list of the last ten links. I want to add this list to my home.html. With the LastLinks SSI script I was able to add the last ten links, but they are displayed in the links.html template format. I was hoping to be able to display the last ten links in a new template style, which would only use the 'Title' (of the link) and the 'Location' (eg. cat1:sub6:subdir9).
Here is the code I am using for the LastLinks SSI script:
#!/usr/bin/perl
#================================
use strict;
use lib '/usr/home/eddie/www/cgi-bin/admin';
use Links qw/$DB $IN/;
Links::init('/usr/home/eddie/www/cgi-bin/admin');
use Links::SiteHTML;
local $SIG{__DIE__} = \&Links::fatal;
main();
#================================
sub main {
#---------------------------------------------------
# Display the newest link.
my ($sth,$tab,$output);
$tab = $DB->table('Links');
$tab->select_options('ORDER BY ID DESC', 'LIMIT 10');
$sth = $tab->select( { isValidated => 'Yes' } );
while (my $rec = $sth->fetchrow_hashref) {
$output .= Links::SiteHTML::display('link', $rec);
}
print $IN->header();
print $output;
}
Anyone have any ideas how how I can do this?
Thanks in advance,
Eddie