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
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!
Quote Reply
Re: [Andy] LastLinks global In reply to
Thanks. Will test it.

Regards.

UnReal Network