I'm using the following global to pull links from another GLinks installation where the data is held in the same table.
sub {
my $db = GT::SQL->new('/mysite/cgi-bin/admin/defs');
my $tbl = $db->table('links1');
my ($output,$sth,$feature);
my $search_db = $db->table('Links');
$search_db->select_options ('ORDER BY Add_Date DESC');
$sth = $search_db->select ( { isFeature => 'Yes'});
while ($feature= $sth->fetchrow_hashref) {
$feature->{'detailed_url'} = "$CFG->{build_detail_url}/$feature->{'ID'}$CFG->{build_extension}";
$output .= Links::SiteHTML::display ('feature', $feature);
}
return $output;
}
I've copied the links2 def file and labelled it links1_links2.def The global is finding the .def file
I add the tag <%altlinks%> to the rightside template.
I copy the 'feature.html' template.
This code works fine in installations on the same server but will not work on different servers.
Can anyone see where I've gone wrong?
Thanks.
Quote:
Global: altlinks sub {
my $db = GT::SQL->new('/mysite/cgi-bin/admin/defs');
my $tbl = $db->table('links1');
my ($output,$sth,$feature);
my $search_db = $db->table('Links');
$search_db->select_options ('ORDER BY Add_Date DESC');
$sth = $search_db->select ( { isFeature => 'Yes'});
while ($feature= $sth->fetchrow_hashref) {
$feature->{'detailed_url'} = "$CFG->{build_detail_url}/$feature->{'ID'}$CFG->{build_extension}";
$output .= Links::SiteHTML::display ('feature', $feature);
}
return $output;
}
I've copied the links2 def file and labelled it links1_links2.def The global is finding the .def file
I add the tag <%altlinks%> to the rightside template.
I copy the 'feature.html' template.
This code works fine in installations on the same server but will not work on different servers.
Can anyone see where I've gone wrong?
Thanks.