日期:2014-05-20  浏览次数:21043 次

50分题~求一份UUB的JS代码~ 越完整的越好~ 拿来论坛发表中用~在线等
UUB的JS代码~   越完整的越好~   本人拿来自己用于自己开发的论坛中~~希望有心人士给予提供~   ~没办法~   CSDN里面好像没有JAVASCRIPT专区~   只能在这里发了~

------解决方案--------------------
#region UBB代码
public static string UBB(string content, int type)
{
// for(int i=1;i <30;i++)//懒得加那么多笑脸图片了
// {
// content = content.Replace( "[em "+i+ "] ", " <IMG SRC=\ "ubb/face/em "+i+ ".gif\ "> ");
// }
content = Regex.Replace(content, @ "\[center\](? <x> [^\]]*)\[/center\] ", @ " <center> $1 </center> ", RegexOptions.IgnoreCase);
content = Regex.Replace(content, @ "\[url=(? <x> [^\]]*)\](? <y> [^\]]*)\[/url\] ", @ " <a href=$1 target=_blank> $2 </a> ", RegexOptions.IgnoreCase);
content = Regex.Replace(content, @ "\[email\](? <x> [^\]]*)\[/email\] ", @ " <a href=mailto:$1> $1 </a> ", RegexOptions.IgnoreCase);
content = Regex.Replace(content, @ "\[flash](? <x> [^\]]*)\[/flash\] ", @ " <OBJECT codeBase=http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0 classid=clsid:D27CDB6E-AE6D-11cf-96B8-444553540000 width=500 height=400> <PARAM NAME=movie VALUE= " "$1 " "> <PARAM NAME=quality VALUE=high> <embed src= " "$1 " " quality=high pluginspage= 'http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash ' type= 'application/x-shockwave-flash ' width=500 height=400> $1 </embed> </OBJECT> ", RegexOptions.IgnoreCase);
content = Regex.Replace(content, @ "\[img](? <x> [^\]]*)\[/img] ", @ " <IMG SRC= " "$1 " " border=0> ", RegexOptions.IgnoreCase);
content = Regex.Replace(content, @ "\[color=(? <x> [^\]]*)\](? <y> [^\]]*)\[/color\] ", @ " <font color=$1> $2 </font> ", RegexOptions.IgnoreCase);
content = Regex.Replace(content, @ "\[face=(? <x> [^\]]*)\](? <y> [^\]]*)\[/face\] ", @ " <font face=$1> $2 </font> ", RegexOptions.IgnoreCase);
content = Regex.Replace(content, @ "\[size=(? <x> [^\]]*)\](? <y> [^\]]*)\[/size\] ", @ " <font size=$1> $2 </font> ", RegexOptions.IgnoreCase);
content = Regex.Replace(content, @ "\[align=(? <x> [^\]]*)\](? <y> [^\]]*)\[/align\] ", @ " <div align=$1> $2 </div> ", RegexOptions.IgnoreCase);
content = Regex.Replace(content, @ "\[fly](? <x> [^\]]*)\[/fly\] ", @ " <marquee width=90% behavior=alternate scrollamount=3> $1 </marquee> ", RegexOptions.IgnoreCase);
content = Regex.Replace(content, @ "\[move](? <x> [^\]]*)\[/move\] ", @ " <marquee scrollamount=3> $1 </marquee> ", RegexOptions.IgnoreCase);
content = Regex.Replace(content, @ "\[glow=(? <x> [^\]]*),(? <y> [^\]]*),(? <z> [^\]]*)\](? <w> [^\]]*)\[/glow\] ", @ " <table width=$1 style= " "filter:glow(color=$2, strength=$3) " "> $4 </table> ", RegexOptions.IgnoreCase);
content = Regex.Replace(content, @ "\[shadow=(? <x> [^\]]*),(? <y> [^\]]*),(? <z> [^\]]*)\](? <w> [^\]]*)\[/shadow\] ", @ " <table width=$1 style= " "filter:shadow(color=$2, strength=$3) " "> $4 </table> ", RegexOptions.IgnoreCase);
content = Regex.Replace(content, @ "\[b\](? <x> [^\]]*)\[/b\] ", @ " <b> $1 </b> ", RegexOptions.IgnoreCase);