maxbrooker wrote:Sorted!
Smiffy - just out of interest, foreign title support converts the letter ä to ae - would it not be better to convert just to a plain letter a ?
Many thanks!
You can create your own swedish "conversion" if you are using utf-8 characters - polish and german example is here:
viewtopic.php?f=5&t=831#p4112UTF-8 code for swedish language are described here:
http://www.eki.ee/letter/chardata.cgi?l ... ript=latinIn this example you have (in this table, for this example): UTF-8 (c3, 84) Ä
So, you have code c384 from Ä to convert it on small 'a' in your links.
You can create your own table conversion for Swedish language, for utf-8 characters only, and all your keyboard special characters.
Tables for '+' and 'Ä' - an example:
- Code: Select all
$utfchars = array('+','c384');
$normchars = array('-','a');
You can add next character 'ä'
Tables only for '+' , 'Ä', 'ä' - an example:
- Code: Select all
<?php
///////////////////////////////////////////////////////////
// Blade Pack //
// Foreign Title Support //
// GPLv3 //
// Version 2.3 Swedish //
// Adminer - Remigiusz Waszkiewicz //
// 07/2011 //
///////////////////////////////////////////////////////////
///////////////////////
// Socket Allocation //
///////////////////////
// Add Blades to Sockets $bladeList['blade'] = 'socket'; //
$bladeList['foreignTitleSupport'] = 'clean-title-support';
///////////////////////
// Blades //
///////////////////////
// blade - convert polish and german special characters to english equivelent //
function str2url($str) {
$str = iconv('UTF-8', 'ASCII//TRANSLIT', $str);
$wyrzucamy=array('^','\'','"','`','~');
$str = str_replace($wyrzucamy, '-', $str );
$filtracja = trim(preg_replace('/ +/',' ',preg_replace('/[^a-zA-Z0-9\s\+\-\_\.]/','',strtolower($str))));
return $filtracja;
}
function foreignTitleSupport($slabTitle)
{
$slabTitle = str2url($slabTitle);
// Swedish table conversion //
// Demo table for '+' , 'Ä', 'ä' only //
/////////////// 1, 2, 3 ///////
$utfchars = array('+','c384', 'c3a4');
$normchars = array('-','a','a');
// end of Swedish table conversion set //
$slabTitle = str_replace($utfchars,$normchars,$slabTitle);
}
// end /////////////////////////////////////////
?>
In this way you can add next characters and create all Swedish conversion table, and save it in system_foreignTitleSupport.php file, together with system_foreignTitleSupport.xml file:
- Code: Select all
<?xml version="1.0" ?>
<bladepack>
<details>
<name>Swedish characters</name>
<version>v2.3sv</version>
<class>system</class>
<author>Remigiusz Waszkiewicz</author>
<description>Swedish Converter</description>
</details>
<archive>
<archive_file>system_foreignTitleSupport.zip</archive_file>
<xml_file>system_foreignTitleSupport.xml</xml_file>
<bladepack_file>system_foreignTitleSupport.php</bladepack_file>
</archive>
<note>
<p>Swedish converter for SEF URL</p>
</note>
</bladepack>
It's only works with utf-8 - if you like it and set in RazorCMS Settings menu.
Regards