2011-04-22, 18:00:38
Hi
I have Zegnåt's slug Transliteration script - http://get-simple.info/extend/plugin/slu...ration/33/ and it works fine with GS 2.03.
But it does not work with GS 3.0. I am not a programmer but I think there should be very minor updates/changes done in this script. May be anybody familiar with PHP could tell me what should be fixed? Thank you
The script:
I have Zegnåt's slug Transliteration script - http://get-simple.info/extend/plugin/slu...ration/33/ and it works fine with GS 2.03.
But it does not work with GS 3.0. I am not a programmer but I think there should be very minor updates/changes done in this script. May be anybody familiar with PHP could tell me what should be fixed? Thank you
The script:
Code:
<?php
$tf = basename(__FILE__,'.php');
register_plugin(
$tf,
'<code>slug</code> Transliteration',
'2',
'Martijn van der Ven',
'http://zegnat.com/',
'If you use a language with non ASCII characters <a href="http://en.wikipedia.org/wiki/Transliteration">transliteration</a> can be used by GetSimple to change your page titles into slugs.'
);
add_action('changedata-save','translit');
function translit($t=false,$m=false) {
global $i18n;
if (is_array($a=$m)||is_array($a=@$i18n['TRANSLITERATION'])||is_array($a=@$i18n['TRANSLIT'])) {
if (!$t&&isset($_POST['submitted'])) {
global $url, $xml, $file;
$t = ($u=$_POST['post-id'])?$u:($u=$_POST['post-title'])?$u:'temp';
$url = clean_url(to7bit(str_replace(array_keys($a),array_values($a),$t)));
unset($xml->url);
$note = $xml->addChild('url');
$note->addCData($url);
$file = GSDATAPAGESPATH.$url.".xml";
return true;
}
return str_replace(array_keys($a),array_values($a),$t);
}
else return false;
}
?>