Home : Products : Gossamer Links : Discussions :

Products: Gossamer Links: Discussions: Re: [marker] Different links_loop for different link types: Edit Log

Here is the list of edits for this post
Re: [marker] Different links_loop for different link types
You could try something like;

Code:
sub {

my $db = $DB->table('CatLinks','Links');
my (@output, $sth);
my $count = 0;
my $sth = $db->select ( { CategoryID => $_[0]}, { Link_Type => 'Premium' } );
while (my $hash = $sth->fetchrow_hashref) {
if ($count == 1) { $count = 0; $hash->{odd} = 1; }
if ($count == 0 && !$hash->{odd}) { $count++; $hash->{even} = 1; }
push @output, $hash;
}

return { Premium_Link_Loop => \@output }

}

...called with;

Code:
<%global_name%>
<%loop Premium_Link_Loop%>
<%include link.html%>
<%endloop%>

...and then in link.html, you can use;

<%if odd%>foo<%else%><%endif%>

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: Apr 26, 2004, 6:44 AM

Edit Log: