Gossamer Forum
Home : Products : Links 2.0 : Discussions :

Links 2 question

Quote Reply
Links 2 question
Stupid question I can't find anywhere.

I originally went with megalinks because of the problem with not allowing commas in the category.

Can you have commas in the category name in Links 2? Ie:

Schwarzenegger, Arnold

Thanks. Smile
Quote Reply
Re: Links 2 question In reply to
Doesn't look like you can, I tried it and it tells me invalid name format, of course you could simply do swartzenegger-Arnold. I know it doesn't look as nice, but it does work.
Quote Reply
Re: Links 2 question In reply to
Bobsie,

Could you do the same for "&"? (I realize the ? should go inside the "", but that would be really confusing Smile )

Thanks,
Dan
Quote Reply
Re: Links 2 question In reply to
 
Quote:
Can you have commas in the category name in Links 2? Ie:
Schwarzenegger, Arnold

In the default version of Links, the comma is not allowed for a category because the category name is also used to create a directory. However, you can modify the script to allow it.

Interestingly enough, Windows95 has no problem with either the comma or the space and is quite happy to create a directory called "Schwarzenegger, Arnold". Unix, on the other hand, has problems only with the space. If you type:

Quote:
mkdir Schwarzenegger, Arnold

You end up with two directories, one for "Schwarzenegger," and one for "Arnold". So you would have to use the underline character for the space as in:

Quote:
Schwarzenegger,_Arnold

But Links does display the category names without the underline (it is converted back to a space), so that is not a problem.

There are two things that must be changed in Links v2 to allow the comma to be used in a category (directory) name.

1. category.def. Change:

Quote:
Name => [1, 'alpha', 40, 75, 1, '', '^[\w\d/_-]+$'],

to read:

Quote:
Name => [1, 'alpha', 40, 75, 1, '', '^[\w\d/_-,]+$'],

2. nph-build.cgi, sub build_check_dir:

Change:

Quote:
my $chrs = quotemeta ("/_-");

to read:

Quote:
my $chrs = quotemeta ("/_-,");

I hope this helps.
Quote Reply
Re: Links 2 question In reply to
Dan, not only can you do it, others have already done it.

The best way to find out, it give it a go. But, there is a caveat... I have seen reports that it kinda messes up the search somehow. I don't remember the specifics. It was something about "&" being interpreted by search.cgi incorrectly.
Quote Reply
Re: Links 2 question In reply to
Bobsie,

That's precisely why I hadn't yet tried it. Wink I was worried about such a caveat. Since it's not overly important to make the change, I think I'll avoid risking errors. Thanks.

Dan