![]() |
![]() |
![]() |
|
|||||||
| Modifications Simple to complex modifications, made by users or by our team, applied to logic or presentation, all kinds of modifications are discussed and requested here. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
|
|
#1 |
|
Join Date: Feb 2006
Location: Mexico City
Posts: 53
![]() |
I was wondering if it si possible to program the mod_rewrite in a way that accents are converted to normal letters. The problem that I have is that I have some titles that use accents. This is no problem, but when the link is written it just writes a - in the url.
For example I have one link that is called: Herramientas Electrónicas Here you can see that Electrónicas uses an ó with an accent. If I enter the pages which contains the details of that link it converts that ó to - So it is like this: herramientas-electr-nicas-l2046.html Is it possible to convert that - to an o without an accent?? Actually I need to convert these accents: á=>a, é=>e, í=>i, ó=>o, ú=>u, ñ=>n Does anyone know how to program these modifications?? Thanks, Richard |
|
|
|
|
|
#2 |
|
eSyndiCat Lead Developer
Join Date: Apr 2006
Location: Kyrgyzstan, Bishkek
Posts: 6,596
![]() ![]() ![]() ![]() |
Hello Richard,
Please try make this: *** Open your util.php *** *** Find this function *** PHP Code:
PHP Code:
You have to change on your specific letters. And plase post the result. |
|
|
|
|
|
#3 | |
|
Join Date: Feb 2006
Location: Mexico City
Posts: 53
![]() |
Quote:
Cheers, Richard Meijs |
|
|
|
|
|
|
#4 |
|
Join Date: Nov 2006
Location: Paris, France
Posts: 40
![]() |
Hello,
I would do the same thing with version 2.2. I tried, but it does not work. Thank you for yours answers. Regards Jc
__________________
http://www.itramways.net |
|
|
|
|
|
#5 |
|
Join Date: Feb 2006
Location: Mexico City
Posts: 53
![]() |
How can this be done with the 2.4.1 script?? I need lowercases and to convert á to a in the url and any other accent... The tried the solutions and changing it in the util.php but it didnt work out...
|
|
|
|
|
|
#6 |
|
Administrator
Join Date: Sep 2005
Posts: 9,299
![]() ![]() ![]() ![]() ![]() ![]() |
Hi
In our 2.2 version this function is called function convertStr($str) So please try to make similar changes in this function. You can find it in includes/util.inc.php
__________________
Subrion CMS - free open source php content management system Business Directory Script - powerful php business directory software, Yellow Pages Script - the most advanced yellow pages php software |
|
|
|
|
|
#7 |
|
Join Date: Nov 2006
Location: Paris, France
Posts: 40
![]() |
Hello, thank you for your ansver,
In includes/util.php (there is no util.inc.php), I do this modification : PHP Code:
![]() Regards Jc
__________________
http://www.itramways.net |
|
|
|
|
|
#8 |
|
Administrator
Join Date: Sep 2005
Posts: 9,299
![]() ![]() ![]() ![]() ![]() ![]() |
Uff my answer was not complete
Please try to change your $str array to $str variable $str['string'] should be simply $str instead
__________________
Subrion CMS - free open source php content management system Business Directory Script - powerful php business directory software, Yellow Pages Script - the most advanced yellow pages php software |
|
|
|
|
|
#9 |
|
Join Date: Nov 2006
Location: Paris, France
Posts: 40
![]() |
I try this code :
PHP Code:
Despite my research on Google, I did not find a solution ![]() Regards Jc
__________________
http://www.itramways.net |
|
|
|
|
|
#10 |
|
Join Date: Jul 2006
Location: St. Petersburg
Posts: 2,567
![]() |
Hello itramways,
***Open includes/classes/esynSmarty.php and find code*** Code:
function convertStr($aParams)
{
$aParams['string'] = preg_replace('/[^a-z0-9]+/i', '-', $aParams['string']);
$aParams['string'] = preg_replace('/\-+/', '-', $aParams['string']);
$aParams['string'] = trim($aParams['string'], '-');
return empty($aParams['string']) ? "listing" : $aParams['string'];
}
Code:
function convertStr($aParams)
{
esynLoadUTF8Util('utf8_to_ascii');
$aParams['string'] = utf8_to_ascii($aParams['string']);
$aParams['string'] = preg_replace('/[^a-z0-9]+/i', '-', $aParams['string']);
$aParams['string'] = preg_replace('/\-+/', '-', $aParams['string']);
$aParams['string'] = trim($aParams['string'], '-');
return empty($aParams['string']) ? "listing" : $aParams['string'];
}
It should work ![]() |
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|