WordPress.org

Ready to get started?Download WordPress

Forums

ProjectManager
Omit accents in the Search (1 post)

  1. dgcebas
    Member
    Posted 2 years ago #

    Hello.
    First I want to thank Kolja Schleich this plugin is great and works well.
    I'm from Spain and use accents. What should I do to make the search results Martínez = Martinez? In case there are no problems.

    Where should I add this code?

    $translation = array(
    'from' => array(
    'à','á','â','ã','ä', 'ç', 'è','é','ê','ë', 'ì','í','î','ï', 'ñ',
    'ò','ó','ô','õ','ö', 'ù','ú','û','ü', 'ý','ÿ', 'À','Á','Â','Ã',
    'Ä','Ç', 'È','É','Ê','Ë', 'Ì','Í','Î','Ï', 'Ñ', 'Ò','Ó','Ô','Õ',
    'Ö', 'Ù','Ú','Û','Ü', 'Ý')
    'to' => array(
    'a','a','a','a','a', 'c', 'e','e','e','e', 'i','i','i','i', 'n',
    'o','o','o','o','o', 'u','u','u','u', 'y','y', 'A','A','A','A','A',
    'C','E','E','E','E', 'I','I','I','I', 'N', 'O','O','O','O','O',
    'U','U','U','U', 'Y')
    );

    Or this?

    function check_array($array, $string){
    $trans = array("é" => "e", "é" => "e", "á" => "a", "á" => "a", "í" => "i","í"=>"i", "ó"=>"o", "ó" => "o", "ú" => "u", "ú"=>"u","ö" => "u", "ü"=>"u");
    $realString = strtr($string,$trans);
    foreach($array as $val){
    $realVal = strtr($val,$trans);
    if(strcasecmp( $realVal, $realString ) == 0){
    return true;
    }
    }
    return false;
    }

    Thanks and regards

    http://wordpress.org/extend/plugins/projectmanager/

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic