Forums

Chronoforums DO NOT support cyrillic?

g2005570 02 Sep, 2016
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.
g2005570 04 Sep, 2016
The error is somewhere in libraries\cegcore\libs\str.php
g2005570 04 Sep, 2016
1 Likes
We did it by ourselves.
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.
ibmthinkpad 25 Nov, 2016
Hello.
I have the same problem with the Polish words.
Please help change the code.
Regards, Rafal
lolitma 09 Mar, 2017
And for ChronoForums V2 what changes of str.php are necessary for support cyrillic?
Max_admin 09 Mar, 2017
Hi lolitma,

It should work fine in v2, no changes are needed.

Best regards,
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
lolitma 09 Mar, 2017
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?
Max_admin 10 Mar, 2017
Hi lolitma,

Do you have the problem described by the original poster on v2 ? because its already fixed in v2

Best regards,
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
This topic is locked and no more replies can be posted.