Gossamer Forum
Home : Products : Links 2.0 : Installation -- Unix :

Error > Top: : category

Quote Reply
Error > Top: : category
Hi again:

Whats its the error in template?
Variable:
<h3><%title_linked%></h3>

Result:
Top::software

the correct thing is:
Top:music:software

that it happens?

Thanks for all.
Quote Reply
Re: Error > Top: : category In reply to
Have you made any changes to the sub build_title_linked routine in the nph-build.cgi file?

Regards,

------------------
Eliot Lee....
* Check Resource Center
* Search Forums

Quote Reply
Re: Error > Top: : category In reply to
Hi, thanks for your reply
The only modification is the nonenglish mod

This is the routine that I have in nph-build


sub build_linked_title {
# --------------------------------------------------------
# Returns a string of the current category broken up
# by section, with each part linked to the respective section.

my $input = shift;
my (@dirs, $dir, $output, $path, $last);

@dirs = split (/\//, $input);
$last = &build_clean(pop @dirs);

$output = qq| <A HREF="$build_root_url/">Top</A> :|;
foreach $dir (@dirs) {
$path .= "/$dir";
$dir = &build_clean ($dir);
$output .= qq| <A HREF="$build_root_url$path/">$dir</A> :|;
}
$output .= " $last";

return $output;
}


Please, i need help in this problem.
Thanks
Gracias miles.
Quote Reply
Re: Error > Top: : category In reply to
Hi ppl! I have the same problem. I have installed a mode for non-english Category Names (that I found in this Forum) and made changes in my nph.buil.cgi file as below. After that I have the result Top::Subcategory instead of Top:Category:Subcategory. What can be the problem? I tried to find the answer in Forum but couldn't find it anywhere. Please help.

sub build_linked_title {
# --------------------------------------------------------
# Returns a string of the current category broken up
# by section, with each part linked to the respective section.

my $input = shift;
my (@dirs, $dir, $output, $path, $last);

@dirs = split (/\//, $input);
$last = &build_clean(pop @dirs);

$output = qq| <A HREF="$build_root_url/">Top</A> :|;
foreach $dir (@dirs) {
$path .= "/$dir";
$dir = &build_clean ($dir);
$output .= qq| <A HREF="$build_root_url$path/">$dir</A> :|;
}
$output .= " $last";

return $output;
}

sub build_unlinked_title {
# --------------------------------------------------------
# Returns a string of the current category broken up by section.
# Useful for printing in the title.

my $input = shift;
my (@dirs, $dir, $output);

@dirs = split (/\//, $input);

foreach $dir (@dirs) {
$dir = &build_clean ($dir);
$output .= " $dir:";
}
chop ($output);
return $output;
}

# ***************************************** nonenglish modification - begin ****************
sub build_clean_mb {
# --------------------------------------------------------
my ($input) = $_[0];
$input =~ s,\\, : ,g;
return $input;
}

sub build_last_title_mb {
# --------------------------------------------------------
my ($input) = $_[0];
my (@descs, $output);

@descs = split (/\\/, $input);
$output = pop (@descs);

return $output;
}

sub build_linked_title_mb {
# --------------------------------------------------------
# Returns a string of the current category broken up
# by section, with each part linked to the respective section.

my ($input) = $_[0];
my ($description) = $_[1];
my (@dirs, $dir, $output, $path, $last, @descs, $desc);

@dirs = split (/\//, $input);
@descs = split (/\\/, $description);
$last = pop (@dirs);
$last = pop (@descs);

$output = qq| <A HREF="$build_root_url/">Top</A> :|;
foreach $dir (@dirs) {
$path .= "/$dir";
$desc = shift (@descs);
$output .= qq| <A HREF="$build_root_url$path/">$desc</A> :|;
}
$output .= " $last";

return $output;
}

sub kategorie_title_mb {
# --------------------------------------------------------
my ($input, $output, $title, $kategorie, @fields);

$input = $_[0];
$title = "";

KATEGORIE: foreach $kategorie (@kategorien) {
if ($kategorie =~ /^#/) { next KATEGORIE; } # Skip comment lines.
chomp ($kategorie);
@fields = &split_decode ($kategorie);
if ($fields[1] eq $input) {
$title = $fields[8];
last KATEGORIE;
}
}
if ($title eq "") {
$output = &build_clean ($input);
}
else {
$output = &build_clean_mb ($title);
}

return $output;
}
# ***************************************** nonenglish modification - end ******************

sub build_check_dir {
# --------------------------------------------------------
# Checks the directory before we create it to make sure there
# are no funncy characters in it.

my ($root, $dir) = @_;
my $chrs = quotemeta ("/_-");

if (! -e $root) {
&cgierr ("Root directory: $root does not exist!");
}
if ($dir !~ m,^[\w\d$chrs]+$,) {
&cgierr ("Invalid characters in category name: $dir. Must contain only letters, numbers, _, / and -.");
}
return $input;
}

1;