Gossamer Forum
Home : Products : Gossamer Links : Version 1.x :

Widgets..please read

Quote Reply
Widgets..please read
Any chance you can convert the LastLink 1.99 mod http://www.gotzespace.dk/books/linksmod/lastlink.txt to LinksSQL for me??

Pretty please ... with sugar on top?

Chris
Quote Reply
Re: Widgets..please read In reply to
i'd imagine it to be like this:

Code:
my $number = 5;
my $offset = $LINKDB->total() - $number;
$sth = $LINKDB->prepare ( " SELECT * FROM Links LIMIT $offset, $number ");
$sth->execute() or die $DBI::errstr;
my ($lastlink, $link);
while ($link = $sth->fetchrow_hashref) {
$lastlink = &site_html_link ($link);
}

just some code whipped up.. dunno if it will return the right links.. but just try it Wink

jerry
Quote Reply
Re: Widgets..please read In reply to
Or try:

$hits = $LINKDB->query ( ID => '*', sb => 'Add_Date', so => 'DESC', mh => 5 );
if ($LINKDB->hits) {
foreach my $link (@$hits) {
$link = $LINKDB->array_to_hash ($link);
$last_link .= &site_html_link($link);
}
}

Cheers,

Alex