
EDIT:
Meinst Du damit Version 1.1.2 aus dem Downloadpack?Bei Version 1.1. tritt es noch nicht auf
Was ist denn mit dieser Version: Das ist meine neue Version 1.1.5

Code: Alles auswählen
function append_sid($url, $non_html_amp = false, $seo_title = '') // Seo Urls Begin Version 1.1.5
{
global $SID, $phpEx, $topic_title, $forum_name;
// if url contains a session we won't rewrite
if ( !empty($SID) && !preg_match('#sid=#', $url) )
{
$url .= ( ( strpos($url, '?') !== false ) ? ( ( $non_html_amp ) ? '&' : '&' ) : '?' ) . $SID;
return $url;
}
//
// USERSETTINGS BEGIN
//
// replace "true" with "false" to deactivate seo urls
$seo_active = true;
// Disallow rewritting for:
// - specific url parms (f.e. 'mode=confirm', )
// - files (f.e. "memberlist.$phpEx", )
// - folders (f.e. 'includes/', )
//
$seo_forbidden = array(
'login',
'mode=confirm',
'mark=topics',
'view=',
);
//
// USERSETTINGS END
//
// start rewritting if allowed
if ( $seo_active )
{
foreach ( $seo_forbidden as $forbidden )
{
if ( $url == $forbidden || strpos($url, $forbidden) !== false )
{
$seo_active = false;
break;
}
}
}
if ( !$seo_active || $url == './' )
{
return $url;
}
elseif ( $seo_active && !defined('IN_ADMIN') )
{
// Hash Fix: If hash is in the given URL it is seperated. This is caused by some incompatibility of some false written mods
if (strpos($url, '#') !== false)
{
$hash = strstr($url, '#');
$url = substr($url, 0, strpos($url, '#'));
}
else
{
$hash = '';
}
// Jumpbox Fix
if ( strpos($url, 'viewforum') !== false && strpos($url, 'f=') === false )
{
return $url;
}
// Search Author's posts URL
if ( strpos($url, 'search_author') !== false )
{
$author_name = substr(strrchr($url, 'search_author='), 14);
if ( preg_match('#[^_a-zA-Z0-9-.]#', $author_name) )
{
return $url;
}
}
// Rewrite Urls
$url_amp = ( $non_html_amp ) ? '&' : '&';
$url_parms = array( (strpos($url, 'highlight=') !== false && $url{strlen($url)-1} == '=' ? $url_amp . 'highlight=' : ''), $url_amp . 'start=0', $url_amp . 'postdays=0', $url_amp . 'postorder=asc', $url_amp . 'topicdays=0', ".$phpEx?", ".$phpEx", '=', '&', '&');
$url_rparms = array( '', '', '', '', '', ',', '.html', ',', ',', ',');
$url = str_replace($url_parms, $url_rparms, $url);
$url = $url . ( strpos($url, '.html') !== false ? '' : '.html' );
// Title to url - forums and topics need special settings
if ( (!empty($forum_name) || !empty($seo_title) ) && strpos($url, 'viewforum') !== false )
{
$seo_title = empty($seo_title) ? $forum_name : $seo_title;
$seo_base = 'viewforum';
$seo_search = array($seo_base,'-,f,');
$seo_replace = array( '', '-f');
$seo_empty = 'forum';
}
elseif ( (!empty($topic_title) || !empty($seo_title) ) && strpos($url, 'viewtopic') !== false )
{
$seo_title = empty($seo_title) ? $topic_title : $seo_title;
$seo_base = 'viewtopic';
$seo_search = array($seo_base,'-,t,','-,p,');
$seo_replace = array( '', '-t', '-p');
$seo_empty = 'topic';
}
// Title to url - replace special chars and build url
if ( !empty($seo_base) && !empty($seo_title) && strpos($url, $seo_base) !== false )
{
// special chars
$char_search = array( 'Ö', 'Ä', 'Ü', 'ö', 'ä','à','é','è','í', 'ü', 'ß',' ','.',',','"','&','<', '>', '+','–','/','_', '&','---','--');
$char_replace = array('oe','ae','ue','oe','ae','a','e','e','i','ue','ss','-','-','-', '', 'und', '', '','und','-','-','-','und', '-', '-');
// generate url with title
$seo_title = str_replace($char_search, $char_replace, strtolower($seo_title) . '-');
if ( preg_match('#[^a-z0-9-]#', $seo_title) )
{
$seo_title = preg_replace('/\W/', '', $seo_title) . '-';
}
$url = $seo_title == '-' ? $seo_empty . $seo_title . $url : $seo_title . $url;
$url = str_replace($seo_search, $seo_replace, $url);
}
// Hash Fix
$url = $url . $hash;
}
return $url;
} // Seo Urls End