Gossamer Forum
Quote Reply
"newest links"
Hello,

Probably somewhere in this forum is listed how to display "newest links" of links sql on dynamic pages of other GT products.

Can someone help me!

Thanks

t7
Quote Reply
Re: [t7o7n7y] "newest links" In reply to
Which GT Products are you refering to? GForum?

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!
Quote Reply
Re: [Andy] "newest links" In reply to
Hi, i meant other separated links sql under the same server and domain name.

Thanks

T7
Quote Reply
Re: [t7o7n7y] "newest links" In reply to
Hi,

This global called 'newlinks' could do the trick:

Code:
sub {
lib->import('Path/to/admin'); # might not be necessary
require GT::SQL;
my $table = GT::SQL->new('/path/to/admin/defs')->table('Links');
$table->select_options ('ORDER BY Add_Date DESC', 'LIMIT 5');
my $sth = $table->select;

my @output;
while (my $link = $sth->fetchrow_hashref) {
push (@output, $link);
}
return { top5_loop => \@output };
}

Then insert the following in the template where you want the latest 5 links to appear:
Code:
<%newlinks%>
<%loop top5_loop%>
<%Title%>
<%endloop%>

Cheers
Klaus

http://www.ameinfo.com
Quote Reply
Re: [klauslovgreen] "newest links" In reply to
Thanks,

For a full path will it work on G forum for example or on another sql links??? installed on the same server and under the same domain name?

Let me know please

T7
Quote Reply
Re: [t7o7n7y] "newest links" In reply to
I don't have G forum - but it works with several different Links installations...

Klaus

http://www.ameinfo.com