⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 char.asp

📁 新闻发布系统
💻 ASP
字号:
<%
'=========================================================
'产品目录:风讯产品N系列
'软件名称:风讯站点管理系统
'当前版本:2004.I.0225
'最新更新:2004.2.10
'=========================================================
'Copyright (C) 2002-2004 cooin.com. All rights reserved.
'网站: http://www.cooin.com  Foosun.net
'程序制作:轻风云(QQ:655071)
'Email:skeen@cooin.com,skeen@Foosun.net
'论坛支持:风讯在线论坛(http://bbs.cooin.com   http://bbs.foosun.net)
'=========================================================
ubb("[code]dsfsdf[/code]")
function unHtml(content)
unHtml=content
if content <> "" then
unHtml=replace(unHtml,"<","&lt;")
unHtml=replace(unHtml,">","&gt;")
unHtml=replace(unHtml,chr(13),"<br>")
unHtml=replace(unHtml,chr(32),"&nbsp;")
end if
end function

function Cen(content)
Cen=content
if content <> "" then
Cen=replace(Cen,chr(13),"<br>")
'Cen=replace(Cen,chr(32),"&nbsp;")
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,"align")
UBB=Convert(ubb,"http")
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,"rightimg")
UBB=Convert(ubb,"leftimg")
UBB=Convert(ubb,"swf")
UBB=Convert(ubb,"face")
UBB=Convert(ubb,"fly")
UBB=Convert(ubb,"rm")
UBB=Convert(ubb,"wmv")

ubb=replace(ubb,"[b]","<b>",1,-1,1)
ubb=replace(ubb,"[left]","<div align=left>",1,-1,1)
ubb=replace(ubb,"[/left]","</div>",1,-1,1)
ubb=replace(ubb,"[right]","<div align=right>",1,-1,1)
ubb=replace(ubb,"[/right]","</div>",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)
ubb=replace(ubb,"[center]","<center>",1,-1,1)
ubb=replace(ubb,"[/center]","</center>",1,-1,1)
ubb=replace(ubb,"[fly]","<marquee width=100% behavior=alternate scrollamount=3>",1,-1,1)
ubb=replace(ubb,"[/fly]","</marquee>",1,-1,1)
ubb=replace(ubb,"[move]","<MARQUEE scrollamount=3>",1,-1,1)
ubb=replace(ubb,"[/move]","</marquee>",1,-1,1)
ubb=replace(ubb,"[glow]","<table width=100% style=""filter:glow(color=red, strength=2)""><tr><td>",1,-1,1)
ubb=replace(ubb,"[/glow]","</td></tr></table>",1,-1,1)
ubb=replace(ubb,"[shadow]","<table width=100% style=""filter:shadow(color=blue, direction=1)""><tr><td>",1,-1,1)
ubb=replace(ubb,"[/shadow]","</td></tr></table>",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,startubb1,endubb1,text1
cText=ubb
startubb=1
startubb1=1
do while Covt="url" or Covt="face" or Covt="color" or Covt="font" or Covt="size" or Covt="http" or Covt="align"
startubb=instr(startubb,cText,"["&CovT&"=",1)
startubb1=instr(startubb1,cText,"["&CovT&"=",1)
if startubb=0 then exit do
if startubb1=0 then exit do
endubb=instr(startubb,cText,"]",1)
endubb1=instr(startubb1,cText,"[/"&CovT&"]",1)
if endubb=0 then exit do
if endubb1=0 then exit do
Lcovt=Covt
startubb=startubb+len(lCovT)+2
startubb1=startubb1+len(lCovT)+6
text=mid(cText,startubb,endubb-startubb)
text1=mid(cText,startubb1,endubb1-startubb1)
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 "http"
cText=replace(cText,"[http="&text&"]","<img src=../images/htm.gif board=0></img><a href='http://"&codetext&"' target=_blank>",1,1,1)
cText=replace(cText,"[/http]","</a>",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 "align"
cText=replace(cText,"[align="&text&"]","<div align ='"&text&"'>",1,1,1)
cText=replace(cText,"[/align]","</div>",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"

select case text
 case "htm"
  cText=replace(cText,"[url="&text&"]","<img src=../images/htm.gif board=0></img><a href='"&text1&"' target=_blank>",1,1,1)
  cText=replace(cText,"[/url]","</a>",1,1,1)
 case "zip"
  cText=replace(cText,"[url="&text&"]","<img src=../images/zip.gif board=0></img><a href='"&text1&"' target=_blank>",1,1,1)
  cText=replace(cText,"[/url]","</a>",1,1,1)
 case "doc"
  cText=replace(cText,"[url="&text&"]","<img src=../images/doc.gif board=0></img><a href='"&text1&"' target=_blank>",1,1,1)
  cText=replace(cText,"[/url]","</a>",1,1,1)
 case "rar"
  cText=replace(cText,"[url="&text&"]","<img src=../images/rar.gif board=0></img><a href='"&text1&"' target=_blank>",1,1,1)
  cText=replace(cText,"[/url]","</a>",1,1,1)
 case else
  cText=replace(cText,"[url="&text&"]","<img src=../images/htm.gif board=0></img><a href='"&text1&"' target=_blank>",1,1,1)
  cText=replace(cText,"[/url]","</a>",1,1,1)
end select

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,"/","/"&chr(176),1,-1,1)
if lcase(left(codetext,4))<>"http" and (lcase(left(codetext,3))<>"mms" And lcase(left(codetext,4))<>"rtsp") then
  codetext="http://"+codetext
end if
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 "http"
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 "align"
  cText=replace(cText,"["&CovT&"]"&text,"<align ='"&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) 
  cText=replace(cText,"[html]"&text,"代码片断如下:<form name=form><TEXTAREA name=rijcm rows=15 style='width:95%' class='bk'>"&codetext,1,1,1)
  cText=replace(cText,"代码片断如下:<form name=form><TEXTAREA name=rijcm rows=15 style='width:95%' class='bk'>"&codetext&"[/html]","代码片断如下:<form name=form><div align=right><TEXTAREA name=rijcm rows=15 style='width:95%' class='bk'>"&codetext&"</TEXTAREA><INPUT onclick=""displayHTML(this.form)"" type=button value=运行此段代码 name=Button1 class='Tips_bo'></div></form><SCRIPT LANGUAGE=""JavaScript""> function displayHTML(form) { var inf = form.rijcm.value; win = window.open(); win.document.write("""" + inf + """");}</SCRIPT>",1,1,1)
case "img"
  cText=replace(cText,"[img]"&text,"<div align=center><img src="&codetext,1,1,1)
  cText=replace(cText,"[/img]"," vspace=2 hspace=2 border=0> </div>",1,1,1)
case "leftimg"
  cText=replace(cText,"[leftimg]"&text,"<div align=left><img src="&codetext,1,1,1)
  cText=replace(cText,"[/leftimg]"," vspace=2 hspace=2 border=0> </div>",1,1,1)
case "rightimg"
  cText=replace(cText,"[rightimg]"&text,"<div align=right><img src="&codetext,1,1,1)
  cText=replace(cText,"[/rightimg]"," vspace=2 hspace=2 border=0> </div>",1,1,1)
case "code"
  cText=replace(cText,"[code]"&text,"以下内容为程序代码<hr noshade>"&codetext,1,1,1)
  cText=replace(cText,"以下内容为程序代码<hr noshade>"&codetext&"[/code]","以下内容为程序代码<div align=right><table border=0 cellpadding=0 cellspacing=1 width=95% bgcolor=#c0c0c0><tr><td width=100% bgcolor=#ffffff>"&codetext&"</td></tr></table></div>",1,1,1)
case "swf"
  cText=replace(cText,"[swf]"&text,"<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='250' height='250'><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='250' height='250'></embed></object>",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='250' height='250'><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='250' height='250'></embed></object>"&"[/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='250' height='250'>"&"</embed></object>",1,1,1)
case "rm"
  cText=replace(cText,"[rm]"&text,"<object classid=clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA height=294 id=RAOCX width=352><param name=SRC value="&codetext,1,1,1)
  cText=replace(cText,"[/rm]","><param name=""CONSOLE"" value=""Clip1""><param name=""CONTROLS"" value=""imagewindow""><param name=""AUTOSTART"" value=""true""></object>",1,1,1)
case "wmv"
  cText=replace(cText,"[wmv]"&text,"<object align=middle classid=CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95 class=OBJECT id=MediaPlayer width=300 height=300 ><param name=ShowStatusBar value=-1><param name=Filename value="&codetext,1,1,1)
  cText=replace(cText,"[/wmv]","><embed type=application/x-oleobject codebase=http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701 flename=mp src="&codetext&"  width=300 height=300></embed></object> ",1,1,1)

end select
loop
Convert=cText
end function
%>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -