Webmastersite.net
Register Log In

illegal characters ?

Comments on illegal characters ?

corbin
Experienced

Usergroup: Customer
Joined: Oct 21, 2003

Total Topics: 21
Total Comments: 53
corbin
Posted Jun 16, 2005 - 10:24 AM:

hello,

In misc/generate HTML it's indicated that "This requires that none of your category names contain characters which are illegal in a directory name";
i turned the "activate" and "use subdirectories ..." to "yes".
As i am french writing, i have to use "É" (& E acute ; ) beginning some categories title.
As i was confirming a modification of a link present in a category of this type, i saw a page informing me with a lot of "warning ..." and no modification has been done.

then i turned to "no" these two "activate" and "use ..." ...
and it works

so my question is : is it possible using my french (and i presume german, swedish and so on) accentuation with the "Automatically Update HTML Version" ?

thank you

CC
Paul
developer

Usergroup: Administrator
Joined: Dec 20, 2001
Location: Diamond Springs, California

Total Topics: 61
Total Comments: 7867
Paul
Posted Jun 16, 2005 - 9:28 PM:

You'll need to figure out all the illegal characters and list them. Currently the function is this:



function removespecialchars($stuff, $static = 'no')

{

// get these out from static page directory names: ~!@#$%^&*()_+<>?|,./\;':"[]{}

global $settings;

$stuff = str_replace(' ', $settings->rewritecategoryspace, $stuff);

$stuff = str_replace('~', '', $stuff);

$stuff = str_replace('!', '', $stuff);

$stuff = str_replace('@', '', $stuff);

$stuff = str_replace('#', '', $stuff);

$stuff = str_replace('$', '', $stuff);

$stuff = str_replace('%', '', $stuff);

$stuff = str_replace('^', '', $stuff);

$stuff = str_replace('&', '', $stuff);

$stuff = str_replace('*', '', $stuff);

$stuff = str_replace('(', '', $stuff);

$stuff = str_replace(')', '', $stuff);

$stuff = str_replace('+', '', $stuff);

$stuff = str_replace('<', '', $stuff);

$stuff = str_replace('>', '', $stuff);

$stuff = str_replace('?', '', $stuff);

$stuff = str_replace('/', '', $stuff);

$stuff = str_replace('\\', '', $stuff);

$stuff = str_replace('|', '', $stuff);

$stuff = str_replace(',', '', $stuff);

$stuff = str_replace('.', '', $stuff);

$stuff = str_replace(';', '', $stuff);

$stuff = str_replace("'", '', $stuff);

$stuff = str_replace(':', '', $stuff);

$stuff = str_replace('"', '', $stuff);

$stuff = str_replace('[', '', $stuff);

$stuff = str_replace(']', '', $stuff);

$stuff = str_replace('{', '', $stuff);

$stuff = str_replace('}', '', $stuff);

return $stuff;

}
(in commonfuncs.php)
corbin
Experienced

Usergroup: Customer
Joined: Oct 21, 2003

Total Topics: 21
Total Comments: 53
corbin
Posted Jun 22, 2005 - 9:06 AM:

Thank you (twice today wink )
AlexKats


Usergroup: Customer
Joined: Apr 15, 2005
Location: Russia

Total Topics: 3
Total Comments: 10
Posted Jun 23, 2005 - 10:21 AM:

And how to make replacement that the name of a category was on russian, and each letter was replaced the latin letter in a line of the address, for example the name of a category "Ñòðàíà" - adress "somesite.ru/strana" ... If it is possible
Paul
developer

Usergroup: Administrator
Joined: Dec 20, 2001
Location: Diamond Springs, California

Total Topics: 61
Total Comments: 7867
Paul
Posted Jun 23, 2005 - 6:16 PM:

Can you find a function somewhere on the internet that translates the cyrillic characters to roman ones?
AlexKats


Usergroup: Customer
Joined: Apr 15, 2005
Location: Russia

Total Topics: 3
Total Comments: 10
Posted Jun 23, 2005 - 11:24 PM:

Equality of symbols can be looked here http://translit.ru/2.php .... function, may be search, only it is necessary for a few time
AlexKats


Usergroup: Customer
Joined: Apr 15, 2005
Location: Russia

Total Topics: 3
Total Comments: 10
Posted Jun 26, 2005 - 12:39 PM:

This that that is necessary?

function ru2Lat($string)
{
$rus = array('¸','æ','ö','÷','ø','ù','þ','ÿ','¨','Æ','Ö','×','Ø','Ù','Þ','ß','Ü','ü','Ú','ú');
$lat = array('jo','zh','c','ch','sh','shh','ju','ja','JO','ZH','C','CH','SH','SHH','JU','JA','','','','');
$string = str_replace($rus,$lat,$string);
$string = strtr($string," ÀÁÂÃÄÅÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÚÛÜÝàáâãäåçèéêëìíîïðñòóôõúûüý"," ABVGDEZIJKLMNOPRSTUFH'I'Eabvgdezijklmnoprstufh'y'e");
return($string);
}
Paul
developer

Usergroup: Administrator
Joined: Dec 20, 2001
Location: Diamond Springs, California

Total Topics: 61
Total Comments: 7867
Paul
Posted Jun 27, 2005 - 1:36 AM:

Well, place that function in commonfuncs.php and then edit the function I listed above so that it starts with
function removespecialchars($stuff, $static = 'no') 
{
$stuff = ru2Lat($stuff);


Then tell me if it does what you want. If it does, I'll make it standard.

Search thread for
Download thread as
  • 0/5
  • 1
  • 2
  • 3
  • 4
  • 5



This thread is closed, so you cannot post a reply.