Hi Guys,
I am very new to SQL Links, i have recently purchased a pluggin for it - Recip_Link pluggin. I have posted the question to the Author of the pluggin but he doesn't seem to reply.
Anyway my problem is this:
http://www.adventuretraveltips.com/cgi-bin/add.cgi
When a user submits his link information and recieves an error, he is then redirected back to the add.cgi but now the categories are missing in the select field. Anyone has any ideas on how to fix this?
Edit:
I looked through the plugging a bit and i think this is the code that causes the error:
# show an error if the page could not be reached...
my $_cat = _category_list();
print Links::SiteHTML::display('add', { Category => $_cat, error => Links::language ('CHECK_SITE_UNAVAILABLE')});
exit;
} sub _category_list {
# -------------------------------------------------------------------
# Return a list of all the categories.
#
my $category;
if ($CFG->{db_gen_category_list}) {
my $db = $DB->table('Links');
my $html = $DB->html($db, $IN);
my @ids = $IN->param('CatLinks.CategoryID') || $IN->param('ID');
if ($#ids < 1) { $ids[0] = $IN->param('ID'); }
$category = $html->get_all_categories(\@ids, 'CatLinks.CategoryID', 1);
}
else {
my $db = $DB->table('Category');
my $id = $IN->param('CatLinks.CategoryID') || $IN->param('ID');
my $sth = $db->select ( { ID => $id }, ['Full_Name'] );
my ($name) = $sth->fetchrow_array();
if ($name) {
$category = "$name <input type=hidden name='CatLinks.CategoryID' value='$id'>";
}
else {
return;
}
}
return $category;
}
Regards,
ps
I am very new to SQL Links, i have recently purchased a pluggin for it - Recip_Link pluggin. I have posted the question to the Author of the pluggin but he doesn't seem to reply.
Anyway my problem is this:
http://www.adventuretraveltips.com/cgi-bin/add.cgi
When a user submits his link information and recieves an error, he is then redirected back to the add.cgi but now the categories are missing in the select field. Anyone has any ideas on how to fix this?
Edit:
I looked through the plugging a bit and i think this is the code that causes the error:
Code:
if (!$page[0]) { # show an error if the page could not be reached...
my $_cat = _category_list();
print Links::SiteHTML::display('add', { Category => $_cat, error => Links::language ('CHECK_SITE_UNAVAILABLE')});
exit;
} sub _category_list {
# -------------------------------------------------------------------
# Return a list of all the categories.
#
my $category;
if ($CFG->{db_gen_category_list}) {
my $db = $DB->table('Links');
my $html = $DB->html($db, $IN);
my @ids = $IN->param('CatLinks.CategoryID') || $IN->param('ID');
if ($#ids < 1) { $ids[0] = $IN->param('ID'); }
$category = $html->get_all_categories(\@ids, 'CatLinks.CategoryID', 1);
}
else {
my $db = $DB->table('Category');
my $id = $IN->param('CatLinks.CategoryID') || $IN->param('ID');
my $sth = $db->select ( { ID => $id }, ['Full_Name'] );
my ($name) = $sth->fetchrow_array();
if ($name) {
$category = "$name <input type=hidden name='CatLinks.CategoryID' value='$id'>";
}
else {
return;
}
}
return $category;
}
Regards,
ps