- function unHtml(content)
- unHtml=content
- if content <> "" then
- unHtml=replace(unHtml,"&","&")
- unHtml=replace(unHtml,"<","<")
- unHtml=replace(unHtml,">",">")
- unHtml=replace(unHtml,chr(34),""")
- unHtml=replace(unHtml,chr(13),"<br>")
- unHtml=replace(unHtml,chr(32)," ")
- 'unHtml=ubb(unHtml)
- end if
- end function
- function ubb(content)
- Dim nowtime,i
- ubb=content
- nowtime=now()
- UBB=Convert(ubb,"code")
- UBB=Convert(ubb,"html")
- UBB=Convert(ubb,"url")
- UBB=Convert(ubb,"color")
- UBB=Convert(ubb,"font")
- UBB=Convert(ubb,"size")
- UBB=Convert(ubb,"quote")
- UBB=Convert(ubb,"email")
- UBB=Convert(ubb,"img")
- UBB=Convert(ubb,"swf")
- UBB=AutoURL(ubb)
- ubb=replace(ubb,"[b]","<b>",1,-1,1)
- ubb=replace(ubb,"[/b]","</b>",1,-1,1)
- ubb=replace(ubb,"[i]","<i>",1,-1,1)
- ubb=replace(ubb,"[/i]","</i>",1,-1,1)
- ubb=replace(ubb,"[u]","<u>",1,-1,1)
- ubb=replace(ubb,"[/u]","</u>",1,-1,1)
- ubb=replace(ubb,"[blue]","<font color='#000099'>",1,-1,1)
- ubb=replace(ubb,"[/blue]","</font>",1,-1,1)
- ubb=replace(ubb,"[red]","<font color='#990000'>",1,-1,1)
- ubb=replace(ubb,"[/red]","</font>",1,-1,1)
- for i=1 to 28
- ubb=replace(ubb,"{:em"&i&"}","<IMG SRC=emot/emotface/em"&i&".gif></img>",1,6,1)
- ubb=replace(ubb,"{:em"&i&"}","",1,-1,1)
- next
- ubb=replace(ubb,"["&chr(176),"[",1,-1,1)
- ubb=replace(ubb,chr(176)&"]","]",1,-1,1)
- ubb=replace(ubb,"/"&chr(176),"/",1,-1,1)
- ' ubb=replace(ubb,"{;em","{:em",1,-1,1)
- end function
- function Convert(ubb,CovT)
- Dim cText,startubb,endubb,Lcovt,text,codetext
- cText=ubb
- startubb=1
- do while Covt="url" or Covt="color" or Covt="font" or Covt="size"
- startubb=instr(startubb,cText,"["&CovT&"=",1)
- if startubb=0 then exit do
- endubb=instr(startubb,cText,"]",1)
- if endubb=0 then exit do
- Lcovt=Covt
- startubb=startubb+len(lCovT)+2
- text=mid(cText,startubb,endubb-startubb)
- codetext=replace(text,"[","["&chr(176),1,-1,1)
- codetext=replace(codetext,"]",chr(176)&"]",1,-1,1)
- 'codetext=replace(codetext,"{:em","{;em",1,-1,1)
- codetext=replace(codetext,"/","/"&chr(176),1,-1,1)
- select case CovT
- case "color"
- cText=replace(cText,"[color="&text&"]","<font color='"&text&"'>",1,1,1)
- cText=replace(cText,"[/color]","</font>",1,1,1)
- case "font"
- cText=replace(cText,"[font="&text&"]","<font face='"&text&"'>",1,1,1)
- cText=replace(cText,"[/font]","</font>",1,1,1)
- case "size"
- if IsNumeric(text) then
- if text>6 then text=6
- if text<1 then text=1
- cText=replace(cText,"[size="&text&"]","<font size='"&text&"'>",1,1,1)
- cText=replace(cText,"[/size]","</font>",1,1,1)
- end if
- case "url"
- cText=replace(cText,"[url="&text&"]","<a href='"&codetext&"' target=_blank>",1,1,1)
- cText=replace(cText,"[/url]","</a>",1,1,1)
- case "email"
- cText=replace(cText,"["&CovT&"="&text&"]","<a href=mailto:"&text&">",1,1,1)
- cText=replace(cText,"[/"&CovT&"]","</a>",1,1,1)
- end select
- loop
- startubb=1
- do
- startubb=instr(startubb,cText,"["&CovT&"]",1)
- if startubb=0 then exit do
- endubb=instr(startubb,cText,"[/"&CovT&"]",1)
- if endubb=0 then exit do
- Lcovt=Covt
- startubb=startubb+len(lCovT)+2
- text=mid(cText,startubb,endubb-startubb)
- codetext=replace(text,"[","["&chr(176),1,-1,1)
- codetext=replace(codetext,"]",chr(176)&"]",1,-1,1)
- 'codetext=replace(codetext,"{:em","{;em",1,-1,1)
- codetext=replace(codetext,"/","/"&chr(176),1,-1,1)
- select case CovT
- case "url"
- cText=replace(cText,"["&CovT&"]"&text,"<a href='"&codetext&"' target=_blank>"&codetext,1,1,1)
- cText=replace(cText,"<a href='"&codetext&"' target=_blank>"&codetext&"[/"&CovT&"]","<a href="&codetext&" target=_blank>"&codetext&"</a>",1,1,1)
- case "email"
- cText=replace(cText,"["&CovT&"]","<a href=mailto:"&text&">",1,1,1)
- cText=replace(cText,"[/"&CovT&"]","</a>",1,1,1)
- case "html"
- codetext=replace(codetext,"<br>",chr(13),1,-1,1)
- codetext=replace(codetext," ",chr(32),1,-1,1)
- Randomize
- rid="temp"&Int(100000 * Rnd)
- cText=replace(cText,"{html}"&text,"代码片断如下:<TEXTAREA id="&rid&" rows=15 style='width:100%' class='bk'>"&codetext,1,1,1)
- cText=replace(cText,"代码片断如下:<TEXTAREA id="&rid&" rows=15 style='width:100%' class='bk'>"&codetext&"{/html}","代码片断如下:<TEXTAREA id="&rid&" rows=15 style='width:100%' class='bk'>"&codetext&"</TEXTAREA><INPUT onclick=runEx('"&rid&"') type=button value=运行此段代码 name=Button1 class='Tips_bo'> <INPUT onclick=JM_cc('"&rid&"') type=button value=复制到我的剪贴板 name=Button2 class='Tips_bo'>",1,1,1)
- case "img"
- cText=replace(cText,"[img]"&text,"<a href="&chr(34)&"about:<img src="&codetext&" border=0>"&chr(34)&" target=_blank><img src="&codetext,1,1,1)
- cText=replace(cText,"[/img]"," vspace=2 hspace=2 border=0 alt=::点击图片在新窗口中打开::></a>",1,1,1)
- case "code"
- cText=replace(cText,"[code]"&text,"以下内容为程序代码<hr noshade>"&codetext,1,1,1)
- cText=replace(cText,"以下内容为程序代码<hr noshade>"&codetext&"[/code]","以下内容为程序代码<hr noshade>"&codetext&"<hr noshade>",1,1,1)
- case "quote"
- atext=replace(text,"[img]","",1,-1,1)
- atext=replace(atext,"[/img]","",1,-1,1)
- atext=replace(atext,"[swf]","",1,-1,1)
- atext=replace(atext,"[/swf]","",1,-1,1)
- atext=replace(atext,"{html}","",1,-1,1)
- atext=replace(atext,"{/html}","",1,-1,1)
- ' atext=replace(atext,"{:em","{;em",1,-1,1)
- atext=SplitWords(atext,350)
- atext=replace(atext,chr(32)," ",1,-1,1)
- cText=replace(cText,"[quote]"&text,"<blockquote><hr noshade>"&atext,1,1,1)
- cText=replace(cText,"<blockquote><hr noshade>"&atext&"[/quote]","<blockquote><hr noshade>"&atext&"<hr noshade></blockquote>",1,1,1)
- case "swf"
- cText=replace(cText,"[swf]"&text,"影片地址:<br>"&text&"<br><object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0' width='500' height='500'><param name=movie value='"&codetext&"'><param name=quality value=high><embed src='"&codetext&"' quality=high pluginspage='http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash' type='application/x-shockwave-flash' width='500' height='500'>",1,1,1)
- cText=replace(cText,"<object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0' width='500' height='500'><param name=movie value='"&codetext&"'><param name=quality value=high><embed src='"&codetext&"' quality=high pluginspage='http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash' type='application/x-shockwave-flash' width='500' height='500'>"&"[/swf]","<object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0' width='500' height='500'><param name=movie value='"&codetext&"'><param name=quality value=high><embed src='"&codetext&"' quality=high pluginspage='http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash' type='application/x-shockwave-flash' width='500' height='500'>"&"</embed></object>",1,1,1)
- end select
- loop
- Convert=cText
- end function
asp的ubb函数代码(推荐)
2020-07-06 15:30脚本之家 正则表达式
推荐给大家一款不错的asp的ubb函数代码,有需要的可以参考下
延伸 · 阅读
- 2021-10-20关于ASP网页无法打开的解决方案
- 2021-10-14让apache也支持asp环境的方法
- 2021-08-15asp取整数mod 有小数的就自动加1
- 2021-08-15asp与php中定时生成页面的思路与代码
- 2021-05-09IIS 7.5 asp Session超时时间设置方法
- 2021-03-05js实现的类似于asp数据字典的数据类型代码实例
- 正则表达式
谈谈我对正则表达式的认识
正则表达式(Regular Expression)是一个概念,一种语法、句法的约定。每一种具体的语句(C#,Java,JavaScript)有其对于正则表达式的具体实现,并且会有差别。...
- 正则表达式
DW 查找某字符串前的所有字符的正则表达式
我使用DW 这个所见所得的编辑器来写html时,喜欢写上注释,如 等等的注释,在一次比较大的改动时,需要批量查找替换,为了批量操作,于是...
- 正则表达式
PHP 正则 email语句详解
PHP正则校验email的代码相信好好学过PHP的人都应该知道下面这段用于eamil校验的语句,但是真正能看懂的就不多了。...
- 正则表达式
php与javascript正则匹配中文的方法分析
这篇文章主要介绍了php与javascript正则匹配中文的方法,结合实例形式分析了针对utf-8与GBK编码情况下的php、javascript正则匹配中文操作技巧,需要的朋友可以参...
- 正则表达式
PHP匹配多行的正则表达式分析
PHP匹配多行的正则表达式分析,需要的朋友可以参考下,多用于采集替换等。...
- 正则表达式
UBB代码在论坛中的应用
UBB代码是HTML的一个变种。一般情况下,UBB论坛不允许你使用HTML代码,而只能用UBB代码替代HTML代码。...
- 正则表达式
JavaScript 正则表达式验证函数代码
上篇文章《JavaScript验证正则表达式大全》说的是javascript中使用的正则表达式的例子,但是没有说这些正则表达式如何使用,现在给大家几个例子,大家可...
- 正则表达式
正则替换实现输入框只能有数字、中英文逗号
最近在开发过程中,需要一个输入框里面只能有数字与中英文逗号,因为是相关文章,其它的也不让出现,容易造成问题,编程容易把介绍复制到里面,所...