<?php
/**
 * Smarty plugin
 * @package Smarty
 * @subpackage plugins
 */


/**
 * Smarty seotitle modifier plugin
 *
 * Type:     modifier<br>
 * Name:     seotitle<br>
 * Purpose:  convert string to seo-link
 * @author   B. Wunderlich
 * @param string
 * @return string
 */
function smarty_modifier_seotitle($string)
{
    $string = strtolower($string);
	$string = str_replace(array('&auml;','ä'),'ae',$string);
	$string = str_replace(array('&ouml;','ö'),'oe',$string);
	$string = str_replace(array('&uuml;','ü'),'ue',$string);
	$string = str_replace(array('&szlig;','ß'),'ss',$string);
	$string = str_replace(array('(',')'), '', $string);
	$string = eregi_replace('[^a-zA-Z0-9-]', '-', $string);
	$string = eregi_replace('[-]$', '', $string);
	$string = str_replace(array('--','---','----'), '', $string);
	
	return $string;
}

?>
