I am trying to implement the Subcat mod by Glennu found at http://cgi-resource.co.uk/pages/subcat.shtml and discussed in various posts herein.
I must be misunderstanding what is required.
I have added the code as I understood but when I attempt to do a build the file nph-build.cgi attempts to download.
When I open the file the following error message is written:
Error including libraries: Unrecognized character \x93 at /usr/www/users/username/itjc/cgi-bin/admin/site_html_templates.pl line 388.
Compilation failed in require at /usr/www/users/username/links/cgi-bin/admin/nph-build.cgi line 40.
Make sure they exist, permissions are set properly, and paths are set correctly.
The line in question contains the following:
$sub = “”;
which is the first line of the code that is supposed to be added.
My code looks like this:
foreach $subcat (sort @subcat) {
($description) = @{$category{$subcat}}[2];
$sub = “”;
open (DB, "<$db_category_name") or &cgierr("unable to open database: $db_category_name. Reason: $!");
LINE: while (<DB>) {
/^#/ and next LINE; # Skip comment Lines.
/^\s*$/ and next LINE; # Skip blank lines.
chomp;
@values = &split_decode ($_);
$name{$values[0]} = $values[1];
}
close DB;
foreach $values (sort {$name{$a} <=> $name{$b}} keys %name) {
if ($name{$values} =~ m,^$subcat/([^/]+)$,) {
if ($name{$values} =~ m,.*/([^/]+)$,) { $nam{$values} = &build_clean($1); } else { $nam{$values} = &build_clean($subcat); }
$sub .= "<a href =$name{$values}>($nam{$values}) </a>\n";
}
}
So have I added the code incorrectly? I assume that "add" meant to simply add the code after the lines or did it mean to replace it or ...?
Any help appreciated.
Richard
"Be practical, expect miracles." - James T. McCay
I must be misunderstanding what is required.
I have added the code as I understood but when I attempt to do a build the file nph-build.cgi attempts to download.
When I open the file the following error message is written:
Error including libraries: Unrecognized character \x93 at /usr/www/users/username/itjc/cgi-bin/admin/site_html_templates.pl line 388.
Compilation failed in require at /usr/www/users/username/links/cgi-bin/admin/nph-build.cgi line 40.
Make sure they exist, permissions are set properly, and paths are set correctly.
The line in question contains the following:
$sub = “”;
which is the first line of the code that is supposed to be added.
My code looks like this:
foreach $subcat (sort @subcat) {
($description) = @{$category{$subcat}}[2];
$sub = “”;
open (DB, "<$db_category_name") or &cgierr("unable to open database: $db_category_name. Reason: $!");
LINE: while (<DB>) {
/^#/ and next LINE; # Skip comment Lines.
/^\s*$/ and next LINE; # Skip blank lines.
chomp;
@values = &split_decode ($_);
$name{$values[0]} = $values[1];
}
close DB;
foreach $values (sort {$name{$a} <=> $name{$b}} keys %name) {
if ($name{$values} =~ m,^$subcat/([^/]+)$,) {
if ($name{$values} =~ m,.*/([^/]+)$,) { $nam{$values} = &build_clean($1); } else { $nam{$values} = &build_clean($subcat); }
$sub .= "<a href =$name{$values}>($nam{$values}) </a>\n";
}
}
So have I added the code incorrectly? I assume that "add" meant to simply add the code after the lines or did it mean to replace it or ...?
Any help appreciated.
Richard
"Be practical, expect miracles." - James T. McCay