About special characters remplacement

phpBB3 SEO Advanced mod Rewrite support forum.
This mods performs URL rewriting for phpBB, injecting forums and topic titles in their URLs.

Moderator: Moderators


Re: About special characters remplacement

Postby Afr0man » Sun May 24, 2009 4:35 pm

but its not working
Code: Select all
             // --> Custom str_Replace arrays, to handle special cases properly
          $this->seo_opt['url_find'] = array(utf8_chr(260),utf8_chr(261),  // ą Ą -a
             utf8_chr(268),utf8_chr(269), // čČ-c
             utf8_chr(280),utf8_chr(281), // ęĘ-e
             utf8_chr(278),utf8_chr(279), // ėĖ-e
             utf8_chr(302),utf8_chr(303), // Įį-i
             utf8_chr(138),utf8_chr(154), utf8_chr(352),utf8_chr(353), // Šš-s
             utf8_chr(370),utf8_chr(371), // Ųų-u
             utf8_chr(362),utf8_chr(363), // Ūū-u
             utf8_chr(142),utf8_chr(158), utf8_chr(381),utf8_chr(382), // Žž-z
          );
          $this->seo_opt['url_replace'] = array('a', 'a', 'c', 'c', 'e', 'e', 'e', 'e','i', 'i', 's', 's', 's', 's', 'u', 'u', 'u', 'u', 'z', 'z', 'z', 'z');
            $url = preg_replace( '`&([a-z]+)(acute|uml|circ|grave|ring|cedil|slash|tilde|caron|lig);`i', "\\1", $url );
          $url = preg_replace( $this->seo_opt['url_pattern'] , '-', $url);
              $url = trim($url, '-');
          return empty($url) ? $type : $url;
       }
          $url = htmlentities($url, ENT_COMPAT, $this->encoding);
          $url = str_replace( array('č', 'Č'),'c', $url );
            $url = str_replace( array('ą', 'Ą'),'a', $url );
            $url = str_replace( array('ė', 'ė'),'e', $url );
            $url = str_replace( array('ę', 'Ę'),'e', $url );
            $url = str_replace( array('į', 'Į'),'i', $url );
            $url = str_replace( array('š', 'Š'),'s', $url );
            $url = str_replace( array('ų', 'Ų'),'u', $url );
            $url = str_replace( array('ū', 'Ū'),'u', $url );
            $url = str_replace( array('ž', 'Ž'),'z', $url );
            $url = preg_replace( '`&([a-z]+)(acute|uml|circ|grave|ring|cedil|slash|tilde|caron|lig);`i', "\\1", $url );
          $url = preg_replace( $this->seo_opt['url_pattern'] , '-', $url);
          $url = strtolower(trim($url, '-'));
          return empty($url) ? $type : $url;
       }     
Afr0man
 
Posts: 14
Joined: Tue Apr 21, 2009 1:16 pm

Advertisement

Re: About special characters remplacement

Postby dcz » Mon May 25, 2009 10:42 am

Well you did not really followed what was advised.
But we're up to make all this a lot easier, so until then (when 3.0.5 gets out), just try to add :
Code: Select all
          $url = str_replace( array('č', 'Č'),'c', $url );
            $url = str_replace( array('ą', 'Ą'),'a', $url );
            $url = str_replace( array('ė', 'ė'),'e', $url );
            $url = str_replace( array('ę', 'Ę'),'e', $url );
            $url = str_replace( array('į', 'Į'),'i', $url );
            $url = str_replace( array('š', 'Š'),'s', $url );
            $url = str_replace( array('ų', 'Ų'),'u', $url );
            $url = str_replace( array('ū', 'Ū'),'u', $url );
            $url = str_replace( array('ž', 'Ž'),'z', $url );

Before :
Code: Select all
$url = htmlentities($url, ENT_COMPAT, 'utf-8');


in phpbb_seo_class.php, just make shure you edit it in utf-8 without BOM (notepad++ can do it).

Should do it.

++
Useful links :
SEO Forum || SEO Directory || SEO phpBB || Search
____________________

Liens Utiles :
Forum référencement || Annuaire référencement || Référencement phpBB || Recherche
dcz
Admin
Admin
 
Posts: 19821
Joined: Fri Apr 28, 2006 9:03 pm

Re: About special characters remplacement

Postby Afr0man » Mon May 25, 2009 4:19 pm

tanks it's workig ;)
Afr0man
 
Posts: 14
Joined: Tue Apr 21, 2009 1:16 pm

Re: About special characters remplacement

Postby dcz » Fri Jun 12, 2009 8:05 am

Please read : Custom replacement for title injection

For the new, and easier, method to use to implement custom replacement.

;)
Useful links :
SEO Forum || SEO Directory || SEO phpBB || Search
____________________

Liens Utiles :
Forum référencement || Annuaire référencement || Référencement phpBB || Recherche
dcz
Admin
Admin
 
Posts: 19821
Joined: Fri Apr 28, 2006 9:03 pm

Re: About special characters remplacement

Postby mafiaWolf » Sat Jul 04, 2009 7:12 am

I have some Vietnamese charsets...Please change it to code to add to phpbb_seo_class
Code: Select all
'A' => 'a','B' => 'b','C' => 'c','D' => 'd','E' => 'e','F' => 'f','G' => 'g',
            'H' => 'h','I' => 'i','J' => 'j','K' => 'k','L' => 'l','M' => 'm','N' => 'n','O' => 'o','P' => 'p',
            'Q' => 'q','R' => 'r','S' => 's','T' => 't','U' => 'u','V' => 'v',
            'W' => 'w','X' => 'X','Y' => 'y','Z' => 'z',

            'Á' => 'a', 'À' => 'a','Ả' => 'a', 'Ã' => 'a','Ạ' => 'a',
            'á' => 'a', 'à' => 'a','ả' => 'a', 'ã' => 'a','ạ' => 'a',
            'Ă' => 'a', 'Ắ' => 'a', 'Ằ' => 'a','Ẳ' => 'a', 'Ẵ' => 'a','Ặ' => 'a',
            'ă' => 'a', 'ắ' => 'a', 'ằ' => 'a','ẳ' => 'a', 'ẵ' => 'a','ặ' => 'a',
            'Â' => 'a', 'Ấ' => 'a', 'Ầ' => 'a','Ẩ' => 'a', 'Ẫ' => 'a','Ậ' => 'a',
            'â' => 'a', 'ấ' => 'a', 'ầ' => 'a','ẩ' => 'a', 'ẫ' => 'a','ậ' => 'a',
            'Đ' => 'd', 'đ' => 'd',
            'É' => 'e', 'È' => 'e','Ẻ' => 'e', 'Ẽ' => 'e','Ẹ' => 'e',
            'é' => 'e', 'è' => 'e','ẻ' => 'e', 'ẽ' => 'e','ẹ' => 'e',
            'Ê' => 'e', 'Ế' => 'e', 'Ề' => 'e','Ể' => 'e', 'Ễ' => 'e','Ệ' => 'e',
            'ê' => 'e', 'ế' => 'e', 'ề' => 'e','ể' => 'e', 'ễ' => 'e','ệ' => 'e',
            'Í' => 'i', 'Ì' => 'i','Ỉ' => 'i', 'Ĩ' => 'i','Ị' => 'i',
            'í' => 'i', 'ì' => 'i','ỉ' => 'i', 'ĩ' => 'i','ị' => 'i',
            'Ó' => 'o', 'Ò' => 'o','Ỏ' => 'o', 'Õ' => 'o','Ọ' => 'o',
            'ó' => 'o', 'ò' => 'o','ỏ' => 'o', 'õ' => 'o','ọ' => 'o',
            'Ô' => 'o', 'Ố' => 'o', 'Ồ' => 'o','Ổ' => 'o', 'Ỗ' => 'o','Ộ' => 'o',
            'ô' => 'o', 'ố' => 'o', 'ồ' => 'o','ổ' => 'o', 'ỗ' => 'o','ộ' => 'o',
            'Ơ' => 'o', 'Ớ' => 'o', 'Ờ' => 'o','Ở' => 'o', 'Ỡ' => 'o','Ợ' => 'o',
            'ơ' => 'o', 'ớ' => 'o', 'ờ' => 'o','ở' => 'o', 'ỡ' => 'o','ợ' => 'o',
            'Ú' => 'u', 'Ù' => 'u','Ủ' => 'u', 'Ũ' => 'u','Ụ' => 'u',
            'ú' => 'u', 'ù' => 'u','ủ' => 'u', 'ũ' => 'u','ụ' => 'u',
            'Ư' => 'u', 'Ứ' => 'u', 'Ừ' => 'u','Ử' => 'u', 'Ữ' => 'u','Ự' => 'u',
            'ư' => 'u', 'ứ' => 'u', 'ừ' => 'u','ử' => 'u', 'ữ' => 'u','ự' => 'u',
            'Ý' => 'y', 'Ỳ' => 'y','Ỷ' => 'y', 'Ỹ' => 'y','Ỵ' => 'y',
            'ý' => 'y', 'ỳ' => 'y','ỷ' => 'y', 'ỹ' => 'y','ỵ' => 'y',
mafiaWolf
 
Posts: 34
Joined: Thu Jun 04, 2009 2:28 am

Re: About special characters remplacement

Postby Typo » Sun Jul 05, 2009 9:16 am

Please see Custom replacement for title injection for the info you need to do this yourself and if you need help, let us know which part is giving you trouble.

Tyoi
My Website: A Place To Chat

My Mods: Colored Times, Clickable Icons, Language Selection Mod, and Log Users IP

My Favorite Quote: "I've gone to look for myself. If I should return before I get back, please keep me here."

My Business: Typo IT - web development and pc services
User avatar
Typo
phpBB SEO Team
phpBB SEO Team
 
Posts: 342
Joined: Sun Jan 18, 2009 11:33 am

Re: About special characters remplacement

Postby mafiaWolf » Mon Jul 06, 2009 3:58 pm

Oh..i mean can you change it for me...I don't know to much about the number of character
mafiaWolf
 
Posts: 34
Joined: Thu Jun 04, 2009 2:28 am

Re: About special characters remplacement

Postby Typo » Mon Jul 06, 2009 10:48 pm

OPEN:
phpbb_seo/includes/setup_phpbb_seo.php

FIND:
Code: Select all
      // Let's make sure that settings are consistent
      $this->check_config();

ADD ON A NEW LINE BEFORE:
Code: Select all
$this->url_replace = array(
   'Á' => 'a', 'À' => 'a','Ả' => 'a', 'Ã' => 'a','Ạ' => 'a',
   'á' => 'a', 'à' => 'a','ả' => 'a', 'ã' => 'a','ạ' => 'a',
   'Ă' => 'a', 'Ắ' => 'a', 'Ằ' => 'a','Ẳ' => 'a', 'Ẵ' => 'a','Ặ' => 'a',
   'ă' => 'a', 'ắ' => 'a', 'ằ' => 'a','ẳ' => 'a', 'ẵ' => 'a','ặ' => 'a',
   'Â' => 'a', 'Ấ' => 'a', 'Ầ' => 'a','Ẩ' => 'a', 'Ẫ' => 'a','Ậ' => 'a',
   'â' => 'a', 'ấ' => 'a', 'ầ' => 'a','ẩ' => 'a', 'ẫ' => 'a','ậ' => 'a',
   'Đ' => 'd', 'đ' => 'd',
   'É' => 'e', 'È' => 'e','Ẻ' => 'e', 'Ẽ' => 'e','Ẹ' => 'e',
   'é' => 'e', 'è' => 'e','ẻ' => 'e', 'ẽ' => 'e','ẹ' => 'e',
   'Ê' => 'e', 'Ế' => 'e', 'Ề' => 'e','Ể' => 'e', 'Ễ' => 'e','Ệ' => 'e',
   'ê' => 'e', 'ế' => 'e', 'ề' => 'e','ể' => 'e', 'ễ' => 'e','ệ' => 'e',
   'Í' => 'i', 'Ì' => 'i','Ỉ' => 'i', 'Ĩ' => 'i','Ị' => 'i',
   'í' => 'i', 'ì' => 'i','ỉ' => 'i', 'ĩ' => 'i','ị' => 'i',
   'Ó' => 'o', 'Ò' => 'o','Ỏ' => 'o', 'Õ' => 'o','Ọ' => 'o',
   'ó' => 'o', 'ò' => 'o','ỏ' => 'o', 'õ' => 'o','ọ' => 'o',
   'Ô' => 'o', 'Ố' => 'o', 'Ồ' => 'o','Ổ' => 'o', 'Ỗ' => 'o','Ộ' => 'o',
   'ô' => 'o', 'ố' => 'o', 'ồ' => 'o','ổ' => 'o', 'ỗ' => 'o','ộ' => 'o',
   'Ơ' => 'o', 'Ớ' => 'o', 'Ờ' => 'o','Ở' => 'o', 'Ỡ' => 'o','Ợ' => 'o',
   'ơ' => 'o', 'ớ' => 'o', 'ờ' => 'o','ở' => 'o', 'ỡ' => 'o','ợ' => 'o',
   'Ú' => 'u', 'Ù' => 'u','Ủ' => 'u', 'Ũ' => 'u','Ụ' => 'u',
   'ú' => 'u', 'ù' => 'u','ủ' => 'u', 'ũ' => 'u','ụ' => 'u',
   'Ư' => 'u', 'Ứ' => 'u', 'Ừ' => 'u','Ử' => 'u', 'Ữ' => 'u','Ự' => 'u',
   'ư' => 'u', 'ứ' => 'u', 'ừ' => 'u','ử' => 'u', 'ữ' => 'u','ự' => 'u',
   'Ý' => 'y', 'Ỳ' => 'y','Ỷ' => 'y', 'Ỹ' => 'y','Ỵ' => 'y',
   'ý' => 'y', 'ỳ' => 'y','ỷ' => 'y', 'ỹ' => 'y','ỵ' => 'y',
);


I did not include the following:
'A' => 'a','B' => 'b','C' => 'c','D' => 'd','E' => 'e','F' => 'f','G' => 'g',
'H' => 'h','I' => 'i','J' => 'j','K' => 'k','L' => 'l','M' => 'm','N' => 'n','O' => 'o','P' => 'p',
'Q' => 'q','R' => 'r','S' => 's','T' => 't','U' => 'u','V' => 'v',
'W' => 'w','X' => 'X','Y' => 'y','Z' => 'z',

Because all it does is get rid of all uppercase english letters.

Hope this helps, let me know if it works properly for your language please as we will some day be assembling all the translations into one source for easy access.

Typo
My Website: A Place To Chat

My Mods: Colored Times, Clickable Icons, Language Selection Mod, and Log Users IP

My Favorite Quote: "I've gone to look for myself. If I should return before I get back, please keep me here."

My Business: Typo IT - web development and pc services
User avatar
Typo
phpBB SEO Team
phpBB SEO Team
 
Posts: 342
Joined: Sun Jan 18, 2009 11:33 am

Re: About special characters remplacement

Postby dcz » Wed Jul 08, 2009 5:39 pm

If I recall well, I already told you to read what was said in this thread : Setup and cyrillic char-set

It of course does not apply to your case directly, but it shows how you can directly use utf-8, and not the character codes in the previous phpbb_seo_class.php.

++
Useful links :
SEO Forum || SEO Directory || SEO phpBB || Search
____________________

Liens Utiles :
Forum référencement || Annuaire référencement || Référencement phpBB || Recherche
dcz
Admin
Admin
 
Posts: 19821
Joined: Fri Apr 28, 2006 9:03 pm

Re: About special characters remplacement

Postby Algiz » Sun Aug 02, 2009 5:58 am

I cannot find at version phpBB_SEO_Ultimate_SEO_URLV0-6-0 there i can it to write :oops:
Algiz
 
Posts: 1
Joined: Sat Aug 01, 2009 5:58 am

Re: About special characters remplacement

Postby dcz » Sun Aug 02, 2009 1:49 pm

This method is outdated, please read : Custom replacement for title injection

++
Useful links :
SEO Forum || SEO Directory || SEO phpBB || Search
____________________

Liens Utiles :
Forum référencement || Annuaire référencement || Référencement phpBB || Recherche
dcz
Admin
Admin
 
Posts: 19821
Joined: Fri Apr 28, 2006 9:03 pm

Previous

Return to Advanced SEO URL

 


  • Related topics
    Replies
    Views
    Last post

Who is online

Users browsing this forum: No registered users and 14 guests


 
cron