|
|
Administrator
|
Posts: 1104
Join Date: Mar 2005
|
In code/functions.php, function: format_bbcodes.
Replace the current function, with this one:
function format_bbcodes($text)
{
global $lang;
$search = array(
'[b]','[/b]','[B]','[/B]','[i]','[/i]','[I]','[/I]','[u]','[/u]','[U]','[/U]');
$replace = array(
'<strong>','</strong>','<strong>','</strong>','<em>','</em>','<em>','</em>','<u>','</u>','<u>','</u>');
$text = str_replace($search, $replace, $text);
$search = array(
'#\[email\](.*?)\[/email\]#i',
'#\[email=(.*?)\](.*?)\[/email\]#i',
'#\[url=(http|https|ftp)://(.+?)\](.+?)\[/url\]#ie',
'#\[url\](http|https|ftp)://(.+?)\[/url\]#ie',
'#\[code\]#i',
'#\[/code\]#i',
'#\[quote\]#i',
'#\[quote=(.*?)\]#i',
'#\[/quote\]#i',
'#\[img\](http|https|ftp)://(.*?)\[/img\]#i'
);
$replace = array(
'<a href="mailto:\\1">\\1</a>',
'<a href="mailto:\\1">\\2</a>',
'trunc_url(\'\\1://\\2\',\'\\3\')',
'trunc_url(\'\\1://\\2\',\'\\1://\\2\')',
'<div class="code"><b>'.$lang['code'].': </b><br><br>',
'</div>',
'<div class="quote"><b>'.$lang['quote'].': </b><br>',
'<div class="quote"><b>'.$lang['quoting'].' \\1</b><br>',
'</div>',
'<img src="\\1://\\2" alt="\\1://\\2">'
);
return preg_replace($search, $replace, $text);
}
Basically, I've changed the order of formatting, placing the img tag from first to last.
|