Gossamer Forum
Home : Products : Links 2.0 : Customization :

How To Add Category with "&" ampersand Sign

Quote Reply
How To Add Category with "&" ampersand Sign
When I add a new category with "&" ampersand symbol, I got invalid... Please help
Quote Reply
Re: How To Add Category with "&" ampersand Sign In reply to
I've asked my self the same question about two months ago, then spent few hours trying to make it possible, but gave it up.
I guess, it's just UNIX system does not allow you to have this option. May be it's possible on Windows 95/98 servers, but I'm not sure.

Regards,

Pasha

------------------
webmaster@find.virtualave.net
http://find.virtualave.net
Quote Reply
Re: How To Add Category with "&" ampersand Sign In reply to
you can do it. Open nph-build.cgi

In sub build_check_dir, change

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

to

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

------------------
Quote Reply
Re: How To Add Category with "&" ampersand Sign In reply to
After I modified to
---------------------------------
my $chrs = quotemeta ("/_&-");
---------------------------------
I still get this message:

Error: Unable to Add Category
There were problems with the following fields:
Name (Invalid format)
Please fix any errors and submit the record again.




[This message has been edited by sitedex (edited March 10, 1999).]
Quote Reply
Re: How To Add Category with "&" ampersand Sign In reply to
The above solution by CE Globe does not seem to work. Actually the use of a "comma" does not work either.

Does anyone know the answer?

Thanks

[This message has been edited by socrates (edited March 11, 1999).]
Quote Reply
Re: How To Add Category with "&" ampersand Sign In reply to
I would try moving the & to the beginning or escaping it with a "\" or both. It might work. Then again, it might not work. Smile

[This message has been edited by Bobsie (edited March 11, 1999).]
Quote Reply
Re: How To Add Category with "&" ampersand Sign In reply to
Sorry, my bad. Change that to:

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


Put the & after the -

------------------
Quote Reply
Re: How To Add Category with "&" ampersand Sign In reply to
I Cant FINE The LINE YOU said there... I m using Version 1.11

=============
This is what I have
=============

$path .= "/$dir";
&build_check_dir ("$build_root_path$path");
if (! (-e "$build_root_path$path")) {
print "\tMaking Directory ($build_dir_per): '$build_root_path$path' ...";
if (mkdir ("$build_root_path$path", "$build_dir_per")) {;
print "Made. CHMOD $build_dir_per ...";
if (chmod ("$build_dir_per", "$build_root_path$path")) {;
print "Done.";
}
else { print "CHMOD $build_dir_per failed! Reason: $!."; }
}
else { print "mkdir failed! Reason: $!."; }
print "\n";
}
}
return "$build_root_path$path";
============================

I dont see anything about (\_) Somethign like that...

Help me! Thanks

------------------
WebKing
WebKing@trisoft.net
http://www.trisoft.net
My ICQ # 25356171
Quote Reply
Re: How To Add Category with "&" ampersand Sign In reply to
Webking,

It is at the very bottom. Here is the code. I haven't tested it yet, need to try and if it works now.

Thank You, CE GLobe

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;
Quote Reply
Re: How To Add Category with "&" ampersand Sign In reply to
It does not work. Don't bother to change the code.

C'mmon. I have seen plenty of sites who have been able to do this.
Quote Reply
Re: How To Add Category with "&" ampersand Sign In reply to
Alex,
We need your help here.
Quote Reply
Re: How To Add Category with "&" ampersand Sign In reply to
It does work. Just look at links.twelve.net

I made that.

------------------
Quote Reply
Re: How To Add Category with "&" ampersand Sign In reply to
CE Globe,

I know it is working for you. Great site by the way, just like your other site.

Is that (as above) the only change you made? I have tried it several times now, still gives the same error - Name (Invalid format)
Quote Reply
Re: How To Add Category with "&" ampersand Sign In reply to
By the way, GREAT SITE!

humm. What else can I say??

CE Globe : How did you make those Main Categories with BOLD and LARGER TEXT ??

And How DID you eliminate Those words NEW and NUMBER of links on the main page??

Please Show me how thanks

mine is at http://www.trisoft.net/cgi-bin/search/

Thanks again!

------------------
WebKing
WebKing@trisoft.net
http://www.trisoft.net
My ICQ # 25356171
Quote Reply
Re: How To Add Category with "&" ampersand Sign In reply to
IT S NOT WORKING YO!

DELETE THOSE LAST LINES and REPLaCed to yours!

GOT BUNCH OF ERRORS!

What can I DO?? I REPLACED the OLD ONES!

NO MORE Errors w/ the one ones hehehe

Let me ask JOHN MURPHY!
www.yahoosuck.com

HE Has it running

heh later

------------------
WebKing
WebKing@trisoft.net
http://www.trisoft.net
My ICQ # 25356171
Quote Reply
Re: How To Add Category with "&" ampersand Sign In reply to
Pasha, socrates, and WebKing

Here is the solution:

Version: Links 2.0
1. Open Category.def
2. Edit
---------------------------------
Name => [1, 'alpha', 40, 75, 1, '', '^[\w\d/_-]+$'],
---------------------------------
to
---------------------------------
Name => [1, 'alpha', 40, 75, 1, '', '^[\w\d/_&-]+$'],
---------------------------------

3. Edit nph-build.cgi
---------------------------------
my $chrs = quotemeta ("/_-");
---------------------------------
to
---------------------------------
my $chrs = quotemeta ("/_&-");
---------------------------------

Let me know if it still doesn't work.

Sitedex

[This message has been edited by sitedex (edited March 13, 1999).]

[This message has been edited by sitedex (edited March 13, 1999).]
Quote Reply
Re: How To Add Category with "&" ampersand Sign In reply to
Socrates, I think you are right. I guess I just forgot about that.

Webking, to get the category links on the home page to look different, open up site_html.pl and copy sub site_html_print_cat. Make sub site_html_print_cat2

Then simply remove the $numlinks stuff and new stuff, and make it look like you want. Then open up nph-build.cgi and go to sub build_home_page. change:

$category = &site_html_print_cat (@rootcat) if ($#rootcat >= 0);

to

$category = &site_html_print_cat2 (@rootcat) if ($#rootcat >= 0);

------------------
Quote Reply
Re: How To Add Category with "&" ampersand Sign In reply to
OK, it works now. Follow the changes above stated by Sitedex (Thanks Buddy).

Webking,

If you do not want to mess around with the site_html_template.pl for making the front page, without number of links and new and cool icons, then just create a "seperate html page" and name it home.html and link to individual categories and subcategories in the database.

Quote Reply
Re: How To Add Category with "&" ampersand Sign In reply to
WebKing,

To add characters that are allowable for categories under Links v1, see the FAQ at http://www.gossamer-threads.com/...oduct=Links&ww=1 .