聊天室实现私聊第1/4页(2)


session("action")=request.form("action") 
if instr(usersays,chr(39))>0 then 
usersays=replace(usersays,chr(39),"\"&chr(39)) 
end if 
if instr(usersays,chr(34))>0 then 
usersays=replace(usersays,chr(34),"\"&chr(34)) 
end if 

application.lock 

'定义一个交谈缓冲区,后面将给大家仔细分析一下 

dim chats(20) 
for n=1 to 20 
chats(n)=application("chats")(n) 
next 
username=request.Form("user") 


usertime=Time 
usertime="("&right(usertime,8)&")" 
user_whoto=request.Form("whoto") 
user_action=request.Form("action") 
if application("counter")>19 then 
application("counter")=0 
end if 
'不是耳语就加一 
if request.form("action")<>"耳语" then 
application("counter")=application("zj_1counter")+1 
counter=application("zj_1counter") 
'用户的动作处理 

select case request.FORM("action") 
case "说话" 
if request.FORM("whoto")="ALL" then 
chats(counter)="<font color=blue>"&usertime&"</font> <font color=black>"&username&"</font> :<font color=#0000aa> "&usersays&"</font><BR><BR>" 
else 
chats(counter)="<font color=blue>"&usertime&"</font> <font color=black>"&username&"</font> <I>与<font color=#00bb00> "&request.FORM("whoto")&" </font>说</I>:<font color=#0000aa> "&usersays&"</font><BR><BR>" 
end if 
case "叫嚷" 
chats(counter)="<font color=blue>"&usertime&"</font> <font color=black>"&username&"</font> <I>冲<font color=#00bb00> "&request.FORM("whoto")&" </font>大叫</I>:<B><font color=#0000aa> "&usersays&"</font></B><BR><BR>" 
case "亲亲" 
chats(counter)="<font color=blue>"&usertime&"</font> <font color=black>"&username&"</font> <I>亲了亲<font color=#00bb00> "&request.FORM("whoto")&" </font>的脸颊</I>:<font color=#0000aa> "&usersays&"</font><BR><BR>" 
case "拥抱" 
chats(counter)="<font color=blue>"&usertime&"</font> <font color=black>"&username&"</font> <I>轻轻的抱着<font color=#00bb00> "&request.FORM("whoto")&" </font></I>:<font color=#0000aa> "&usersays&"</font><BR><BR>" 
case "暴怒" 
chats(counter)="<font color=blue>"&usertime&"</font> <font color=black>"&username&"</font> <I>朝<font color=#00bb00> "&request.FORM("whoto")&" </font>横眉竖目道</I>:<font color=#0000aa> "&usersays&"</font><BR><BR>" 

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:http://www.heiqu.com/3670.html