Буду переделывать к такому виду
while (preg_match("#\[(q|quote)(|=([^\[\]]+?))\](?!.*\[\\1(|=([^\[\]]+?))\])(.+?)\[/\\1\]#is", $string, $matches))
{
$title = ($matches[3] !== '') ? $matches[3].' пишет:':'Цитата:';
$string = str_replace($matches[0],"<div class=\"quotetop\"> <b>{$title}</b></div><div class=\"quotemain\">{$matches[6]}</div>", $string);
} while (preg_match("#\[(q|quote)(|=([^\[\]]+?))\](?!.*\[\\1(|=([^\[\]]+?))\])(.+?)\[/\\1\]#is", $string, $matches))
{
$title = ($matches[3] !== '') ? 'Цитата: '.$matches[3].' говорил...':'Цитата:';
$string = str_replace($matches[0],"<div class=\"quotetop\"> <b>{$title}</b></div><blockquote>{$matches[6]}</blockquote>", $string);
}.quotetop{
background: #E4EAF2 url(im/quote.gif) no-repeat right top;
border: 1px dotted #000;
border-bottom: 0;
border-left: 4px solid #8394B2;
color: #000;
font-weight: bold;
font-size: 10px;
margin: 2px auto 0 auto;
padding: 3px;
}
.quotemain{
background: #FAFCFE;
border: 1px dotted #000;
border-left: 4px solid #8394B2;
border-top: 0;
color: #465584;
padding: 4px;
margin: 0 auto 0 auto;
}.quotetop {color: #666; font-size: x-small; font-weight: bold; padding: 0 0.3em;}
blockquote {
background: none repeat scroll 0 0;
font-family: arial;
font-size: 12px;
font-style: italic;
line-height: 1.45;
padding: 15px 38px;
position: relative;
box-shadow: 0 1px 2px rgba(0,0,0,0.25), 0 0 10px rgba(0,0,0,0.1) inset;
}
blockquote:before{
position:absolute;
margin-top:-33px;
margin-left:-30px;
content:url('im/webof.png');
}