Forums / Cotonti / General / Turkish characters fix (url modifcation)

fedai
#1 2010-01-15 15:38
Doc: http://www.cotonti.com/docs/en/admin/url_modification

expl: site.com/docs/ölçüm
the url Turkish characters: ö,ç,ü Turkish characters instead ö=o,ç=c,ü=u fix, such as how do we do
"peace in the homeland, peace in the world" K.ATATÜRK

personal blog:
http://www.sametbal.net
Gökhan YILDIZ
#2 2010-01-15 18:13
sufficient for a solution to the following

open functions.custom.php or functions.php

find:

if (!defined('SED_CODE')) { die('Wrong URL.'); }

add after:

function makesafe($text)
{
	//$text = preg_replace("#&\#([0-9]*);#ie","_",$text);
	$text = html_entity_decode($text);
	$text = str_replace(" / ","_",$text);
	$text = str_replace("'","",$text);
	$text = str_replace("\"","",$text);
	$text = str_replace("/","_",$text);
	$text = str_replace("'","_",$text);
	$text = str_replace(" - ","_",$text);
	$text = str_replace("-","_",$text);
	$text = str_replace(" ","_",$text);
	$text = str_replace( "ç", "c", $text);
	$text = str_replace( "Ç", "c", $text);
	$text = str_replace( "ğ", "g", $text);
	$text = str_replace( "Ğ", "g", $text);
	$text = str_replace( "ı", "i", $text);
	$text = str_replace( "İ", "i", $text);
	$text = str_replace( "ö", "o", $text);
	$text = str_replace( "Ö", "o", $text);
	$text = str_replace( "ş", "s", $text);
	$text = str_replace( "Ş", "s", $text);
	$text = str_replace( "ü", "u", $text);
	$text = str_replace( "Ü", "u", $text);
	$text = str_replace( "&", "and", $text);
	$text = str_replace( "%", "Percent", $text);
	$text = ereg_replace("[^A-Za-z0-9_-]", "", $text);
	$text = str_replace("____","_",$text);
	$text = str_replace("___","_",$text);
	$text = str_replace("__","_",$text);
	$text = strtolower($text);
	return $text;
}


save and upload.
Gökhan YILDIZ
TeknoGroup
#3 2010-02-16 07:33
@Gökhan YILDIZ

değişen birşey olmadı malesef
Gökhan YILDIZ
#4 2010-02-16 08:57
http://www.cotonti.com/forums.php?m=posts&p=10670 bu sayfadaki yönergeleri uygulayın.
Gökhan YILDIZ
TeknoGroup
#5 2010-02-16 10:57
orayı uygulazım zaten url deki türkçe karakterleri kaldırmak için

$text = str_replace( "ş", "s", $text);

kodlarını eklesemde görmüyor
Gökhan YILDIZ
#6 2010-02-16 19:29
Aynı uygulamayı ben yaptığımda sorun yaşamadım. Lütfen en baştan kontrol ederek yapınız.
Gökhan YILDIZ
TeknoGroup
#7 2010-02-18 04:57
sorun benden kaynaklanıyordur o halde yanlış anlamayın ama bu kodları siz denedinizmi
Gökhan YILDIZ
#8 2010-02-18 07:36
Evet denedim. Modifikasyonu yeni kurulan bir cotonti üzerinde denediğiniz zaman herhangi bir hata ile karşılaşmanız mümkün değil.
Gökhan YILDIZ