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

<%if FatherID eq not working anymore?!

Quote Reply
<%if FatherID eq not working anymore?!
hi every one.
I need some help with my global.
I working well in the 2.x versions, but in 3. are now.
there is a listing:

global:
Random_Link2

sub {
my $tags = shift;
my $link_db = $DB->table('Links','CatLinks');
my $cat_id = $tags->{Random_CatID};
my $limit = $tags->{Random_Limit} || 15;
my (@output, $sth); $link_db->select_options ('ORDER BY Rating DESC', "LIMIT $limit");
if ($cat_id) {
$sth = $link_db->select ( { CategoryID => $cat_id });
}
else {
$sth = $link_db->select;
}
while (my $hash = $sth->fetchrow_hashref)
{ push @output, $hash;
}
return { Random_Loop => \@output } }


template code:
<%if FatherID eq '175'%>
<%set Random_CatID = 175%>
<%Random_Link2%>
<%loop Random_Loop%>
<li></li>
<a target="_self" href="<%get_detailled_url($ID)%>">
<font font class=fixed face=arial,helvetica,sans-serif size=-1>
<%Title%></a>&nbsp;<br>
<%endloop%>
<%elseif FatherID eq '1'%>
<%set Random_CatID = 1%>
<%Random_Link2%>
<%loop Random_Loop%>
<li></li>
<a target="_self" href="<%get_detailled_url($ID)%>">
<font font class=fixed face=arial,helvetica,sans-serif size=-1>
<%Title%></a>&nbsp;<br>
<%endloop%><%endif%>

as I mentioned, its worked well in the past versions of Links, but wount to work in the 3.

please help to fix it.

Last edited by:

hmc: Jun 2, 2005, 11:35 PM
Quote Reply
Re: [hmc] <%if FatherID eq not working anymore?! In reply to
it might have to do with how variables are packaged.

Do a <%DUMP%> on the template, and see what variables are being passed back.

variables now have prefixes, or are stored in arrays to prevent namespace-crashes.


PUGDOG´┐Ż Enterprises, Inc.

The best way to contact me is to NOT use Email.
Please leave a PM here.