Gossamer Forum
Home : Products : Gossamer Links : Discussions :

Displaying Lastly added Links in a different format.

Quote Reply
Displaying Lastly added Links in a different format.
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
Quote Reply
Re: [eddie123] Displaying Lastly added Links in a different format. In reply to
Check:

http://www.gossamer-threads.com/...s/Detailed/1845.html

http://www.gossamer-threads.com/...orum.cgi?post=171319
Quote Reply
Re: [eddie123] Displaying Lastly added Links in a different format. In reply to
Simple. Change;

Code:
$output .= Links::SiteHTML::display('link', $rec);

....to something like...

Code:
$output .= Links::SiteHTML::display('new10_link', $rec);

Then make a new template called new10_link.html

That should work Smile

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!