Indeed, that is a good suggestion. See also http://www.cmsimple-xh.org/wiki/doku.ph ... te_content.Maxim wrote:Proposes changes to the .htaccess file. URLs without www.
Clean URLs
Re: Clean URLs
Christoph M. Becker – Plugins for CMSimple_XH
У меня уже очень большие Uri
[ external image ] Здравствуйте.
У меня уже очень большие Uri ("new" и "org"):
Хочу убрать большие буквы, а маленькие оставить и чтобы в адресе были только маленькие буквы.
Не всем это может понравится, поэтому хочется в настройках иметь возможность выбора:
Ich habe bereits eine sehr große Uri ("new" und "org"):
Möchte entfernen großen Buchstaben, und die kleinen verlassen, um in die Adresse, waren nur kleine Buchstaben.
Nicht alle mögen, deshalb möchte ich in den Einstellungen die Möglichkeit der Wahl:
I have a very large Uri ("new" and "org"):
I want to remove large letters, and small to leave and to address were only small letters.
Not everyone is going to like, so you want the settings to have a choice:
У меня уже очень большие Uri ("new" и "org"):
Code: Select all
$tx['urichar']['new']="a|b|c|d|e|f|g|h|i|j|k|l|m|n|o|p|q|r|s|t|u|v|w|x|y|z|a|b|v|g|d|e|yo|zh|z|i|i|i|y|y|k|l|m|n|o|p|r|s|t|u|f|h|c|ch|sh|sch|y|e|yu|ya|a|b|v|g|d|e|yo|zh|z|i|i|i|y|y|k|l|m|n|o|p|r|s|t|u|f|h|c|ch|sh|sch|y|e|yu|ya|and";
$tx['urichar']['org']="A|B|C|D|E|F|G|H|I|J|K|L|M|N|O|P|Q|R|S|T|U|V|W|X|Y|Z|А|Б|В|Г|Д|Е|Ё|Ж|З|І|Ї|И|Ы|Й|К|Л|М|Н|О|П|Р|С|Т|У|Ф|Х|Ц|Ч|Ш|Щ|Ы|Э|Ю|Я|а|б|в|г|д|е|ё|ж|з|і|ї|и|ы|й|к|л|м|н|о|п|р|с|т|у|ф|х|ц|ч|ш|щ|ы|э|ю|я|&|№|+| –| -|Ъ|Ь|ъ|ь|\"|(|)|,|.";
Не всем это может понравится, поэтому хочется в настройках иметь возможность выбора:
- Только маленькие буквы (строчные)
- Большие и маленькие (ПРОПИСНЫЕ и строчные)
Ich habe bereits eine sehr große Uri ("new" und "org"):
Code: Select all
$tx['urichar']['new']="a|b|c|d|e|f|g|h|i|j|k|l|m|n|o|p|q|r|s|t|u|v|w|x|y|z|a|b|v|g|d|e|yo|zh|z|i|i|i|y|y|k|l|m|n|o|p|r|s|t|u|f|h|c|ch|sh|sch|y|e|yu|ya|a|b|v|g|d|e|yo|zh|z|i|i|i|y|y|k|l|m|n|o|p|r|s|t|u|f|h|c|ch|sh|sch|y|e|yu|ya|and";
$tx['urichar']['org']="A|B|C|D|E|F|G|H|I|J|K|L|M|N|O|P|Q|R|S|T|U|V|W|X|Y|Z|А|Б|В|Г|Д|Е|Ё|Ж|З|І|Ї|И|Ы|Й|К|Л|М|Н|О|П|Р|С|Т|У|Ф|Х|Ц|Ч|Ш|Щ|Ы|Э|Ю|Я|а|б|в|г|д|е|ё|ж|з|і|ї|и|ы|й|к|л|м|н|о|п|р|с|т|у|ф|х|ц|ч|ш|щ|ы|э|ю|я|&|№|+| –| -|Ъ|Ь|ъ|ь|\"|(|)|,|.";
Nicht alle mögen, deshalb möchte ich in den Einstellungen die Möglichkeit der Wahl:
- Nur kleine Buchstaben (groß -)
- Große und kleine (GROß-und Kleinschreibung)
I have a very large Uri ("new" and "org"):
Code: Select all
$tx['urichar']['new']="a|b|c|d|e|f|g|h|i|j|k|l|m|n|o|p|q|r|s|t|u|v|w|x|y|z|a|b|v|g|d|e|yo|zh|z|i|i|i|y|y|k|l|m|n|o|p|r|s|t|u|f|h|c|ch|sh|sch|y|e|yu|ya|a|b|v|g|d|e|yo|zh|z|i|i|i|y|y|k|l|m|n|o|p|r|s|t|u|f|h|c|ch|sh|sch|y|e|yu|ya|and";
$tx['urichar']['org']="A|B|C|D|E|F|G|H|I|J|K|L|M|N|O|P|Q|R|S|T|U|V|W|X|Y|Z|А|Б|В|Г|Д|Е|Ё|Ж|З|І|Ї|И|Ы|Й|К|Л|М|Н|О|П|Р|С|Т|У|Ф|Х|Ц|Ч|Ш|Щ|Ы|Э|Ю|Я|а|б|в|г|д|е|ё|ж|з|і|ї|и|ы|й|к|л|м|н|о|п|р|с|т|у|ф|х|ц|ч|ш|щ|ы|э|ю|я|&|№|+| –| -|Ъ|Ь|ъ|ь|\"|(|)|,|.";-|Y|E|b|e|\"|(|)|,|.";
Not everyone is going to like, so you want the settings to have a choice:
- Only small letters (lowercase)
- Large and small (UPPERCASE and lowercase)
Simple Hosting
Бедная, бросаемая бурею, безутешная!
Бедная, бросаемая бурею, безутешная!
Re: Clean URLs
Indeed, that is very large! Long time ago I have presented a small add-on, which should handle many of the urichar_org/new possibilities automatically for languages using Roman characters, but unfortunately not for languages using Cyrillic characters (as well as others).Maxim wrote:У меня уже очень большие Uri ("new" и "org"):
[ code ]
So, as I already noted in the other thread, there is the need for a better transliteration function/library. iconv() offers a //TRANSLIT option, but that doesn't seem to work as expected ('ä' => 'a'). Since version 5.4 PHP offers a Transliteration class, but this is not well documented, and I don't know how to use it. However, now I have found https://github.com/jbroadway/urlify, which seems to do the job. I will update the recipe in the other thread as soon as possible.
Find function XH_uenc() in cmsimple/functions.php and it replace it with the following:Maxim wrote:Не всем это может понравится, поэтому хочется в настройках иметь возможность выбора:
- Только маленькие буквы (строчные)
- Большие и маленькие (ПРОПИСНЫЕ и строчные)
Code: Select all
function XH_uenc($s, $search, $replace)
{
global $cf;
$s = str_replace($search, $replace, $s);
$s = str_replace('+', $cf['uri']['word_separator'], urlencode($s));
if ($cf['uri']['lowercase']) {
return utf8_strtolower($s);
} else {
return $s;
}
}
Code: Select all
$cf['uri']['lowercase']="true";
Code: Select all
$mcf['uri']['lowercase']="bool";
Christoph M. Becker – Plugins for CMSimple_XH
Пroverka.html
[ external image ] Доброе утро.
Не получилось:
Если URI:
И создаю страницу:
Проверка
У ссылки такой вид:
/Пroverka.html
[ external image ] Guten morgen.
Hat nicht funktioniert:
Wenn URI:
Und erstelle die Seite:
Проверка
Bei den Links so Aussehen:
/Пroverka.html
[ external image ] Good morning.
Failed:
If the URI:
Create page:
Проверка
The links like this:
/Пroverka.html
Не получилось:
Если URI:
Code: Select all
$tx['urichar']['new']="a|b|v|g|d|e|yo|zh|z|i|i|i|y|y|k|l|m|n|o|p|r|s|t|u|f|h|c|ch|sh|sch|y|e|yu|ya|and";
$tx['urichar']['org']="а|б|в|г|д|е|ё|ж|з|і|ї|и|ы|й|к|л|м|н|о|п|р|с|т|у|ф|х|ц|ч|ш|щ|ы|э|ю|я|&|№|+| –| -|Ъ|Ь|ъ|ь|\"|(|)|,|.";
Проверка
У ссылки такой вид:
/Пroverka.html
[ external image ] Guten morgen.
Hat nicht funktioniert:
Wenn URI:
Code: Select all
$tx['urichar']['new']="a|b|v|g|d|e|yo|zh|z|i|i|i|y|y|k|l|m|n|o|p|r|s|t|u|f|h|c|ch|sh|sch|y|e|yu|ya|and";
$tx['urichar']['org']="а|б|в|г|д|е|ё|ж|з|і|ї|и|ы|й|к|л|м|н|о|п|р|с|т|у|ф|х|ц|ч|ш|щ|ы|э|ю|я|&|№|+| –| -|Ъ|Ь|ъ|ь|\"|(|)|,|.";
Проверка
Bei den Links so Aussehen:
/Пroverka.html
[ external image ] Good morning.
Failed:
If the URI:
Code: Select all
$tx['urichar']['new']="a|b|v|g|d|e|yo|zh|z|i|i|i|y|y|k|l|m|n|o|p|r|s|t|u|f|h|c|ch|sh|sch|y|e|yu|ya|and";
$tx['urichar']['org']="а|б|в|г|д|е|ё|ж|з|і|ї|и|ы|й|к|л|м|н|о|п|р|с|т|у|ф|х|ц|ч|ш|щ|ы|э|ю|я|&|№|+| –| -|Ъ|Ь|ъ|ь|\"|(|)|,|.";
Проверка
The links like this:
/Пroverka.html
Simple Hosting
Бедная, бросаемая бурею, безутешная!
Бедная, бросаемая бурею, безутешная!
Re: Clean URLs
The solution was meant to work with your former urichar_org/new. You need to have the replacements for upper-case letters there, to cater for $cf['uri']['lowercase']="".Maxim wrote:Не получилось:
Если URI:
Christoph M. Becker – Plugins for CMSimple_XH
Не могу понять, (перевести)
[ external image ] Не могу понять, (перевести). Можете показать пример в тегах CODE?
[ external image ] Ich kann nicht verstehen, (übersetzen). Können Sie mit gutem Beispiel mit den Tags CODE?
[ external image ] Can't understand (translate). Can you show an example in tags CODE?
[ external image ] Ich kann nicht verstehen, (übersetzen). Können Sie mit gutem Beispiel mit den Tags CODE?
[ external image ] Can't understand (translate). Can you show an example in tags CODE?
Simple Hosting
Бедная, бросаемая бурею, безутешная!
Бедная, бросаемая бурею, безутешная!
Re: Clean URLs
Unfortunately, you have to stick with:Maxim wrote:Не могу понять, (перевести). Можете показать пример в тегах CODE?
Code: Select all
$tx['urichar']['new']="a|b|c|d|e|f|g|h|i|j|k|l|m|n|o|p|q|r|s|t|u|v|w|x|y|z|a|b|v|g|d|e|yo|zh|z|i|i|i|y|y|k|l|m|n|o|p|r|s|t|u|f|h|c|ch|sh|sch|y|e|yu|ya|a|b|v|g|d|e|yo|zh|z|i|i|i|y|y|k|l|m|n|o|p|r|s|t|u|f|h|c|ch|sh|sch|y|e|yu|ya|and";
$tx['urichar']['org']="A|B|C|D|E|F|G|H|I|J|K|L|M|N|O|P|Q|R|S|T|U|V|W|X|Y|Z|А|Б|В|Г|Д|Е|Ё|Ж|З|І|Ї|И|Ы|Й|К|Л|М|Н|О|П|Р|С|Т|У|Ф|Х|Ц|Ч|Ш|Щ|Ы|Э|Ю|Я|а|б|в|г|д|е|ё|ж|з|і|ї|и|ы|й|к|л|м|н|о|п|р|с|т|у|ф|х|ц|ч|ш|щ|ы|э|ю|я|&|№|+| –| -|Ъ|Ь|ъ|ь|\"|(|)|,|.";
Christoph M. Becker – Plugins for CMSimple_XH
А что изменилось? Не получилось наверно.
[ external image ]Unfortunately, you have to stick with:
Code: Select all
$cf['uri']['lowercase']="true";
А что изменилось? Uri так и остались большими.
Не получилось наверно.
[ external image ]
Code: Select all
$cf['uri']['lowercase']="true";
Und was hat sich geändert? Uri und so blieben die großen.
Nicht geklappt hat wahrscheinlich.
[ external image ]
Code: Select all
$cf['uri']['lowercase']="true";
And what has changed? Uri has remained large.
Did not work I guess.
Simple Hosting
Бедная, бросаемая бурею, безутешная!
Бедная, бросаемая бурею, безутешная!
Re: Clean URLs
Sorry, I have posted wrong urichar_org/new. Please try the following:
Code: Select all
$tx['urichar']['new']="A|B|V|G|D|E|Yo|Zh|Z|I|Y|K|L|M|N|O|P|R|S|T|U|F|H|C|Ch|Sh|Sch|Tz|Y|Mz|E|Yu|Ya|a|b|v|g|d|e|yo|zh|z|i|y|k|l|m|n|o|p|r|s|t|u|f|h|c|ch|sh|sch|tz|y|mz|e|yu|ya";
$tx['urichar']['org']="А|Б|В|Г|Д|Е|Ё|Ж|З|И|Й|К|Л|М|Н|О|П|Р|С|Т|У|Ф|Х|Ц|Ч|Ш|Щ|Ъ|Ы|Ь|Э|Ю|Я|а|б|в|г|д|е|ё|ж|з|и|й|к|л|м|н|о|п|р|с|т|у|ф|х|ц|ч|ш|щ|ъ|ы|ь|э|ю|я";
Christoph M. Becker – Plugins for CMSimple_XH
Да так буквы маленькие, но количество замен...
[ external image ] Да так буквы маленькие, но количество замен (букв) в Uri не поменялось.
Из
Хочу такой Uri
Не хочу дублировать одни и те же буквы.
[ external image ] Ja so Kleinbuchstaben, sondern die Anzahl der Ersetzungen (Buchstaben) in der Uri nicht geändert.
Aus
Ich möchte diese Uri
Ich will nicht duplizieren dieselben Buchstaben.
[ external image ] So the letters are small, but the number of substitutions (letters) in the Uri has not changed.
From
I want this Uri
Don't want to duplicate the same letter.
Из
Code: Select all
$tx['urichar']['new']="A|B|V|G|D|E|Yo|Zh|Z|I|Y|K|L|M|N|O|P|R|S|T|U|F|H|C|Ch|Sh|Sch|Tz|Y|Mz|E|Yu|Ya|a|b|v|g|d|e|yo|zh|z|i|y|k|l|m|n|o|p|r|s|t|u|f|h|c|ch|sh|sch|tz|y|mz|e|yu|ya";
$tx['urichar']['org']="А|Б|В|Г|Д|Е|Ё|Ж|З|И|Й|К|Л|М|Н|О|П|Р|С|Т|У|Ф|Х|Ц|Ч|Ш|Щ|Ъ|Ы|Ь|Э|Ю|Я|а|б|в|г|д|е|ё|ж|з|и|й|к|л|м|н|о|п|р|с|т|у|ф|х|ц|ч|ш|щ|ъ|ы|ь|э|ю|я";
Code: Select all
$tx['urichar']['new']="a|b|v|g|d|e|yo|zh|z|i|i|i|y|y|k|l|m|n|o|p|r|s|t|u|f|h|c|ch|sh|sch|y|e|yu|ya|and";
$tx['urichar']['org']="а|б|в|г|д|е|ё|ж|з|і|ї|и|ы|й|к|л|м|н|о|п|р|с|т|у|ф|х|ц|ч|ш|щ|ы|э|ю|я|&|№|+| –| -|Ъ|Ь|ъ|ь|\"|(|)|,|.";
[ external image ] Ja so Kleinbuchstaben, sondern die Anzahl der Ersetzungen (Buchstaben) in der Uri nicht geändert.
Aus
Code: Select all
$tx['urichar']['new']="A|B|V|G|D|E|Yo|Zh|Z|I|Y|K|L|M|N|O|P|R|S|T|U|F|H|C|Ch|Sh|Sch|Tz|Y|Mz|E|Yu|Ya|a|b|v|g|d|e|yo|zh|z|i|y|k|l|m|n|o|p|r|s|t|u|f|h|c|ch|sh|sch|tz|y|mz|e|yu|ya";
$tx['urichar']['org']="А|Б|В|Г|Д|Е|Ё|Ж|З|И|Й|К|Л|М|Н|О|П|Р|С|Т|У|Ф|Х|Ц|Ч|Ш|Щ|Ъ|Ы|Ь|Э|Ю|Я|а|б|в|г|д|е|ё|ж|з|и|й|к|л|м|н|о|п|р|с|т|у|ф|х|ц|ч|ш|щ|ъ|ы|ь|э|ю|я";
Code: Select all
$tx['urichar']['new']="a|b|v|g|d|e|yo|zh|z|i|i|i|y|y|k|l|m|n|o|p|r|s|t|u|f|h|c|ch|sh|sch|y|e|yu|ya|and";
$tx['urichar']['org']="а|б|в|г|д|е|ё|ж|з|і|ї|и|ы|й|к|л|м|н|о|п|р|с|т|у|ф|х|ц|ч|ш|щ|ы|э|ю|я|&|№|+| –| -|Ъ|Ь|ъ|ь|\"|(|)|,|.";
[ external image ] So the letters are small, but the number of substitutions (letters) in the Uri has not changed.
From
Code: Select all
$tx['urichar']['new']="A|B|V|G|D|E|Yo|Zh|Z|I|Y|K|L|M|N|O|P|R|S|T|U|F|H|C|Ch|Sh|Sch|Tz|Y|Mz|E|Yu|Ya|a|b|v|g|d|e|yo|zh|z|i|y|k|l|m|n|o|p|r|s|t|u|f|h|c|ch|sh|sch|tz|y|mz|e|yu|ya";
$tx['urichar']['org']="А|Б|В|Г|Д|Е|Ё|Ж|З|И|Й|К|Л|М|Н|О|П|Р|С|Т|У|Ф|Х|Ц|Ч|Ш|Щ|Ъ|Ы|Ь|Э|Ю|Я|а|б|в|г|д|е|ё|ж|з|и|й|к|л|м|н|о|п|р|с|т|у|ф|х|ц|ч|ш|щ|ъ|ы|ь|э|ю|я";
Code: Select all
$tx['urichar']['new']="a|b|v|g|d|e|yo|zh|z|i|i|i|y|y|k|l|m|n|o|p|r|s|t|u|f|h|c|ch|sh|sch|y|e|yu|ya|and";
$tx['urichar']['org']="а|б|в|г|д|е|ё|ж|з|і|ї|и|ы|й|к|л|м|н|о|п|р|с|т|у|ф|х|ц|ч|ш|щ|ы|э|ю|я|&|№|+| –| -|Ъ|Ь|ъ|ь|\"|(|)|,|.";
Simple Hosting
Бедная, бросаемая бурею, безутешная!
Бедная, бросаемая бурею, безутешная!