DDR爱好者之家 Design By 杰米
ubbcode.asp
复制代码 代码如下:
<%
Function UBBCode(strContent)
If isEmpty(strContent) Or isNull(strContent) Then
Exit Function
Else
dim regex,strMatch
set regex=new RegExp
regex.IgnoreCase =True
regex.Global=True
regex.Pattern="\[html\]((\r\n)?([\s\S]+?))\[\/html\]"
Set strMatchs=regex.Execute(strContent)
For Each strMatch in strMatchs
'response.write strMatch.SubMatches(3)
Randomize
rndID="runcode"&Int(100000 * Rnd)
strContent=Replace(strContent,strMatch.Value,"<br/><font color=red>HTML代码:</font><TEXTAREA style=""width:96%; height:300px;"" id="""&rndID&""" class=""htmlarea"">"&UBBFilter(HTMLDecode(strMatch.SubMatches(2)))& "</TEXTAREA><br/><INPUT onclick=""runEx('"&rndID&"')"" type=""button"" value=""运行此代码""/> <INPUT onclick=""doCopy("&rndID&")"" type=""button"" value=""复制此代码""/> <INPUT onclick=""doSave("&rndID&")"" type=""button"" value=""保存代码""/><br/> [Ctrl+A 全部选择 提示:你可先修改部分代码,再按运行]")
Next
Set strMatchs=nothing
'去空行
regex.pattern="\n[\s]*\r"
Set strMatchs=regex.Execute(strContent)
For Each strMatch in strMatchs
strContent=Replace(strContent,strMatch.Value,"")
Next
'代码块
regex.Pattern="\[code\]((\r\n)?([\s\S]+?))\[\/code\]"
Set strMatchs=regex.Execute(strContent)
For Each strMatch in strMatchs
Randomize
rndID="code"&Int(100000 * Rnd)
strContent=Replace(strContent,strMatch.Value,"<br/><div style=""float:left""><font color=green>CODE代码:</font></div><div style=""float:right;text-align:right;"">[<a href=""javascript:void(null)"" onclick=""doCopy("&rndID&")"">复制此代码</a>]</div><br/><div class=""codetextarea"" id="""&rndID&""">"&strMatch.SubMatches(2)&"</div>")
Next
Set strMatchs=nothing
'实现插入影音文件
regex.Pattern="\[(swf|wma|wmv|rm|ra|qt)(=\d*?|)(,\d*?|)\]([^<>]*?)\[\/(swf|wma|wmv|rm|ra|qt)\]"
Set strMatchs=regex.Execute(strContent)
dim strType,strWidth,strHeight,strSRC,TitleText
For Each strMatch in strMatchs
RAndomize
strType=strMatch.SubMatches(0)
if strType="swf" then
TitleText="<img src="/UploadFiles/2021-04-02/"> elseif strType="wma" then
TitleText="<img src=""> elseif strType="wmv" then
TitleText="<img src=""> elseif strType="rm" then
TitleText="<img src=""> elseif strType="ra" then
TitleText="<img src=""> elseif strType="qt" then
TitleText="<img src=""> end if
strWidth=strMatch.SubMatches(1)
strHeight=strMatch.SubMatches(2)
if (len(strWidth)=0) then
strWidth="400"
else
strWidth=right(strWidth,(len(strWidth)-1))
end if
if (len(strHeight)=0) then
strHeight="300"
else
strHeight=right(strHeight,(len(strHeight)-1))
end if
strSRC=strMatch.SubMatches(3)
rndID="temp"&Int(100000 * Rnd)
strContent= Replace(strContent,strMatch.Value,"<div class=""UBBPanel""><div class=""UBBTitle"">"&TitleText&"</div><div class=""UBBContent""><a id="""+rndID+"_href"" href=""javascript:MediaShow('"+strType+"','"+rndID+"','"+strSRC+"','"+strWidth+"','"+strHeight+"')""><img name="""+rndID+"_img"" src="/UploadFiles/2021-04-02/"> Next
Set strMatchs=nothing
regex.Pattern="(\[mid\])(.[^\]]*)\[\/mid\]"
strContent= regex.Replace(strContent,"<embed src="/UploadFiles/2021-04-02/">regex.pattern="<br>([\s| | ]*)?<br>"
strContent=regex.replace(strContent,"<br>")
strContent=replace(strContent,"&","&")
strContent=replace(strContent,"'","'")
strContent=replace(strContent,"","") '因为以前上传图片
set regex=nothing
end if
UBBCode=strContent
end function
%>
基本上来自pjhome
复制代码 代码如下:
<%
Function UBBCode(strContent)
If isEmpty(strContent) Or isNull(strContent) Then
Exit Function
Else
dim regex,strMatch
set regex=new RegExp
regex.IgnoreCase =True
regex.Global=True
regex.Pattern="\[html\]((\r\n)?([\s\S]+?))\[\/html\]"
Set strMatchs=regex.Execute(strContent)
For Each strMatch in strMatchs
'response.write strMatch.SubMatches(3)
Randomize
rndID="runcode"&Int(100000 * Rnd)
strContent=Replace(strContent,strMatch.Value,"<br/><font color=red>HTML代码:</font><TEXTAREA style=""width:96%; height:300px;"" id="""&rndID&""" class=""htmlarea"">"&UBBFilter(HTMLDecode(strMatch.SubMatches(2)))& "</TEXTAREA><br/><INPUT onclick=""runEx('"&rndID&"')"" type=""button"" value=""运行此代码""/> <INPUT onclick=""doCopy("&rndID&")"" type=""button"" value=""复制此代码""/> <INPUT onclick=""doSave("&rndID&")"" type=""button"" value=""保存代码""/><br/> [Ctrl+A 全部选择 提示:你可先修改部分代码,再按运行]")
Next
Set strMatchs=nothing
'去空行
regex.pattern="\n[\s]*\r"
Set strMatchs=regex.Execute(strContent)
For Each strMatch in strMatchs
strContent=Replace(strContent,strMatch.Value,"")
Next
'代码块
regex.Pattern="\[code\]((\r\n)?([\s\S]+?))\[\/code\]"
Set strMatchs=regex.Execute(strContent)
For Each strMatch in strMatchs
Randomize
rndID="code"&Int(100000 * Rnd)
strContent=Replace(strContent,strMatch.Value,"<br/><div style=""float:left""><font color=green>CODE代码:</font></div><div style=""float:right;text-align:right;"">[<a href=""javascript:void(null)"" onclick=""doCopy("&rndID&")"">复制此代码</a>]</div><br/><div class=""codetextarea"" id="""&rndID&""">"&strMatch.SubMatches(2)&"</div>")
Next
Set strMatchs=nothing
'实现插入影音文件
regex.Pattern="\[(swf|wma|wmv|rm|ra|qt)(=\d*?|)(,\d*?|)\]([^<>]*?)\[\/(swf|wma|wmv|rm|ra|qt)\]"
Set strMatchs=regex.Execute(strContent)
dim strType,strWidth,strHeight,strSRC,TitleText
For Each strMatch in strMatchs
RAndomize
strType=strMatch.SubMatches(0)
if strType="swf" then
TitleText="<img src="/UploadFiles/2021-04-02/"> elseif strType="wma" then
TitleText="<img src=""> elseif strType="wmv" then
TitleText="<img src=""> elseif strType="rm" then
TitleText="<img src=""> elseif strType="ra" then
TitleText="<img src=""> elseif strType="qt" then
TitleText="<img src=""> end if
strWidth=strMatch.SubMatches(1)
strHeight=strMatch.SubMatches(2)
if (len(strWidth)=0) then
strWidth="400"
else
strWidth=right(strWidth,(len(strWidth)-1))
end if
if (len(strHeight)=0) then
strHeight="300"
else
strHeight=right(strHeight,(len(strHeight)-1))
end if
strSRC=strMatch.SubMatches(3)
rndID="temp"&Int(100000 * Rnd)
strContent= Replace(strContent,strMatch.Value,"<div class=""UBBPanel""><div class=""UBBTitle"">"&TitleText&"</div><div class=""UBBContent""><a id="""+rndID+"_href"" href=""javascript:MediaShow('"+strType+"','"+rndID+"','"+strSRC+"','"+strWidth+"','"+strHeight+"')""><img name="""+rndID+"_img"" src="/UploadFiles/2021-04-02/"> Next
Set strMatchs=nothing
regex.Pattern="(\[mid\])(.[^\]]*)\[\/mid\]"
strContent= regex.Replace(strContent,"<embed src="/UploadFiles/2021-04-02/">regex.pattern="<br>([\s| | ]*)?<br>"
strContent=regex.replace(strContent,"<br>")
strContent=replace(strContent,"&","&")
strContent=replace(strContent,"'","'")
strContent=replace(strContent,"","") '因为以前上传图片
set regex=nothing
end if
UBBCode=strContent
end function
%>
基本上来自pjhome
DDR爱好者之家 Design By 杰米
广告合作:本站广告合作请联系QQ:858582 申请时备注:广告合作(否则不回)
免责声明:本站资源来自互联网收集,仅供用于学习和交流,请遵循相关法律法规,本站一切资源不代表本站立场,如有侵权、后门、不妥请联系本站删除!
免责声明:本站资源来自互联网收集,仅供用于学习和交流,请遵循相关法律法规,本站一切资源不代表本站立场,如有侵权、后门、不妥请联系本站删除!
DDR爱好者之家 Design By 杰米
暂无评论...
更新日志
2024年11月25日
2024年11月25日
- 凤飞飞《我们的主题曲》飞跃制作[正版原抓WAV+CUE]
- 刘嘉亮《亮情歌2》[WAV+CUE][1G]
- 红馆40·谭咏麟《歌者恋歌浓情30年演唱会》3CD[低速原抓WAV+CUE][1.8G]
- 刘纬武《睡眠宝宝竖琴童谣 吉卜力工作室 白噪音安抚》[320K/MP3][193.25MB]
- 【轻音乐】曼托凡尼乐团《精选辑》2CD.1998[FLAC+CUE整轨]
- 邝美云《心中有爱》1989年香港DMIJP版1MTO东芝首版[WAV+CUE]
- 群星《情叹-发烧女声DSD》天籁女声发烧碟[WAV+CUE]
- 刘纬武《睡眠宝宝竖琴童谣 吉卜力工作室 白噪音安抚》[FLAC/分轨][748.03MB]
- 理想混蛋《Origin Sessions》[320K/MP3][37.47MB]
- 公馆青少年《我其实一点都不酷》[320K/MP3][78.78MB]
- 群星《情叹-发烧男声DSD》最值得珍藏的完美男声[WAV+CUE]
- 群星《国韵飘香·贵妃醉酒HQCD黑胶王》2CD[WAV]
- 卫兰《DAUGHTER》【低速原抓WAV+CUE】
- 公馆青少年《我其实一点都不酷》[FLAC/分轨][398.22MB]
- ZWEI《迟暮的花 (Explicit)》[320K/MP3][57.16MB]