• 24-01-2008, 15:06:59
    #1
    Merhaba arkadaşlar,

    Elimde yabancı bir script var ve bu scriptte konu başlığında türkçe karakter kullandığım zaman hata veriyor. Yani wordpress gibi "Kış güneşi" başlıklı konunun linkini "kis-gunesi" şeklinde dönüştürmüyor. Benim bunun için edindiğim kod var fakat bunu bendeki script'e nasıl uygulayacağım?

    Türkçe karakterleri ingilizceye dönüştürmek için kod bu(sanırım doğru olsa gerek):

    function trkarakter($kat) 
    {
        $tr = array('ğ','ü','ş','ı','ö','ç','İ','Ğ','Ü','Ş','Ö','Ç');
        $en = array('g','u','s','i','o','c','i','G','U','S','O','C');
        return str_ireplace($tr,$en,$kat);
    }
    Bendeki scriptte bu kısım:
    while ($row = mysql_fetch_assoc($result)) {
     $popular .= "\n".'<div class="Box">'."\n\t";
      $popular .= '<div style="font-size: 1em; margin-bottom: 5px;"><a href="'.$image_path.'dosya/'.str_replace(" ", "-", $row['Title']).'/">'.$row['Title']."</a></div>";
      $popular .= '<a href="'.$image_path.'dosya/'.str_replace(" ", "-", $row['Title']).'/"><img class="Thumbnail" src="'.$image_path.'images/dosyalar/'.$row['Thumbnail'].'" alt="'.$row['Title'].'" /></a>';
     $popular .= '</div>';
    }
    Başlıklarda Türkçe karakter kullanabilmem için bunu nasıl harmanlayacağım?
  • 24-01-2008, 15:12:28
    #2
    while ($row = mysql_fetch_assoc($result)) {
     $popular .= "\n".'<div class="Box">'."\n\t";
      $popular .= '<div style="font-size: 1em; margin-bottom: 5px;"><a href="'.$image_path.'dosya/'.trkarakter($row['Title']).'/">'.$row['Title']."</a></div>";
      $popular .= '<a href="'.$image_path.'dosya/'.trkarakter($row['Title']).'/"><img class="Thumbnail" src="'.$image_path.'images/dosyalar/'.$row['Thumbnail'].'" alt="'.$row['Title'].'" /></a>';
     $popular .= '</div>';
    }
  • 25-01-2008, 09:42:26
    #3
    Üyeliği durduruldu
    while ($row = mysql_fetch_assoc($result)) {
    $tr = array('ğ','ü','ş','ı','ö','ç','İ','Ğ','Ü','Ş','Ö','Ç');
    $en = array('g','u','s','i','o','c','i','G','U','S','O','C');
    $row['Title']=
    str_ireplace($tr,$en,$row['Title']
    <FONT color=#007700>);
    $popular .= "\n".'<div class="Box">'."\n\t"<FONT face="Courier New">;
    $popular .= '<div style="font-size: 1em; margin-bottom: 5px;"><a href="FONT>.$image_path.'dosya/'.trkarakter($row['Title']).'/">'.$row['Title']."</a></div>";
    $popular .= '<a href="FONT>.$image_path.'dosya/'.trkarakter($row['Title']).'/"><img class="Thumbnail" src="'.$image_path.'images/dosyalar/'.$row['Thumbnail'].'" alt="'.$row['Title'].'" /></a>';
    $popular .= '</div>'
    ;
    }


  • 25-01-2008, 09:50:04
    #4
    Üyeliği durduruldu
    hay ben forum kere
  • 25-01-2008, 09:52:30
    #5
    Üyeliği durduruldu
     
    while ($row = mysql_fetch_assoc($result)) {
    $tr = array('ğ','ü','ş','ı','ö','ç','İ','Ğ','Ü','Ş','Ö','Ç');
    $en = array('g','u','s','i','o','c','i','G','U','S','O','C');
    $row['Title']= str_replace($tr,$en,$row['Title']);
    $popular .= "\n".'<div class="Box">'."\n\t";
    $popular .= '<div style="font-size: 1em; margin-bottom: 5px;"><a href="'.$image_path.'dosya/'.str_replace(" ", "-", $row['Title']).'/">'.$row['Title']."</a></div>";
    $popular .= '<a href="'.$image_path.'dosya/'.str_replace(" ", "-", $row['Title']).'/"><img class="Thumbnail" src="'.$image_path.'images/dosyalar/'.$row['Thumbnail'].'" alt="'.$row['Title'].'" /></a>';
    $popular .= '</div>';
    }