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

Postby hope_umut » Thu Aug 09, 2007 8:05 am

only these characters
hope_umut
 
Posts: 7
Joined: Wed Aug 08, 2007 6:25 pm

Advertisement

Postby SeO » Thu Aug 09, 2007 6:09 pm

So for Turkish open phpbb_seo_class.php and find :

Code: Select all
      $this->seo_path['phpbb_script'] =  $script_path;


After add :
Code: Select all
      // --> Custom str_Replace arrays, to handle special cases properly
      $this->seo_opt['url_find'] = array( utf8_chr(286),utf8_chr(287), // g
         utf8_chr(304),utf8_chr(305), // i
         utf8_chr(350),utf8_chr(351), // s
      );
      $this->seo_opt['url_replace'] = array('g', 'g', 'i', 'i','s', 's');


Find :
Code: Select all
      $url = preg_replace('`\[.*\]`U','',$url);


After add :
Code: Select all
      $url = str_replace( $this->seo_opt['url_find'], $this->seo_opt['url_replace'], $url );


Should do it ;)
SeO
Admin
Admin
 
Posts: 6334
Joined: Wed Mar 15, 2006 9:41 pm

Postby hope_umut » Wed Aug 15, 2007 2:20 pm

thanks it works :D
hope_umut
 
Posts: 7
Joined: Wed Aug 08, 2007 6:25 pm

Postby messal » Tue Oct 30, 2007 10:35 am

hello

i used premod RC7

and there isnt in phpbb_seo_class.php
Code: Select all
$this->seo_path['phpbb_script'] =  $script_path;


i find there fci:
Code: Select all
   function format_url( $url, $type = 'topic' ) {
      $url=utf2ascii($url);
    $url = preg_replace("(\[.*\])U","",$url);
      $find = array('"','&','<','>','\r\n','\n',);
      $url = str_replace ($find, '-', $url);
      $url = str_replace ('ß', 'ss', $url);
      $url = str_replace (array('ö','Ö'), 'oe', $url);
      $url = str_replace (array('ä','Ä'), 'ae', $url);
      $url = str_replace (array('ü','Ü'), 'ue', $url);
      $find = "ŔÁÂĂĹŕáâăĺŇÓÔŐŘňóôőřČÉĘËčéęëÇçĚÍÎĎěíîďŮÚŰůúű˙Ńń";
      $replace = "aaaaaaaaaaooooooooooeeeeeeeecciiiiiiiiuuuuuuynn";
      $url = strtr($url,$find,$replace);
      $url = strtolower($url);
      $url = ereg_replace("[^a-zA-Z0-9]", "-", $url);
      $url = preg_replace("`([\-])+`", "\\1", $url);
      $url = trim($url, '-');
      $url = ( $url == "" ) ? $type : $url;
      return $url;
   }


but it looks that isnt work because in ACP_FORUM_URL (admin panel)
i see nedoporu-ene-zp-soby-f88 (nedoporučené způsoby)
and slu-by-f53 (služby)
and others

thanks for help.
User avatar
messal
 
Posts: 15
Joined: Wed Dec 27, 2006 4:27 pm

Postby SeO » Tue Oct 30, 2007 2:44 pm

messal wrote:hello

i used premod RC7

and there isnt in phpbb_seo_class.php
Code: Select all
$this->seo_path['phpbb_script'] =  $script_path;



Well, it should and actually is there in the released files.

Double check.
SeO
Admin
Admin
 
Posts: 6334
Joined: Wed Mar 15, 2006 9:41 pm

Postby messal » Tue Oct 30, 2007 4:16 pm

LOL now i find it. i dont understand.)

But thanks.

There is for CZECH updated by ř and ě
Code: Select all
            // --> Custom str_Replace arrays, to handle special cases properly
      $this->seo_opt['url_find'] = array(utf8_chr(268),utf8_chr(269),  // c
         utf8_chr(356),utf8_chr(357), // t
         utf8_chr(270),utf8_chr(271), // d
         utf8_chr(317),utf8_chr(318), // l
         utf8_chr(327),utf8_chr(328), // n
         utf8_chr(381),utf8_chr(382), // z
         utf8_chr(282),utf8_chr(283), // e
         utf8_chr(344),utf8_chr(345), // r
      );
      $this->seo_opt['url_replace'] = array('c', 'c', 't', 't', 'd', 'd', 'l', 'l','n', 'n', 'z', 'z', 'e', 'e', 'r', 'r');


and there is utf chars for others
Code: Select all
http://www.tony-franks.co.uk/UTF-8.htm
User avatar
messal
 
Posts: 15
Joined: Wed Dec 27, 2006 4:27 pm

Postby dcz » Sat Nov 03, 2007 11:35 am

messal wrote:There is for CZECH updated by ř and ě


Thanks for reporting, it's a bit hard for me to figure out what characters are used in every language ;)

++
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: 21325
Joined: Fri Apr 28, 2006 9:03 pm

Postby TomaS » Sat Nov 03, 2007 9:04 pm

and especially in czech language :lol:
phpBB podpora-slovak phpBB support
slovenský preklad pre phpbb3-slovak translate for phpBB3
predaj a kupa domeny, marketing a internetove podnikanie- Slovak domain center
TomaS
PR2
PR2
 
Posts: 229
Joined: Fri Jun 08, 2007 1:22 am

Postby linhhuchong » Thu Nov 29, 2007 3:58 pm

Please help me with Vietnamese
à á ả ã ạ đ
linhhuchong
 
Posts: 13
Joined: Sun Nov 25, 2007 5:06 pm

Postby messal » Fri Dec 14, 2007 3:23 pm

find symbols on http://www.tony-franks.co.uk/UTF-8.htm

and write numbers dor it (must have CAPS font and small fonts Á and a)

thne add it after utf8_chr(344),utf8_chr(345), // r

and add 'a', 'a' to the end of $this->seo_opt['url_replace'] = array('c', 'c', 't', 't', 'd', 'd', 'l', 'l','n', 'n', 'z', 'z', 'e', 'e', 'r', 'r'
User avatar
messal
 
Posts: 15
Joined: Wed Dec 27, 2006 4:27 pm

Postby CheeRees » Wed Dec 19, 2007 10:45 am

PLS and ů ?? :?
CheeRees
 
Posts: 19
Joined: Tue Dec 11, 2007 1:24 pm

Postby Lesiu » Mon Jan 14, 2008 4:26 pm

I had the same problem with polish characters like ą ć ł and many more. I modified phpbb_seo_class.php but it didn't work at first. It started working when I used utf8_chr() function instead of &# numeric versions. Now it works fine. Thanks fot this thread ;)
Lesiu
 
Posts: 2
Joined: Mon Jan 14, 2008 4:17 pm

Postby dcz » Wed Jan 16, 2008 10:38 am

Yes, utf8_chr() is the universal method here.
Generally speaking, the fastest would be to use proper encoding for your server directly, but the way we do it only requires few calls to it, so it's not a performance issue to do like this and be universal.

++
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: 21325
Joined: Fri Apr 28, 2006 9:03 pm

Postby Ltlegend » Fri Jan 25, 2008 5:56 am

how can I replace letters like
if I have word like įvairūs it replaces to --> vair-s-f30 and I need ivairus-f30
Ą-to A
Č to c
Ė to e
Ę to e
Į to i
Š to s
Ų to u
Ū to u
Ž to z

how can I do that
?
Ltlegend
 
Posts: 1
Joined: Tue Jan 22, 2008 10:07 am

Postby dcz » Sun Jan 27, 2008 9:35 am

Code: Select all
// --> Custom str_Replace arrays, to handle special cases properly
      $this->seo_opt['url_find'] = array(utf8_chr(268),utf8_chr(269),  // c
         utf8_chr(356),utf8_chr(357), // t
         utf8_chr(270),utf8_chr(271), // d
         utf8_chr(317),utf8_chr(318), // l
         utf8_chr(327),utf8_chr(328), // n
         utf8_chr(381),utf8_chr(382), // z
         utf8_chr(282),utf8_chr(283), // e
         utf8_chr(344),utf8_chr(345), // r
         utf8_chr(362),utf8_chr(363), // u
      );
      $this->seo_opt['url_replace'] = array('c', 'c', 't', 't', 'd', 'd', 'l', 'l','n', 'n', 'z', 'z', 'e', 'e', 'r', 'r', 'u', 'u');


adds support for Ū and ū to u ;)
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: 21325
Joined: Fri Apr 28, 2006 9:03 pm

PreviousNext

Return to Advanced SEO URL

 


  • Related topics
    Replies
    Views
    Last post

Who is online

Users browsing this forum: No registered users and 4 guests