I seem to get an Internal Server Error wherever I put that additional code. Right now I have:
#!/usr/local/bin/perl
#================================
use strict;
use lib '/var/home/moen/wiredbiz.com/cgi-bin/links/admin';
use Links qw/$DB $IN/;
Links::init('/var/home/moen/wiredbiz.com/cgi-bin/links/admin');
use Links::SiteHTML;
local $SIG{__DIE__} = \&Links::fatal;
main();
sub main {
#---------------------------------------------------
#
my $pageNum = $IN->param('nh') || 1;
# number of links per page
my $linksPP = 10;
my $start = $linksPP*$pageNum - $linksPP;
my ($sth,$tab,$output);
$tab = $DB->table('Links');
$tab->select_options('ORDER BY Title', 'LIMIT ' . $linksPP . ' OFFSET ' . $start);
$sth = $tab->select( { isValidated => 'Yes', isNew => 'Yes' } );
while (my $rec = $sth->fetchrow_hashref) {
$output .= Links::SiteHTML::display('link2', $rec);
}
$rec->{url} = $CFG->{db_cgi_url} . "/featured.cgi";
$rec->{num_hits} = $sth->hits;
$rec->{current_page} = $IN->param('nh');
print $IN->header();
print Links::SiteHTML::display('featured', { output => $output});
}
I also tried the additional code in other places.
Any suggestions?
Code:
#!/usr/local/bin/perl
#================================
use strict;
use lib '/var/home/moen/wiredbiz.com/cgi-bin/links/admin';
use Links qw/$DB $IN/;
Links::init('/var/home/moen/wiredbiz.com/cgi-bin/links/admin');
use Links::SiteHTML;
local $SIG{__DIE__} = \&Links::fatal;
main();
sub main {
#---------------------------------------------------
#
my $pageNum = $IN->param('nh') || 1;
# number of links per page
my $linksPP = 10;
my $start = $linksPP*$pageNum - $linksPP;
my ($sth,$tab,$output);
$tab = $DB->table('Links');
$tab->select_options('ORDER BY Title', 'LIMIT ' . $linksPP . ' OFFSET ' . $start);
$sth = $tab->select( { isValidated => 'Yes', isNew => 'Yes' } );
while (my $rec = $sth->fetchrow_hashref) {
$output .= Links::SiteHTML::display('link2', $rec);
}
$rec->{url} = $CFG->{db_cgi_url} . "/featured.cgi";
$rec->{num_hits} = $sth->hits;
$rec->{current_page} = $IN->param('nh');
print $IN->header();
print Links::SiteHTML::display('featured', { output => $output});
}
I also tried the additional code in other places.
Any suggestions?