Hi Andy,
Thanks for your help.
I added another if statement as this was causing an error without it (not sure if this is correct);
<%if random_link.length%>
<%loop random_link%>
<%include link.html%>
<%endif%>
<%endif%> but then got this error when added into category.html template;
"GT::SQL::Table (14571): Invalid category id: HASH(0x8841440) at /home/mysite/public_html/cgi-bin/admin/Links/Table/Category.pm line 406."
Not sure if this is helpful, but I change the formatting for the paid links by using this in links.html
<%if paymentsEnabled and not isFree%>
<%include include_paid_link.html%>
The payment_tags global contains this;
my $tags = GT::Template->tags;
if ($CFG->{payment}->{enabled}) {
my $expiry_date = $tags->{ExpiryDate};
my $rec;
$rec->{paymentsEnabled} = 1;
$rec->{isUnpaid} = $expiry_date == UNPAID;
$rec->{isFree} = $expiry_date == FREE;
$rec->{isExpired} = ($expiry_date > UNPAID and $expiry_date < time);
return $rec;
}
}
include_paid_link.html then formats the actual sponsored links differently.
Not quite sure where it is all going wrong?
Best wishes,
Piers
Thanks for your help.
I added another if statement as this was causing an error without it (not sure if this is correct);
Code:
<%if random_paid_in_category($category_id)%> <%if random_link.length%>
<%loop random_link%>
<%include link.html%>
<%endif%>
<%endif%>
"GT::SQL::Table (14571): Invalid category id: HASH(0x8841440) at /home/mysite/public_html/cgi-bin/admin/Links/Table/Category.pm line 406."
Not sure if this is helpful, but I change the formatting for the paid links by using this in links.html
Code:
<%payment_tags%> <%if paymentsEnabled and not isFree%>
<%include include_paid_link.html%>
The payment_tags global contains this;
Code:
sub { my $tags = GT::Template->tags;
if ($CFG->{payment}->{enabled}) {
my $expiry_date = $tags->{ExpiryDate};
my $rec;
$rec->{paymentsEnabled} = 1;
$rec->{isUnpaid} = $expiry_date == UNPAID;
$rec->{isFree} = $expiry_date == FREE;
$rec->{isExpired} = ($expiry_date > UNPAID and $expiry_date < time);
return $rec;
}
}
include_paid_link.html then formats the actual sponsored links differently.
Not quite sure where it is all going wrong?
Best wishes,
Piers