Temos pavadinimas: WordPress, Shopify ir PHPFusion programuotojų bendruomenė :: Ajax komentarai - neveikia LT raidės

Parašė Žmogus· 2009 Gru. 11 20:12:36
#13

      if (!iMEMBER) {
    $name = urldecode($_POST['name']);
    if ($locale['charset'] != 'UTF-8') { $name = iconv('UTF-8', $locale['charset'], $name); }
    $name = mysql_real_escape_string($name);   
        }

        if ($_GET['delete_comment'] == '0') {
    $comment = urldecode($_POST['comment']);
    $comment = iconv('UTF-8', 'windows-1257', $comment);
$comment = rustities($comment);
  //$comment = mysql_real_escape_string($comment);
        } else { $comment = ""; }




Pačiam gale prieš pridėti
   function rustities($source) {
   $search = array("А","Б","В","Г","Д","Е","Ё","Ж","З","И","Й","К","Л","М","Н","О","П","Р","С","Т","У","Ф","Х","Ц","Ч","Ш","Щ","Ъ","Ы","Ь","Э","Ю","Я","а","б","в","г","д","е","ё","ж","з","и","й","к","л","м","н","о","п","р","с","т","у","ф","х","ц","ч","ш","щ","ъ","ы","ь","э","ю","я");
   $replace = array("Ą","Į","Ā","Ć","Ä","Å","Ø","Ę","Ē","Č","É","Ź","Ė","Ģ","Ķ","Ī","Ļ","Š","Ń","Ņ","Ó","Ō","Õ","Ö","×","Ų","Ł","Ś","Ū","Ü","Ż","Ž","ß","ą","į","ā","ć","ä","å","ø","ę","ē","č","é","ź","ė","ģ","ķ","ī","ļ","š","ń","ņ","ó","ō","õ","ö","÷","ų","ł","ś","ū","ü","ż","ž","˙");
   $source = str_replace($search, $replace, $source);
   return $source;
   }