You are here:  » Foreign accents and categories mapping

Support Forum



Foreign accents and categories mapping

Submitted by pat on Fri, 2007-06-01 16:22 in

Hi David

What can i do to create a category mapping with accent?

Example: I can't enter:

pâtes
légumes
etc...

The accentued letters is not recognized by the script.

Thanks

Pat

Submitted by support on Fri, 2007-06-01 16:56

Hi Pat,

The code to prevent you from entering those characters is the following block, beginning on line 16 of admin/categories.php

      if(!ereg("^[0-9a-zA-Z\. ]{0,255}$",widget_posted($_POST["name"])))
      {
        widget_errorSet("name","category name contains invalid characters");
      }

If you remove (or comment out) this section of code you will then be able to setup mapped categories containing those letters...

Cheers,
David.

Submitted by mediadream on Mon, 2008-11-10 16:48

I have tried this but still i get this error

"New Category
Name:
• category name contains invalid characters"

www.internetsidorna.se

Submitted by support on Tue, 2008-11-11 09:47

Hi,

That's strange. If you would like to email me your modified admin/categories.php i'll take a look for you...

Cheers,
David.

Submitted by stevencrocker on Sun, 2009-03-29 04:04

I have this same issue and the fix suggested in categories.php works great.

The problem is once the category is created (in my case with a "-" ) When you are browsing categories and click on any of them containing this character the search box removes the character " - " in my case - and therefore there are no results.

The same issue exists when you type category:SAMPLE-CATEGORY into the search box - no results are returned and the updated search box now contains category:SAMPLE CATEGORY (without the " - " )

I am sure there is probably something that also needs to be modified within search to allow these characters as well. Can you please instruct me on what needs to be modified?

Thank You.

Submitted by support on Sun, 2009-03-29 08:22

Hi Steven,

The replacement from "-" to " " is done by the tapestry_normalise() function in includes/tapestry.php (line 20) - however this is an important part of creating search engine friendly URLs if you are using $config_useRewrite - in which case I would advise against permitting "-". If you're not using this, rather than edit the above file, I would remove the call to tapestry_normalise() in search.php. To do this, look for the following code on line 4:

$q = (isset($_GET["q"])?tapestry_normalise($_GET["q"],":\."):"");

...and REPLACE this with:

$q = (isset($_GET["q"])?$_GET["q"]:"");

Cheers,
David.

Submitted by stevencrocker on Sun, 2009-03-29 15:45

David,

Thanks again for the quick reply.

What would I need to change includes/tapestry.php (line 20) to read?

I have tried commenting it out to no avail (it removed all spacing) and replacing it to

$text = str_replace("-","-",$text);

neither worked.

As far as URLs are concerned I thought that "-"" was considered URL friendly?

I am using $config_useRewrite which is why I am trying to change this in here.

Some of my category names consist of hyphenated words and therefore it looks strange for me to not hyphenate.

Thanks Again.

Steven

Submitted by support on Sun, 2009-03-29 15:53

Hi Steven,

Could you perhaps email me a couple of example pages that demonstrate the problem - and also your existing search.php, categories.php and includes/tapestry.php and i'll check it out for you...!

Cheers,
David.

Submitted by support on Sun, 2009-03-29 15:58

Hi again,

My apologies - I misread the earlier post so some of the information I gave was not relevant - and i've also updated the list of files that I'll need to check it out...

Cheers,
David.