Gossamer Forum
Quote Reply
LastLinks global
Hi,

I'm using this global to display LastLinks on my homepage:

Code:
sub {
my $tags = shift;
my $table = $DB->table('Links');
$table->select_options ('ORDER BY ID DESC', 'LIMIT 6');
my $sth = $table->select ({isValidated => "Yes"});
my @output;
while (my $link = $sth->fetchrow_hashref) {
$link->{detailed_url} = $CFG->{build_root_url} . "/" . $DB->table('Links')->detailed_url( $link->{ID} );
push (@output, $link);
}
return { LastLinks_loop => \@output };
}

But this code also show links that are validated but still awaiting payment. Well, don't want to show links that are awaiting payment. How to do this?

Regards.

UnReal Network
Quote Reply
Re: [deadroot] LastLinks global In reply to
Hi,

I think you need something like:

Code:
my $sth = $table->select ( GT::SQL::Condition->new('isValidated','=',"Yes",'ExpiryDate','>=',time) );

Cheers

Andy (mod)
andy@ultranerds.co.uk


IMPORTANT: I've now moved to ultranerds.co.uk, and the .com will no longer work!
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package (plugins total "value" $3,325 & rising, for just $350)| GLinks ULTRA Package PRO (plugins total "value" $5,625 & rising, for just $500)
Support Forum | Links SQL Plugins | DMOZ Dumps | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Compare our different Plugin packages *new* Free CSS Templates
Quote Reply
Re: [Andy] LastLinks global In reply to
Thanks. Will test it.

Regards.

UnReal Network