Gossamer Forum
Home : Products : Gossamer Links : Discussions :

Re: [Andy] Duplication link at new link page

Quote Reply
Re: [Andy] Duplication link at new link page In reply to
Hi AndySmile
I actually use this function:)
And I it not give me error when I try it.

sub {
use GT::SQL::Condition;
my $user = $_[0];
my $id = $_[1];
my $catid = $_[2];
my $tbl = $DB->table('CatLinks','Links');
$tbl->select_options('ORDER BY Add_Date DESC Limit 10');
my $cond = new GT::SQL::Condition;
$cond->add('isValidated','=','Yes');
$cond->add(Cast => Like => "%$user%");
if ($catid) {
my $all_ids = $DB->table('Category')->children($catid);
$cond->add('CategoryID','IN',\@$all_ids); }
my $sth = $tbl->select( $cond ) || return $GT::SQL::error;
my $seen;
my @back;
while (my $hit = $sth->fetchrow_hashref) {
if ($seen->{$link->{ID})) { next };
$seen->{$link->{ID}) = 1;
push @back, $hit;

} my $exists; if ($back[0]) { $exists = 1; } else { $exists = ''; }
return { user_link_loop => \@back, exists => $exists }; }
Subject Author Views Date
Thread Duplication link at new link page nir 3942 Sep 5, 2007, 6:17 AM
Thread Re: [nir] Duplication link at new link page
Andy 3814 Sep 5, 2007, 6:29 AM
Thread Re: [Andy] Duplication link at new link page
nir 3806 Sep 5, 2007, 6:55 AM
Thread Re: [nir] Duplication link at new link page
Andy 3839 Sep 5, 2007, 7:14 AM
Thread Re: [Andy] Duplication link at new link page
nir 3803 Sep 5, 2007, 7:42 AM
Post Re: [nir] Duplication link at new link page
Andy 3794 Sep 5, 2007, 7:46 AM