Neler yeni
Presta-TR

Forumumza kayıt olarak hem destek alabilir hem de destek verebilirsiniz!

Şimdiden aramıza hoş geldiniz.

[ÇÖZÜLDÜ]Arkadaşça URL ve türkçe sorunu

soruyol

Yeni Üye
Katılım
7 Eki 2010
Mesajlar
14
Tepkime puanı
0
Puanları
0
Arkadaşça URL'yi aktif ettikten sonra sadece üreticilerin(manufacturers) linklerinde bulunan Türkçe karakterler noktasız karakterler çevrilmiş olarak gözükmüyor. Örneğin üretici adı "İsim" olsun link SiteAdi.Com - Siteadi.com şeklinde gözükmesi gerekiyorken SiteAdi.Com - Siteadi.com olarak gözüküyor. Diğer linklerdeki değişimi admin.js de değişiklikle hallettim ama üreticiler için çözüm bulamadım. Konu hakkında yardımcı olabilirseniz sevinirim. Şimdiden teşekkürler.
 
Cvp: Arkadaşça URL ve türkçe sorunu

sorunu tam olark anlayamadım o Arkadaşça URL yi manuel olarak düzenleyebiliyorsunuz zaten
 
Cvp: Arkadaşça URL ve türkçe sorunu

Sorun şu blockmanufacturer da gözüken üretici(imalatçı) firmaların türkçe karakterleri (ıçşğüöç) noktasız karaktere çevirilmiyor ve Admin panelden giriş yapılırken arkadaşça url girişi için alan mevcut değil. Bu arada prestashop 1.3.1.1 kullanıyorum.
 
Cvp: Arkadaşça URL ve türkçe sorunu

yeni versiyon kullanmaya başlamanın vakti gelmiş :)
 
Cvp: Arkadaşça URL ve türkçe sorunu

Aslında doğru söylüyorsunuz ama temayı uyumlu hale getirmek, düzenlemeleri yapmak falan zor geliyor :)
 
Evet arkadaşlar, Manufacturers friendly(arkadaşça) url deki türkçe karakter çeviriminin çözümünü buldum ve sizinle paylaşmak istiyorum.

PS 1.3.x versiyonu için classes/tools.php'yi açıp aşağıdaki satırları bulun.

static public function link_rewrite($str, $utf8_decode = false)
{
$purified = '';
$length = self::strlen($str);
if ($utf8_decode)
$str = utf8_decode($str);
for ($i = 0; $i < $length; $i++)
{
$char = self::substr($str, $i, 1);
if (self::strlen(htmlentities($char)) > 1)
{
$entity = htmlentities($char, ENT_COMPAT, 'UTF-8');
$purified .= $entity{1};
}
elseif (preg_match('|[:alpha:]]{1}|u', $char))
$purified .= $char;
elseif (preg_match('<[:digit:]]|-{1}>', $char))
$purified .= $char;
elseif ($char == ' ')
$purified .= '-';
elseif ($char == '\'')
$purified .= '-';
}
return trim(self::strtolower($purified));
}
daha sonra bu satırları aşağıdaki kodla değiştirin.

static public function link_rewrite($str, $utf8_decode = false)
{
return self::str2url($str);
}

/**
* Return a friendly url made from the provided string
* If the mbstring library is available, the output is the same as the js function of the same name
*
* @param string $str
* @return string
*/
public static function str2url($str)
{
if (function_exists('mb_strtolower'))
$str = mb_strtolower($str, 'utf-8');

$str = trim($str);
$str = self::replaceAccentedChars($str);

// Remove all non-whitelist chars.
$str = preg_replace('/[^a-zA-Z0-9\s\'\:\/\[\]-]/','', $str);
$str = preg_replace('/[\s\'\:\/\[\]-]+/',' ', $str);
$str = preg_replace('/[ ]/','-', $str);
$str = preg_replace('/[\/]/','-', $str);

// If it was not possible to lowercase the string with mb_strtolower, we do it after the transformations.
// This way we lose fewer special chars.
$str = strtolower($str);

return $str;
}

/**
* Replace all accented chars by their equivalent non accented chars.
*
* @param string $str
* @return string
*/
public static function replaceAccentedChars($str)
{
$str = preg_replace('/[\x{0105}\x{0104}\x{00E0}\x{00E1}\x{00E2}\x{00E3}\x{00E4}\x{00E5}]/u','a', $str);
$str = preg_replace('/[\x{00E7}\x{010D}\x{0107}\x{0106}]/u','c', $str);
$str = preg_replace('/[\x{010F}]/u','d', $str);
$str = preg_replace('/[\x{00E8}\x{00E9}\x{00EA}\x{00EB}\x{011B}\x{0119}\x{0118}]/u','e', $str);
$str = preg_replace('/[\x{00EC}\x{00ED}\x{00EE}\x{00EF}\x{0131}]/u','i', $str);
$str = preg_replace('/[\x{0142}\x{0141}\x{013E}\x{013A}]/u','l', $str);
$str = preg_replace('/[\x{00F1}\x{0148}]/u','n', $str);
$str = preg_replace('/[\x{00F2}\x{00F3}\x{00F4}\x{00F5}\x{00F6}\x{00F8}\x{00D3}]/u','o', $str);
$str = preg_replace('/[\x{0159}\x{0155}]/u','r', $str);
$str = preg_replace('/[\x{015B}\x{015A}\x{0161}\x{015F}]/u','s', $str);
$str = preg_replace('/[\x{00DF}]/u','ss', $str);
$str = preg_replace('/[\x{0165}]/u','t', $str);
$str = preg_replace('/[\x{00F9}\x{00FA}\x{00FB}\x{00FC}\x{016F}]/u','u', $str);
$str = preg_replace('/[\x{00FD}\x{00FF}]/u','y', $str);
$str = preg_replace('/[\x{017C}\x{017A}\x{017B}\x{0179}\x{017E}]/u','z', $str);
$str = preg_replace('/[\x{00E6}]/u','ae', $str);
$str = preg_replace('/[\x{0153}]/u','oe', $str);
$str = preg_replace('/[\x{011F}]/u','g', $str);
return $str;
}
 
PS 1.4.x versiyonu için yine classes/tools.php'yi açıp aşağıdaki satırları bulun

public static function replaceAccentedChars($str)
{
$str = preg_replace('/[\x{0105}\x{0104}\x{00E0}\x{00E1}\x{00E2}\x{00E3}\x{00E4}\x{00E5}]/u','a', $str);
$str = preg_replace('/[\x{00E7}\x{010D}\x{0107}\x{0106}]/u','c', $str);
$str = preg_replace('/[\x{010F}]/u','d', $str);
$str = preg_replace('/[\x{00E8}\x{00E9}\x{00EA}\x{00EB}\x{011B}\x{0119}\x{0118}]/u','e', $str);
$str = preg_replace('/[\x{00EC}\x{00ED}\x{00EE}\x{00EF}]/u','i', $str);
$str = preg_replace('/[\x{0142}\x{0141}\x{013E}\x{013A}]/u','l', $str);
$str = preg_replace('/[\x{00F1}\x{0148}]/u','n', $str);
$str = preg_replace('/[\x{00F2}\x{00F3}\x{00F4}\x{00F5}\x{00F6}\x{00F8}\x{00D3}]/u','o', $str);
$str = preg_replace('/[\x{0159}\x{0155}]/u','r', $str);
$str = preg_replace('/[\x{015B}\x{015A}\x{0161}]/u','s', $str);
$str = preg_replace('/[\x{00DF}]/u','ss', $str);
$str = preg_replace('/[\x{0165}]/u','t', $str);
$str = preg_replace('/[\x{00F9}\x{00FA}\x{00FB}\x{00FC}\x{016F}]/u','u', $str);
$str = preg_replace('/[\x{00FD}\x{00FF}]/u','y', $str);
$str = preg_replace('/[\x{017C}\x{017A}\x{017B}\x{0179}\x{017E}]/u','z', $str);
$str = preg_replace('/[\x{00E6}]/u','ae', $str);
$str = preg_replace('/[\x{0153}]/u','oe', $str);
return $str;
}

ve bu satırları aşağıdaki gibi değiştirin.

public static function replaceAccentedChars($str)
{
$str = preg_replace('/[\x{0105}\x{0104}\x{00E0}\x{00E1}\x{00E2}\x{00E3}\x{00E4}\x{00E5}]/u','a', $str);
$str = preg_replace('/[\x{00E7}\x{010D}\x{0107}\x{0106}]/u','c', $str);
$str = preg_replace('/[\x{010F}]/u','d', $str);
$str = preg_replace('/[\x{00E8}\x{00E9}\x{00EA}\x{00EB}\x{011B}\x{0119}\x{0118}]/u','e', $str);
$str = preg_replace('/[\x{00EC}\x{00ED}\x{00EE}\x{00EF}\x{0131}]/u','i', $str);
$str = preg_replace('/[\x{0142}\x{0141}\x{013E}\x{013A}]/u','l', $str);
$str = preg_replace('/[\x{00F1}\x{0148}]/u','n', $str);
$str = preg_replace('/[\x{00F2}\x{00F3}\x{00F4}\x{00F5}\x{00F6}\x{00F8}\x{00D3}]/u','o', $str);
$str = preg_replace('/[\x{0159}\x{0155}]/u','r', $str);
$str = preg_replace('/[\x{015B}\x{015A}\x{0161}\x{015F}]/u','s', $str);
$str = preg_replace('/[\x{00DF}]/u','ss', $str);
$str = preg_replace('/[\x{0165}]/u','t', $str);
$str = preg_replace('/[\x{00F9}\x{00FA}\x{00FB}\x{00FC}\x{016F}]/u','u', $str);
$str = preg_replace('/[\x{00FD}\x{00FF}]/u','y', $str);
$str = preg_replace('/[\x{017C}\x{017A}\x{017B}\x{0179}\x{017E}]/u','z', $str);
$str = preg_replace('/[\x{00E6}]/u','ae', $str);
$str = preg_replace('/[\x{0153}]/u','oe', $str);
$str = preg_replace('/[\x{011F}]/u','g', $str);
return $str;
}
hepsi bu kadar.
 
Paylaşım için teşekkürler pek çok kişiye fayda sağlayabilir en azından eski versiyon kullanmak zorunda olanlara ;)
 
1.4.8.2 de ş ğ çalışmıyor
 
üstteki düzeltme ile çalışması gerekli eğer olmadıysa tekrar yazın burdan düzeltmeyi yapıp iletelim
 
Üst Alt