Hi,
In /admin/Plugins/ULTRAGlobals.pm, find the function "sub List_Links", and replace the code with the following:
Code:
sub List_Links {
my ($sort_order,$limit) = (shift,shift);
my @fields_to_sort = @_;
$sort_order ||= "Title ASC";
my $tbl = $DB->table('Links');
if (defined $limit) {
$tbl->select_options(qq|ORDER BY $sort_order LIMIT $limit|);
} else {
$tbl->select_options(qq|ORDER BY $sort_order|);
}
my $cond = new GT::SQL::Condition;
foreach (@fields_to_sort) {
my ($field,$operator,$val) = split /::/;
$cond->add($field,$operator,$val);
}
$cond->bool('AND');
my $sth = $tbl->select( GT::SQL::Condition->new($field,$operator,$val) ) || die $GT::SQL::error;
my @loop;
while (my $hit = $sth->fetchrow_hashref) {
$hit = Links::SiteHTML::tags('link', $hit);
push @loop, $hit;
}
return { cond_loop_link => \@loop }
}
Then try calling using:
Code:
<%Plugins::ULTRAGlobals::List_Links('Title ASC',10,'isValidated::=::Yes','Foo::LIKE::%bar%')%>
The 1st paramater is the "sort" order for the results. The 2nd paramater is the "limit" of how many results to get. The ones after that are the different field types you wanna add to the condition.
The above would do:
Code:
isValidated => Yes
Foo LIKE '%bar%'
Each condition needs to be given a new value... for example:
Code:
'Foo::=::bar','Test::<=::5'
..etc
Totally untested, but should work
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