?? main.asp
字號:
<!--#include file="config.asp"-->
<!--#include file="functions.asp"-->
<%
if session("loginstatus")<>"logined" or session("userid")="" or session("grade")="" then
response.write "<script language='javascript'>"&vbcrlf
response.write "<!--"&vbcrlf
response.write "top.window.location.href='index.asp?ntime="&ntime&"';"&vbcrlf
response.write "//-->"&vbcrlf
response.write "</script>"&vbcrlf
response.end
end if
%>
<!--#include file="conn.asp"-->
<%
if request.querystring("act")<>"login" then
sql="select * from userinfo where isonline=true and userid='"&session("userid")&"'"
rs.open sql,conn,0,1
if rs.eof and rs.bof then
rs.close
set rs=nothing
conn.close
set conn=nothing
session("loginstatus")=""
session("userid")=""
session("grade")=""
response.write "<script language='javascript'>"&vbcrlf
response.write "<!--"&vbcrlf
response.write "top.window.location.href='index.asp';"&vbcrlf
response.write "//-->"&vbcrlf
response.write "</script>"&vbcrlf
response.end
else
sql="update userinfo set timecount=timecount+"&datediff("n",rs("logintime"),now())&",logintime=#"&now&"# where isonline=true and userid='"&session("userid")&"'"
rs.close
conn.execute(sql)
end if
end if
%>
<html>
<head>
<meta http-equiv="refresh" content="15;URL=<%=selfname%>?ntime=<%=ntime%>">
<meta http-equiv="Content-Type" content="text/html;charset=gb2312">
<title><%=pagetitle%>--聊天內容顯示頁面</title>
<script language="javascript">
<!--
function setobj(obj)
{
for (i=1; i<parent.chatform.document.forms[0].object.length; i++)
{
var iscontinue=true;
if (parent.chatform.document.forms[0].object.options[i].value==obj)
{
parent.chatform.document.forms[0].object.selectedIndex = i;
iscontinue=false;
break;
}
}
if (iscontinue==true)
{
var oOption = parent.chatform.document.createElement('OPTION');
parent.chatform.document.forms[0].object.add(oOption, 1);
parent.chatform.document.forms[0].object.options[1].value=obj;
parent.chatform.document.forms[0].object.options[1].text=obj;
parent.chatform.document.forms[0].object.selectedIndex=1;
parent.chatform.document.forms[0].putwords_temp.focus();
}
}
function gotop(isrefresh)
{
if (window==top)
{
top.location.href="chat.asp?ntime=<%=ntime%>";
}
}
//-->
</script>
<style type="text/css">
<!--
input,body,table{font-size:12px}
body{width:120px;text-align:left;padding:6px 0 0 12px;vertical-align:center;background:#f6f6f6 url(images/bgbrick.gif)}
td{word-break:break-all}
form{margin:0;padding:0}
a{color:#333390;text-decoration:none}
a:hover{color:#ff3333;text-decoration:underline}
#announce{text-align:center;font-weight:600;color:#<%=colorS%>}
.emtxt{color:#900000;font-weight:600}
.announce{color:#ff3333;font-weight:600}
.usrname{font-style:italic;cursor:hand;}
-->
</style>
<%
putwords=request.form("putwords")
if request.form("formsubmit")="發送" and trim(putwords)<>"" then
putwords=unhtml(putwords)
if session("grade")>=gradeimg then
putwords=ubbimg(putwords)
end if
if session("grade")>=gradeurl then
putwords=ubburl(putwords)
end if
putwords=fbdwords(putwords,forbidwords)
ispublic=request.form("ispublic")
textcolor=request.form("textcolor")
userface=request.form("userface")
if ispublic<>"false" then
ispublic="true"
end if
toobject=request.form("object")
sql="select top 1 num from chatinfo order by puttime asc"
rs.open sql,conn,0,1
if session("grade")>=gradebulletin and left(putwords,10)="[bulletin]" then
putwords=mid(putwords,11,len(putwords)-10)
sql="update chatinfo set userid='',sayto='',saycontent='"&replace(trim(putwords),"'","''")&"',textcolor='"&replace(textcolor,"'","''")&"',userface='"&replace(userface,"'","''")&"',ispublic=true"
else
sql="update chatinfo set userid='"&session("userid")&"',sayto='"&replace(toobject,"'","''")&"',saycontent='"&replace(trim(putwords),"'","''")&"',textcolor='"&replace(textcolor,"'","''")&"',userface='"&replace(userface,"'","''")&"',ispublic="&ispublic
end if
sql=sql&",puttime=#"&now()&"# where num="&rs(0)
rs.close
conn.execute(sql)
end if
response.write "</head>"&vbcrlf
response.write "<body onload='gotop()'>"&vbcrlf
response.write "<div id='announce'><script language='javascript'>"&vbcrlf&"if(top!=window)"&vbcrlf&"{"&vbcrlf&"bulletintxt=top.online.document.title;"&vbcrlf&"if(bulletintxt.substr(0,8)=='沒有可以顯示的頁')"&vbcrlf&"top.online.window.location.href='online.asp';"&vbcrlf&"else"&vbcrlf&"document.write(top.online.document.title);"&vbcrlf&"}"&vbcrlf&"</script></div>"&vbcrlf
response.write "<hr width=""100%""><br>"&vbcrlf
sql="select top "&maxrecordnum&" userid,sayto,saycontent,textcolor,userface,ispublic,puttime from chatinfo where puttime>#"&dateadd("s",(0-5*sessionout),now())&"# order by puttime desc"
rs.open sql,conn,0,1
if not(rs.bof and rs.eof) then
chatinfodata=rs.getrows()
rs.close
set rs=nothing
conn.close
set conn=nothing
chatinfonum=ubound(chatinfodata,2)
for i=0 to chatinfonum
if chatinfodata(5,i)=true or chatinfodata(1,i)="" or chatinfodata(1,i)="大家" then
if chatinfodata(0,i)="" then
response.write "<span class='announce'>〖"&pagetitle&"〗公告 : "&chatinfodata(2,i)&" ("&FormatDateTime(chatinfodata(6,i),3)&")</span><br>"&vbcrlf
else
response.write "<font color='#"&chatinfodata(3,i)&"'><span class='usrname' onclick=""setobj('"&chatinfodata(0,i)&"')"">"&chatinfodata(0,i)&"</span> 對 <span class='usrname' onclick=""setobj('"&chatinfodata(1,i)&"')"">"&chatinfodata(1,i)&"</span> "&chatinfodata(4,i)&" <b>>></b> "&chatinfodata(2,i)&" ("&FormatDateTime(chatinfodata(6,i),3)&")</font><br>"&vbcrlf
end if
elseif chatinfodata(0,i)=session("userid") or chatinfodata(1,i)=session("userid") then
response.write "<font color='#"&chatinfodata(3,i)&"'><b><span class='usrname' onclick=""setobj('"&chatinfodata(0,i)&"')"">"&chatinfodata(0,i)&"</span> 悄悄的對 <span class='usrname' onclick=""setobj('"&chatinfodata(1,i)&"')"">"&chatinfodata(1,i)&"</span> "&chatinfodata(4,i)&" <b>>></b> "&chatinfodata(2,i)&" ("&FormatDateTime(chatinfodata(6,i),3)&")</b></font><br>"&vbcrlf
end if
next
else
rs.close
set rs=nothing
conn.close
set conn=nothing
end if
%>
<!--#include file="incfoot.asp"-->
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -