帮个忙,很急!~~~~~~~````
<?
foreach($flat_messages as $fmessage) {
$fmessage->name = htmlspecialchars($fmessage->name);
$fmessage->email = htmlspecialchars($fmessage->email);
$fmessage->subject = htmlspecialchars($fmessage->subject);
$fmessage->message = htmlspecialchars($fmessage->message);
$fmessage->message = str_replace("
","<div class=\"quote\">",$fmessage->message);
$fmessage->message = str_replace("
","</div>",$fmessage->message);
$fmessage->message = preg_replace("/(\[img\])(.*?)(\[\/img\])/s","<img src=\"
\\2\" border=\"0\" alt='点击查看原图' onload=\"if(this.width>screen.width-333) {this.width=screen.width-333;this.alt=\'点击查看原图!\';}\" onmouseover=\"if(this.alt) this.style.cursor=\'hand\';\" onclick=\"window.open(\'\\2\\');\">", $fmessage->message);
// urls
$fmessage->message = preg_replace("/(\[url\])(.*?)(\[\/url\])/s","<a href=\"
\\2",$fmessage->message'>\\2\">\\2</a>",$fmessage->message);
$fmessage->message = preg_replace("/\[url=(.*?)\](.*?)\[\/url\]/s","<a href=\"
\\2",$fmessage->message'>\\1\">\\2</a>",$fmessage->message);
// bold
$fmessage->message = preg_replace("/(\[b\])(.*?)(\[\/b\])/s","<strong>\\2</strong>",$fmessage->message);
// underline
$fmessage->message = preg_replace("/(\[u\])(.*?)(\[\/u\])/s","<u>\\2</u>",$fmessage->message);
// italic
$fmessage->message = preg_replace("/(\[i\])(.*?)(\[\/i\])/s","<em>\\2</em>",$fmessage->message);
reset($message_emoticons);
while (list($emo_txt,$emo_src)=each($message_emoticons))
{
$fmessage->message=str_replace($emo_txt,$emo_src,$fmessage->message);
}
?>
这段代码是我的PHP论坛上的代码。
请问这段代码是不是起到把UBB代码替换成HTML的,
我想论坛接受HTML代码型式。
该怎么办呢。。
帮帮我!~~~~