24 lines
693 B
Perl
24 lines
693 B
Perl
sub {
|
|
my $related = shift || return;
|
|
my @ids = split ("\n",$related);
|
|
my @loop;
|
|
my $db = $DB->table('Links');
|
|
|
|
my $tags = GT::Template->tags;
|
|
my $id = $tags->{ID};
|
|
my $cond = GT::SQL::Condition->new('RelatedArticles','like',$id . "\n%");
|
|
$cond->add('RelatedArticles','like', "%\n" . $id . "\n%");
|
|
$cond->add('RelatedArticles','like', "\n" . $id);
|
|
use Data::Dumper;
|
|
print Dumper($cond);
|
|
#my $sth = $db->select($cond);
|
|
|
|
require Links::SiteHTML;
|
|
foreach my $id (@ids) {
|
|
my $link = $db->get($id);
|
|
$link = Links::SiteHTML::tags('link',$link);
|
|
push @loop, $link;
|
|
}
|
|
return { related_articles_loop => \@loop };
|
|
}
|