',
'\\[spoiler=([A-z0-9_\. -]+)\\]' => '
');
foreach($bbcodes as $bbcode => $bbcodehtml)
{ $text = eregi_replace($bbcode,$bbcodehtml,$text); }
if ($cfg['parser_vid'])
{
$bbcodes = array(
'\\[youtube=([^\\[]*)\\]' => '
',
'\\[googlevideo=([^\\[]*)\\]' => '
',
'\\[metacafe=([^\\[]*)\\]' => '
');
foreach($bbcodes as $bbcode => $bbcodehtml)
{ $text = eregi_replace($bbcode,$bbcodehtml,$text); }
}
$bbcodes = array(
'\\[colleft\\]([^\\[]*)\\[/colleft\\]' => '
\\1
',
'\\[colright\\]([^\\[]*)\\[/colright\\]' => '
\\1
',
'\\[center\\]([^\\[]*)\\[/center\\]' => '
\\1
',
'\\[right\\]([^\\[]*)\\[/right\\]' => '
\\1
',
'\\[left\\]([^\\[]*)\\[/left\\]' => '
\\1
',
'\\[c1\\:([^\\[]*)\\]([^\\[]*)\\[c2\\:([^\\[]*)\\]([^\\[]*)\\[c3\\]' => '
'
);
foreach($bbcodes as $bbcode => $bbcodehtml)
{ $text = eregi_replace($bbcode,$bbcodehtml,$text); }
return(substr($text,1));
}
/* ------------------ */
function sed_bbcode_autourls($text)
{
$text = ' '.$text;
$text = preg_replace("#([\n ])([a-z0-9]+?)://([^\t \n\r]+)#i", "\\1[url]\\2://\\3[/url]", $text);
$text = preg_replace("#([\n ])([a-z0-9-_.]+?@[A-z0-9-]+\.[^,\t \n\r]+)#i", "\\1[email]\\2[/email]", $text);
return(substr($text,1));
}
/* ------------------ */
function sed_bbcode_urls($text)
{
global $cfg;
$bbcodes = array(
'\\[img\\]([^\\\'\;\?([]*)\.(jpg|jpeg|gif|png)\\[/img\\]' => '\\1.\\2',
'\\[thumb=([^\\\'\;\?([]*)\.(jpg|jpeg|gif|png)\\]([^\\[]*)\.(jpg|jpeg|gif|png)\\[/thumb\\]' => '\\1.\\2',
'\\[pfs]([^\\[]*)\\[/pfs\\]' => $cfg['pfs_dir'].'\\1',
);
foreach($bbcodes as $bbcode => $bbcodehtml)
{ $text = eregi_replace($bbcode,$bbcodehtml,$text); }
return($text);
}
/* ------------------ */