chat.asp
<%Response.Buffer=True%>
<!--#include file="config.asp"-->
<!--#include file="jlconn.asp"-->
<!--#include file="../inc/myconnection.inc"-->
<%
if Session("MM_Username")="" then
Response.Redirect("/zhuce/dl_wdl.htm")
end if
'写入交流数据库,确定管理身份
Session.timeout=60
set rs =server.createobject("adodb.recordset")
sql="select * from [user] where name='"&Session("logname")&"'"
rs.open sql,jlconn,3,3
if rs.eof and rs.bof then
rs.addnew
set rs1 =server.createobject("adodb.recordset")
sql="select a3,a6,a9,b1 from zhuce where a1='"&Session("MM_Username")&"'"
rs1.open sql,myconnection,1,1
rs("name")=rs1("a3")
rs("lianxi")=rs1("a6")+" "+rs1("a9")
rs("jianjie")=left(rs1("b1"),255)
rs("logintime")=Now()
rs.update
session("zl")="parent.f1.document.writeln(' "&Session("logname")&"简介:"&rs("jianjie")&"<br> "&Session("logname")&"联系:"&rs("lianxi")&"<P>');"
set rs1=nothing
set myconnection=nothing
else
session("zl")="parent.f1.document.writeln(' "&Session("logname")&"简介:"&rs("jianjie")&"<br> "&Session("logname")&"联系:"&rs("lianxi")&"<P>');"
'session("zl")=rs("jianjie")+
jlconn.execute("update [user] set logintime=Now() where name='"&Session("logname")&"'")
if rs(2)=True then '双重严重管理权限
chatmatname=split(mastername,"|")
for i=0 to UBound(chatmatname)
if Session("logname")=chatmatname(i) then
session("chatadmin")=True
exit for
end if
next
end if
end if
if Application("chat_line")="" then
Dim sd_init(200)
for i=0 to 197
sd_init(i)=0
next
sd_init(198)=1
sd_init(199)="数组初化成功!"
Application("chat_sd")=sd_init
Application("chat_line")=0
Application("onlinelist")=""
end if
session("chat_line")=Application("chat_line")
session("now")=now()
session("0")=0
if Instr(Application("onlinelist"),Session("logname")&" ")=0 then
Application.lock
Application("onlinelist")=Application("onlinelist")&Session("logname")&" "
Application.UnLock
if session("0")=0 then
Application.lock
sd=Application("chat_sd")
Application("chat_line")=(Application("chat_line"))+1
Dim newsd(200)
j=0
for i=3 to 200 step 3
newsd(j)=sd(i)
newsd(j+1)=sd(i+1)
j=j+2
next
newsd(198)=Application("chat_line")
newsd(199)="parent.getmsg('"&Session("logname")&"','大家','对','【公告】<a href=javascript:parent.seluser(\'"&Session("logname")&"\'); target=f2>"&Session("logname")&"</a>如风一样飘进了"&chatname&"!<bgsound src=type.wav loop=1>','2','AA00CC','AA00CC','0','"&now()&"<br>'); "
Application("chat_sd")=newsd
Application.UnLock
end if
session("0")=1
end if
ph = Request.ServerVariables("SCRIPT_NAME")
ph = Left(ph, Len(ph) - 8)
%>
<html>
<head>
<title><%=chatname%></title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<script language=javascript>
var username='<%=Session("logname")%>';
var autoScroll=1;
var lheight=140;
var fsize=10.5;
var bgcolor='#99ccff';
var chatimage='1';
var tbclu='true'
var ph = "<%=ph%>";
var masklist=' ';
function modifyname(str){username=str;}
function getname(){return username;}
function listmask(){f6.location.href='mask.asp?masklist='+masklist;}
function mask(un){if(masklist.indexOf(' '+un+' ')==-1){masklist=masklist+un+' ';}else{var regexp=eval('/ '+un+' /gi');masklist=masklist.replace(regexp,' ');}}
function getmasklist(){return(masklist);}
function cbg(){return bgcolor;}
function cbi(){ return ph + chatimage;}
function scrollit(){if(!parent.f2.document.af.as.checked){autoScroll=0;}else{autoScroll=1;parent.f1.autoscrollnow();parent.f0.autoscrollnow();}}
function getuser(){return username;}
function seluser(str){parent.f2.document.af.towho.value=str;parent.f2.document.af.msg.focus();}
function write()
{
parent.f1.document.open();
parent.f1.document.writeln("<html><head><title>分屏显示</title><meta http-equiv=Content-Type content=\"text/html; charset=gb2312\">");
parent.f1.document.writeln("<style type=text/css>.p{font-size:20pt}.l{line-height:" + lheight + "%}.t{color:Fshowmsg0FF;font-size:9pt;}body{font-family:\"宋体\";font-size:" + fsize + "pt;line-height:" + lheight + "%}INPUT{BORDER-TOP-WIDTH: 1px; BORDER-LEFT-WIDTH: 1px; FONT-SIZE: 9pt; BORDER-BOTTOM-WIDTH: 1px; BACKGROUND-COLOR: #efefef; BORDER-RIGHT-WIDTH: 1px}A{text-decoration:none}div{background:#fdf5e6;line-height:" + lheight + "%}td{font-family:\"宋体\";font-size:" + fsize + "pt;}A:Hover{text-decoration:underline}A:visited{color:blue}</style></head>");
parent.f1.document.writeln("<body topmargin=3 bgcolor=#eeeeee>");
parent.f1.document.writeln("<\script>function autoscrollnow(){this.scroll(0,65000);}<\/script>");
parent.f1.document.writeln("<span class=l><font color=red>【系统提示】</font>欢迎【"+username+"】光临<%=chatname%>!</span><br>");
}
function getmsg(str1,str2,str3,str4,str5,str6,str7,str8,str9,str10,str11)
{
if(masklist.indexOf(' '+str1+' ')!=-1 && str2==username){return false}
if (str1==username)
{var zj="【<a href=javascript:parent.seluser('"+str1+"'); target=f2><font color="+str6+">我</font></a>】";}
else
{var zj="<a href=javascript:parent.seluser('"+str1+"'); target=f2><font color="+str6+">"+str1+"</font></a>";}
if (str2==username)
{var br="【<a href=javascript:parent.seluser('"+str2+"'); target=f2><font color="+str6+">我</font></a>】";}
else
{var br="<a href=javascript:parent.seluser('"+str2+"'); target=f2><font color="+str6+">"+str2+"</font></a>";}
msg=zj+str3+br+"说:<font color=red size=1pt>("+str9+")</font><br><font color="+str7+">"+str4+"</font><br>"
//私聊
if (str8=='1' && str11!='1'){msg="<font color=red>〖私聊〗</font>"+zj+str3+br+"说:<font color=red size=1pt>("+str9+")</font><br><font color="+str7+">"+str4+"</font><br>";}else{saystr=zj+str2+br+"说:<font color=red size=1pt>("+str9+")</font><br><font color="+str7+">"+str4+"</font><br>";}
//公告
if (str10=='1'){msg="<span class=l><font color=red>【系统提示】</font><font color="+str7+">"+str4+"</font></span>";}
//查看资料
if (str8=='1' && str11=='1'){msg="<span class=l><font color=red>〖用户资料查询〗</font><font color="+str7+">"+str4+"</font></span>";}
//动作
if (str5=='2') {
msg=str4
}
else
{
if (str5=='1'){for(th=1;th<4;th++){if(str1 == username){str4 = str4.replace("##", zj );}else{str4 = str4.replace("##", zj);}
if(str2 == username){str4 = str4.replace("%%", "<a href=javascript:parent.seluser('"+str2+"'); target=_parent><font color=red>【" + str2 + "】</font></a>");}else{str4 = str4.replace("%%", "<a href=javascript:parent.seluser('"+str2+"'); target=_parent><font color=FF0099>" + str2 + "</font></a>");}}
msg="<font color=008800>【动作】</font>"+zj+"<font color="+str7+">"+str4+"</font>";}
}
if (str8=='1' & (str1!=username && str2!=username)){return false}
if (str2==username)(msg=msg+"<bgsound src=type.wav loop=1>")
if ((tbclu=='true') && (str1==username || str2==username))
{parent.f1.document.writeln(msg)
if (autoScroll==1) {parent.f1.autoscrollnow();}
}
else
{parent.f0.document.writeln(msg)
if (autoScroll==1) {parent.f0.autoscrollnow();}
}
}
//分屏
function tbclutch()
{
if (tbclu=='true') {
this.msgfrm.rows="*,0";tbclu='false';
}
else
{
this.msgfrm.rows="1*,1*";tbclu='true';
}
this.f2.document.af.msg.focus();
}
</script>
</head>
<frameset cols="*,180" border="0" framespacing="0" >
<frameset rows="*,150,0,0" cols="*" border="0" framespacing="0">
<frame src="about:blank" name="f1">
<frame src="di.asp" name="f2" noresize scrolling="NO">
<frame src="about:blank" name="f3" noresize frameborder="NO" scrolling="NO">
<frame src="getmsg.asp" name="f4" noresize frameborder="NO" scrolling="NO">
</frameset>
<frameset rows="0,*,150,0" cols="*" border="0" framespacing="0">
<frame src="about:blank" name="f5" noresize frameborder="NO" scrolling="NO">
<frame src="left.asp" name="f6" noresize>
<frame src="cd.asp" name="f7" noresize scrolling="NO">
<frame src="about:blank" name="f8" noresize frameborder="NO" scrolling="NO">
</frameset>
</frameset>
<noframes><body bgcolor="#FFFFFF" text="#000000">
</body></noframes>
</html>
<iframe name="tmp"></iframe>
<br><input type="checkbox" name="box">No Scroll
<script language="JavaScript">
setInterval("tmp.document.writeln(new Date().toLocaleString()+'<br>');if(!box.checked)tmp.document.body.scrollTop = tmp.document.body.scrollHeight;",1000);
</script>