WebmasterSite.net: PHP scripts to enable your creativity
WSN Links PHP Directory Software
PHP Scripts Webmaster Links Support Forums

Register | Forgot Password

illegal characters ?

Version:
printPrint


illegal characters ?
corbin
Experienced

Usergroup: Customer
Joined: Oct 21, 2003
Total Topics: 18
Total Posts: 53
Posted 06/16/05 - 07:24 AM:
quote post
#1
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
Administrator
Avatar

Usergroup: Administrator
Joined: Dec 21, 2001
Location: Northern California
Total Topics: 57
Total Posts: 6316
Posted 06/16/05 - 06:28 PM:
quote post
#2
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)

"Do things you love doing, because then it ain't work. Don't do something you don't really enjoy, because you're never going to work hard enough at it." - Bob Young, founder of Red Hat
corbin
Experienced

Usergroup: Customer
Joined: Oct 21, 2003
Total Topics: 18
Total Posts: 53
Posted 06/22/05 - 06:06 AM:
quote post
#3
Thank you (twice today wink )
AlexKats


Usergroup: Customer
Joined: Apr 15, 2005
Location: Russia
Total Topics: 3
Total Posts: 10
Posted 06/23/05 - 07:21 AM:
quote post
#4
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

Edited by AlexKats on 06/23/05 - 07:24 AM
Paul
Administrator
Avatar

Usergroup: Administrator
Joined: Dec 21, 2001
Location: Northern California
Total Topics: 57
Total Posts: 6316
Posted 06/23/05 - 03:16 PM:
quote post
#5
Can you find a function somewhere on the internet that translates the cyrillic characters to roman ones?

"Do things you love doing, because then it ain't work. Don't do something you don't really enjoy, because you're never going to work hard enough at it." - Bob Young, founder of Red Hat
AlexKats


Usergroup: Customer
Joined: Apr 15, 2005
Location: Russia
Total Topics: 3
Total Posts: 10
Posted 06/23/05 - 08:24 PM:
quote post
#6
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 Posts: 10
Posted 06/26/05 - 09:39 AM:
quote post
#7
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
Administrator
Avatar

Usergroup: Administrator
Joined: Dec 21, 2001
Location: Northern California
Total Topics: 57
Total Posts: 6316
Posted 06/26/05 - 10:36 PM:
quote post
#8
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.


"Do things you love doing, because then it ain't work. Don't do something you don't really enjoy, because you're never going to work hard enough at it." - Bob Young, founder of Red Hat
Search thread for
Download thread as


You don't have permission to post.

Please login or register.

   
 
© 2008 Paul Knierim. All rights reserved.