Home : Products : Gossamer Links : Development, Plugins and Globals :

Products: Gossamer Links: Development, Plugins and Globals: Re: [katabd] simple Global: Edit Log

Here is the list of edits for this post
Re: [katabd] simple Global
Hi,

Not sure if this is what your trying to do (untested, so appologies if it doesn't work - still early morning with a little hangover ;))

Name the global: get_links_with_ext

Code:
sub {
my $cond = new GT::SQL::Condition;

foreach (qw/com org co.uk net/) {
$cond->add("%.$_/");
$cond->add("%.$_");
}
$cond-bool('OR');

my @links;
my $sth = $DB->table('Links')->select( $cond, { isValidated = "Yes" } ) || die $GT::SQL::error;

while (my $hit = $sth->fetchrow_hashref) {
push @links, $hit;
}

return { custom_links_loop => \@links };

}

..then call with:

Code:
<%get_links_with_ext%>
<ul>
<%loop custom_links_loop%>
<li><%Title%></li>
<%endloop%>
<ul>

Hope that helps.

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!

Last edited by:

Andy: Jun 8, 2008, 10:17 AM

Edit Log: