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

📄 process.asp

📁 基于asp的 班级同学录主页源代码
💻 ASP
字号:
<%
dim WINNT_CHINESE
function strLength(str)
ON ERROR RESUME NEXT
dim WINNT_CHINESE
WINNT_CHINESE	= (len("论坛")=2)
if WINNT_CHINESE then
dim l,t,c
dim i
l=len(str)
t=l
for i=1 to l
c=asc(mid(str,i,1))
if c<0 then c=c+65536
if c>255 then
t=t+1
end if
next
strLength=t
else
strLength=len(str)
end if
if err.number<>0 then err.clear
end function
function isInteger(para)
on error resume next
dim str
dim l,i
if isNUll(para) then
isInteger=false
exit function
end if
str=cstr(para)
if trim(str)="" then
isInteger=false
exit function
end if
l=len(str)
for i=1 to l
if mid(str,i,1)>"9" or mid(str,i,1)<"0" then
isInteger=false
exit function
end if
next
isInteger=true
if err.number<>0 then err.clear
end function
rem ------------ubb代码
function ChkBadWords(fString)
bwords = split(BadWords, "|")
for i = 0 to ubound(bwords)
fString = Replace(fString, bwords(i), string(len(bwords(i)),"爱"), 1,-1,1)
next
ChkBadWords = fString
end function

function doCode(fString, fOTag, fCTag, fROTag, fRCTag)
fOTagPos = Instr(1, fString, fOTag, 1)
fCTagPos = Instr(1, fString, fCTag, 1)
while (fCTagPos > 0 and fOTagPos > 0)
fString = replace(fString, fOTag, fROTag, 1, 1, 1)
fString = replace(fString, fCTag, fRCTag, 1, 1, 1)
fOTagPos = Instr(1, fString, fOTag, 1)
fCTagPos = Instr(1, fString, fCTag, 1)
wend
doCode = fString
end function

function HTMLEncode(fString)

fString = replace(fString, ">", "&gt;")
fString = replace(fString, "<", "&lt;")

fString = Replace(fString, CHR(13), "")
fString = Replace(fString, CHR(10) & CHR(10), "</P><P>")
fString = Replace(fString, CHR(10), "<BR>")
HTMLEncode = fString
end function

function HTMLDecode(fString)

fString = replace(fString, "&gt;", ">")
fString = replace(fString, "&lt;", "<")

fString = Replace(fString, "", CHR(13))
fString = Replace(fString, "</P><P>", CHR(10) & CHR(10))
fString = Replace(fString, "<BR>", CHR(10))
HTMLDecode = fString
end function

function HTMLDecode1(fString)

fString = replace(fString, "&gt;", ">")
fString = replace(fString, "&lt;", "<")
fString = Replace(fString, "", CHR(13))
fString = Replace(fString, "</P><P>", CHR(10) & CHR(10))
fString = Replace(fString, "<BR>", CHR(10))
HTMLDecode1 = fString
end function


function UBBCode(strContent)
on error resume next
if strAllowHTML <> "1" then
strContent = HTMLEncode(strContent)
end if
if strIcons = "1" then
for i=1 to 28
if len(i)=1 then i="0"&i end if
strContent=replace(strContent,"[em"&i&"]","<IMG SRC=pic/em"&i&".gif></img>")
strContent=replace(strContent,"[em"&i&"]","")
next
end if
dim objRegExp
Set objRegExp=new RegExp
objRegExp.IgnoreCase =true
objRegExp.Global=True
do while instr(strcontent,"[/url]")>0
strcontent1= left(strcontent,instr(strcontent,"[/url]")+5)
strcontent2 = right(strcontent,len(strcontent)-instr(strcontent,"[/url]")-5)

objRegExp.Pattern="(\[url\])(.*)(\[\/url\])"
strcontent1= objRegExp.Replace(strcontent1,"<A HREF=""$2"" TARGET=_blank>$2</A>")

objRegExp.Pattern="(\[url=(.*)\])(.*)(\[\/url\])"
strcontent1= objRegExp.Replace(strcontent1,"<A HREF=""$2"" TARGET=_blank>$3</A>")
strcontent=strcontent1&strcontent2
loop
do while instr(strcontent,"[/email]")>0
strcontent1= left(strcontent,instr(strcontent,"[/email]")+7)
strcontent2 = right(strcontent,len(strcontent)-instr(strcontent,"[/email]")-7)
objRegExp.Pattern="(\[EMAIL\])(.*)(\[\/EMAIL\])"
strContent1= objRegExp.Replace(strContent1,"<A HREF=""mailto:$2"">$2</A>")
objRegExp.Pattern="(\[EMAIL=(.*)\])(.*)(\[\/EMAIL\])"
strContent1= objRegExp.Replace(strContent1,"<A HREF=""mailto:$2"" TARGET=_blank>$3</A>")
strcontent=strcontent1&strcontent2
loop
if strflash= "1" then
do while instr(strcontent,"[/flash]")>0
strcontent1= left(strcontent,instr(strcontent,"[/flash]")+7)
strcontent2 = right(strcontent,len(strcontent)-instr(strcontent,"[/flash]")-7)
objRegExp.Pattern="(\[FLASH\])(.*)(\[\/FLASH\])"
strContent1= objRegExp.Replace(strContent1,"<OBJECT classid=clsid:166B1BCA-3F9C-11CF-8075-444553540000 codebase=http://download.macromedia.com/pub/shockwave/cabs/director/sw.cab#version=8,0,0,0 width=500 height=400><PARAM NAME=movie VALUE=""$2""><PARAM NAME=quality VALUE=high><embed src=""$2"" quality=high pluginspage='http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash' type='application/x-shockwave-flash' width=500 height=400><br>$2</embed></OBJECT>")
strcontent=strcontent1&strcontent2
loop
end if

if strIcons = "1" then
objRegExp.Pattern="(\[em(.+?)\])"
strContent=objRegExp.Replace(strContent,"<img src=pic/em$2.gif border=0 align=middle>")
'		strContent= smile(strContent)
end if

if strIMGInPosts = "1" then
do while instr(strcontent,"[/img]")>0
strcontent1= left(strcontent,instr(strcontent,"[/img]")+5)
strcontent2 = right(strcontent,len(strcontent)-instr(strcontent,"[/img]")-5)
objRegExp.Pattern="(\[IMG\])(.*)(\[\/IMG\])"
strContent1=objRegExp.Replace(strContent1,"<IMG SRC=""$2"" border=0>")
strcontent=strcontent1&strcontent2
loop
end if

do while instr(strcontent,"[/html]")>0
strcontent1= left(strcontent,instr(strcontent,"[/html]")+6)
strcontent2 = right(strcontent,len(strcontent)-instr(strcontent,"[/html]")-6)
objRegExp.Pattern="(\[HTML\])(.*)(\[\/HTML\])"
strContent1=objRegExp.Replace(strContent1,"<SPAN><IMG src=pic/code.gif align=absBottom> HTML 代码片段如下:<BR><TEXTAREA style=""WIDTH: 94%; BACKGROUND-COLOR: #f7f7f7"" name=textfield rows=10>$2</TEXTAREA><BR><INPUT onclick=runEx() type=button value=运行此代码 name=Button> [Ctrl+A 全部选择   提示:你可先修改部分代码,再按运行]</SPAN><BR>")
strcontent=strcontent1&strcontent2
loop
do while instr(strcontent,"[/color]")>0
strcontent1= left(strcontent,instr(strcontent,"[/color]")+7)
strcontent2 = right(strcontent,len(strcontent)-instr(strcontent,"[/color]")-7)
objRegExp.Pattern="(\[color=(.*)\])(.*)(\[\/color\])"
strContent1=objRegExp.Replace(strConten1t,"<font color=$2>$3</font>")
strcontent=strcontent1&strcontent2
loop
do while instr(strcontent,"[/face]")>0
strcontent1= left(strcontent,instr(strcontent,"[/face]")+6)
strcontent2 = right(strcontent,len(strcontent)-instr(strcontent,"[/face]")-6)
objRegExp.Pattern="(\[face=(.*)\])(.*)(\[\/face\])"
strContent1=objRegExp.Replace(strContent1,"<font face=$2>$3</font>")
strcontent=strcontent1&strcontent2
loop
do while instr(strcontent,"[/align]")>0
strcontent1= left(strcontent,instr(strcontent,"[/align]")+7)
strcontent2 = right(strcontent,len(strcontent)-instr(strcontent,"[/align]")-7)
objRegExp.Pattern="(\[align=(.*)\])(.*)(\[\/align\])"
strContent1=objRegExp.Replace(strContent1,"<div align=$2>$3</div>")
strcontent=strcontent1&strcontent2
loop

do while instr(strcontent,"[/quote]")>0
strcontent1= left(strcontent,instr(strcontent,"[/quote]")+7)
strcontent2 = right(strcontent,len(strcontent)-instr(strcontent,"[/quote]")-7)
objRegExp.Pattern="(\[QUOTE\])(.*)(\[\/QUOTE\])"
strContent1=objRegExp.Replace(strContent1,"<BLOCKQUOTE><font size=1 face=""Verdana, Arial"">quote:</font><HR>$2<HR></BLOCKQUOTE>")
strcontent=strcontent1&strcontent2
loop
do while instr(strcontent,"[/fly]")>0
strcontent1= left(strcontent,instr(strcontent,"[/fly]")+5)
strcontent2 = right(strcontent,len(strcontent)-instr(strcontent,"[/fly]")-5)         	
objRegExp.Pattern="(\[fly\])(.*)(\[\/fly\])"
strContent1=objRegExp.Replace(strContent1,"<marquee width=90% behavior=alternate scrollamount=3>$2</marquee>")
strcontent=strcontent1&strcontent2
loop
do while instr(strcontent,"[/move]")>0
strcontent1= left(strcontent,instr(strcontent,"[/move]")+6)
strcontent2 = right(strcontent,len(strcontent)-instr(strcontent,"[/move]")-6)
objRegExp.Pattern="(\[move\])(.*)(\[\/move\])"
strContent1=objRegExp.Replace(strContent1,"<MARQUEE scrollamount=3>$2</marquee>")
strcontent=strcontent1&strcontent2
loop
do while instr(strcontent,"[/glow]")>0
strcontent1= left(strcontent,instr(strcontent,"[/glow]")+6)
strcontent2 = right(strcontent,len(strcontent)-instr(strcontent,"[/glow]")-6)
objRegExp.Pattern="(\[glow=(.*),(.*),(.*)\])(.*)(\[\/glow\])"
strContent1=objRegExp.Replace(strContent1,"<table width=$2 style=""filter:glow(color=$3, strength=$4)"">$5</table>")
strcontent=strcontent1&strcontent2
loop
do while instr(strcontent,"[/SHADOW]")>0
strcontent1= left(strcontent,instr(strcontent,"[/SHADOW]")+8)
strcontent2 = right(strcontent,len(strcontent)-instr(strcontent,"[/SHADOW]")-8)
objRegExp.Pattern="(\[SHADOW=(.*),(.*),(.*)\])(.*)(\[\/SHADOW\])"
strContent1=objRegExp.Replace(strContent1,"<table width=$2 style=""filter:shadow(color=$3, direction=$4)"">$5</table>")
strcontent=strcontent1&strcontent2
loop
do while instr(strcontent,"[/i]")>0
strcontent1= left(strcontent,instr(strcontent,"[/i]")+3)
strcontent2 = right(strcontent,len(strcontent)-instr(strcontent,"[/i]")-3)
objRegExp.Pattern="(\[i\])(.*)(\[\/i\])"
strContent1=objRegExp.Replace(strContent1,"<i>$2</i>")
strcontent=strcontent1&strcontent2
loop

do while instr(strcontent,"[/u]")>0
strcontent1= left(strcontent,instr(strcontent,"[/u]")+3)
strcontent2 = right(strcontent,len(strcontent)-instr(strcontent,"[/u]")-3)
objRegExp.Pattern="(\[u\])(.*)(\[\/u\])"
strContent1=objRegExp.Replace(strContent1,"<u>$2</u>")
strcontent=strcontent1&strcontent2
loop

do while instr(strcontent,"[/b]")>0
strcontent1= left(strcontent,instr(strcontent,"[/b]")+3)
strcontent2 = right(strcontent,len(strcontent)-instr(strcontent,"[/b]")-3)
objRegExp.Pattern="(\[b\])(.*)(\[\/b\])"
strContent1=objRegExp.Replace(strContent1,"<b>$2</b>")
strcontent=strcontent1&strcontent2
loop

do while instr(strcontent,"[/size]")>0
strcontent1= left(strcontent,instr(strcontent,"[/size]")+6)
strcontent2 = right(strcontent,len(strcontent)-instr(strcontent,"[/size]")-6)
objRegExp.Pattern="(\[size=1\])(.*)(\[\/size\])"
strContent1=objRegExp.Replace(strContent1,"<font size=1>$2</font>")
objRegExp.Pattern="(\[size=2\])(.*)(\[\/size\])"
strContent1=objRegExp.Replace(strContent1,"<font size=2>$2</font>")
objRegExp.Pattern="(\[size=3\])(.*)(\[\/size\])"
strContent1=objRegExp.Replace(strContent1,"<font size=3>$2</font>")
objRegExp.Pattern="(\[size=4\])(.*)(\[\/size\])"
strContent1=objRegExp.Replace(strContent1,"<font size=4>$2</font>")
strcontent=strcontent1&strcontent2
loop

do while instr(strcontent,"[/center]")>0
strcontent1= left(strcontent,instr(strcontent,"[/center]")+8)
strcontent2 = right(strcontent,len(strcontent)-instr(strcontent,"[/center]")-8)
objRegExp.Pattern="(\[center\])(.*)(\[\/center\])"
strContent1=objRegExp.Replace(strContent1,"<center>$2</center>")
strcontent=strcontent1&strcontent2
loop
strContent = doCode(strContent, "[list]", "[/list]", "<ul>", "</ul>")
strContent = doCode(strContent, "[list=1]", "[/list]", "<ol type=1>", "</ol id=1>")
strContent = doCode(strContent, "[list=a]", "[/list]", "<ol type=a>", "</ol id=a>")
strContent = doCode(strContent, "[*]", "[/*]", "<li>", "</li>")
strContent = doCode(strContent, "[code]", "[/code]", "<pre id=code><font size=1 face=""Verdana, Arial"" id=code>", "</font id=code></pre id=code>")

strContent=ChkBadWords(strContent)

set objRegExp=Nothing
UBBCode=strContent
end function
%>

⌨️ 快捷键说明

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