Файл: world-faces.ru/world-faces.ru/sys/fnc/bbcode.php
Строк: 90
<?
function bbcodehightlight($arr)
{
$arr[0]=html_entity_decode($arr[0], ENT_QUOTES, 'UTF-8');
return '<div class="cit" style="overflow:scroll;clip:auto;max-width:480px;">'.preg_replace('#<code>(.*?)</code>#si', '\1' ,highlight_string($arr[0],1)).'</div>'."n";
}
function BBcode($msg)
{
$bbcode = array(
'/[url](.+)[/url]/isU'=>'<a href="$1">$1</a>',
'/[url=(.+)](.+)[/url]/isU'=>'<a href="$1">$2</a>',
'/[i](.+)[/i]/isU' => '<em>$1</em>',
'/[b](.+)[/b]/isU' => '<strong>$1</strong>',
'/<b>(.+)</b>/isU' => '<strong>$1</strong>',
'/[u](.+)[/u]/isU' => '<span style="text-decoration:underline;">$1</span>',
'/[ut](.+)[/ut]/isU' => '<span style="border-bottom: 1px dotted;">$1</span>',
'/[xx-small](.+)[/xx-small]/isU' => '<span style="font-size:xx-small;">$1</span>',
'/[x-small](.+)[/x-small]/isU' => '<span style="font-size:x-small;">$1</span>',
'/[in](.+)[/in]/isU' => '<input type="text" value="$1" />',
'/[das](.+)[/das]/isU' => '<span style="border:1px dashed;">$1</span>',
'/[marq](.+)[/marq]/isU' => '<marquee>$1</marquee>',
'/[c](.+)[/c]/isU' => '<center>$1</center>',
'/[sol](.+)[/sol]/isU' => '<span style="border:1px solid;">$1</span>',
'/[ex](.+)[/ex]/isU' => '<span style="text-decoration:line-through;">$1</span>',
'/[up](.+)[/up]/isU' => '<span style="text-decoration:overline;">$1</span>',
'/[bl](.+)[/bl]/isU' => '<span style="text-decoration:blink;">$1</span>',
'/[dot](.+)[/dot]/isU' => '<span style="border:1px dotted;">$1</span>',
'/[scr-w](.+)[/scr-w]/isU' => '<span style="background-color:#ffffff;"><span style="color:#ffffff;"><span style="border:1px dashed;">$1</span></span></span>',
'/[scr-b](.+)[/scr-b]/isU' => '<span style="background-color:#000000;"><span style="color:#000000;"><span style="border:1px dashed;">$1</span></span></span>',
'/[dou](.+)[/dou]/isU' => '<span style="border:3px double #E1E1E4;">$1</span>',
'/[dou](.+)[/dou]/isU' => '<span style="border:3px double #E1E1E4;">$1</span>',
'/[big](.+)[/big]/isU' => '<span style="font-size:large;">$1</span>',
'/[small](.+)[/small]/isU' => '<span style="font-size:small;">$1</span>',
'/[code](.+)[/code]/isU' => '<code>$1</code>',
'/[f=([0-9]+)/([0-9]+)/([0-9]+)](.+)[/f]/isU' => "<a href='/forum/$1/$2/$3'>$4</a>",
'/[u=([0-9]+)](.+)[/u]/isU' => "<a href='/info.php?id=$1'>$2</a>",
'/[red](.+)[/red]/isU' => '<span style="color:#ff0000;">$1</span>',
'/[yellow](.+)[/yellow]/isU' => '<span style="color:#ffff22;">$1</span>',
'/[green](.+)[/green]/isU' => '<span style="color:#00bb00;">$1</span>',
'/[blue](.+)[/blue]/isU' => '<span style="color:#0000bb;">$1</span>',
'/[white](.+)[/white]/isU' => '<span style="color:#ffffff;">$1</span>',
'/[size=([0-9]+)](.+)[/size]/isU' => '<span style="font-size:$1px;">$2</span>',
'/[img](.+)[/img]/isU' => '<img src="$1" alt="" />',
);
$msg= preg_replace(array_keys($bbcode), array_values($bbcode), $msg);
$msg=preg_replace_callback('#<?(.*?)?>#sui', 'bbcodehightlight', $msg);
$msg=preg_replace('#[code](.*?)[/code]#si', '1', $msg);
return $msg;
}
?>