Hello,
will chronoforums support cyrillic or our company should move to another forum platform?
1) If you create topic with name: Тестов топик, the url will be: /forum/posts/f1/t1?alias=
If is with name: Test topic, the url will be: /forum/posts/f1/t1/test-topic
2) If you search for word: тест, the search will redirect to forum home page.
If you search for the word: test, results will be displayed.
There is no problem with our site, db or setup. Even here search for cyrillic words do not work.
will chronoforums support cyrillic or our company should move to another forum platform?
1) If you create topic with name: Тестов топик, the url will be: /forum/posts/f1/t1?alias=
If is with name: Test topic, the url will be: /forum/posts/f1/t1/test-topic
2) If you search for word: тест, the search will redirect to forum home page.
If you search for the word: test, results will be displayed.
There is no problem with our site, db or setup. Even here search for cyrillic words do not work.
We did it by ourselves.
Column 24
Replace
to
#28
to
After column #128 replace
With
Now chronoforums owe us couple of coffees.
Have fun.
Column 24
Replace
$string = strtolower(preg_replace('/([a-z])([A-Z])/', '$1_$2', $class));
to
$string = strtolower(preg_replace('/([a-z])([A-Z])([а-я])([А-Я])/', '$1_$2', $class));
#28
public static function clean($str = '', $regex = 'A-Za-z0-9-_ '){
to
public static function clean($str = '', $regex = 'A-Za-zА-Яа-я0-9-_ '){
After column #128 replace
public static function slug($str, $limiter = '-'){
$str = mb_convert_encoding((string)$str, 'UTF-8', mb_list_encodings());
$str = str_replace(array("'", "-", '"'), '', $str);
$str = preg_replace('/[^A-Za-z0-9-]+/', $limiter, $str);;
$str = str_replace($limiter.$limiter, $limiter, $str);
$str = trim($str, $limiter);
return mb_strtolower($str, 'UTF-8');
}
With
public static function slug($str, $limiter = '-'){
$str = mb_convert_encoding((string)$str, 'UTF-8', mb_list_encodings());
$str = str_replace(array("'", "-", '"'), '', $str);
$str = preg_replace('/[^\w_]+/u', '-', $str);
$str = str_replace($limiter.$limiter, $limiter, $str);
$str = preg_replace("/[\s_]/", "-", $str);
$str = trim($str, $limiter);
return mb_strtolower($str, 'UTF-8');
}
Now chronoforums owe us couple of coffees.
Have fun.
Hello.
I have the same problem with the Polish words.
Please help change the code.
Regards, Rafal
I have the same problem with the Polish words.
Please help change the code.
Regards, Rafal
And for ChronoForums V2 what changes of str.php are necessary for support cyrillic?
Hi lolitma,
It should work fine in v2, no changes are needed.
Best regards,
Max
It should work fine in v2, no changes are needed.
Best regards,
Max
In str.php in v2 not code:
public static function slug($str, $limiter = '-'){
$str = mb_convert_encoding((string)$str, 'UTF-8', mb_list_encodings());
$str = str_replace(array("'", "-", '"'), '', $str);
$str = preg_replace('/[^A-Za-z0-9-]+/', $limiter, $str);;
$str = str_replace($limiter.$limiter, $limiter, $str);
$str = trim($str, $limiter);
return mb_strtolower($str, 'UTF-8');
}
There is other code:
public static function slug($str, $limiter = '-', $unicode = false){
$pattern = $unicode ? '/[^\pL\pN-]+/u' : '/[^\w_]+/u';
$str = mb_convert_encoding((string)$str, 'UTF-8', mb_list_encodings());
$str = str_replace(array("'", '"'), '', $str);
$str = preg_replace($pattern, $limiter, $str);
$str = preg_replace('/['.$limiter.']+/', $limiter, $str);
$str = str_replace($limiter.$limiter, $limiter, $str);
$pattern = $unicode ? "/[^\pL\pN-]+/u" : "/[\s_]/";
$str = trim($str, $limiter);
return mb_strtolower($str, 'UTF-8');
}
How to replace this code?
public static function slug($str, $limiter = '-'){
$str = mb_convert_encoding((string)$str, 'UTF-8', mb_list_encodings());
$str = str_replace(array("'", "-", '"'), '', $str);
$str = preg_replace('/[^A-Za-z0-9-]+/', $limiter, $str);;
$str = str_replace($limiter.$limiter, $limiter, $str);
$str = trim($str, $limiter);
return mb_strtolower($str, 'UTF-8');
}
There is other code:
public static function slug($str, $limiter = '-', $unicode = false){
$pattern = $unicode ? '/[^\pL\pN-]+/u' : '/[^\w_]+/u';
$str = mb_convert_encoding((string)$str, 'UTF-8', mb_list_encodings());
$str = str_replace(array("'", '"'), '', $str);
$str = preg_replace($pattern, $limiter, $str);
$str = preg_replace('/['.$limiter.']+/', $limiter, $str);
$str = str_replace($limiter.$limiter, $limiter, $str);
$pattern = $unicode ? "/[^\pL\pN-]+/u" : "/[\s_]/";
$str = trim($str, $limiter);
return mb_strtolower($str, 'UTF-8');
}
How to replace this code?
Hi lolitma,
Do you have the problem described by the original poster on v2 ? because its already fixed in v2
Best regards,
Max
Do you have the problem described by the original poster on v2 ? because its already fixed in v2
Best regards,
Max
This topic is locked and no more replies can be posted.
