📄 chatform.asp
字号:
<!--#include file="config.asp"-->
<!--#include file="conn.asp"-->
<%
if session("grade")>=gradekick then
s_commands="kick"&" "
end if
s_opencmds="sex view "
if session("grade")>=gradeupuser then
s_opencmds=s_opencmds&"upusergrade "
end if
%>
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" content="text/html; charset=gb2312">
<TITLE><%=pagetitle%>--聊天发言</TITLE>
<style type="text/css">
<!--
input,body,table{font-size:12px}
body{margin-top:12px;color:#ffffff;width:120px;background:#00aead url(images/chatformbg.jpg);text-align:center;vertical-align:center;}
form{margin:0;padding:0}
a{color:#000090;text-decoration:none}
a:hover{color:#ff3333;text-decoration:underline}
.button{background:#00aead;color:#000090;border:solid 1px #ffffff;width:100px;height:20px;margin:2px 0;padding-top:1px;}
-->
</style>
<script language="javascript">
<!--
function putpic()
{
var picurl=window.prompt("请输入图片的完整路径:","http://");
if (picurl!=null)
{
if(picurl.length<16||picurl.indexOf(".")<7||(picurl.indexOf(".gif")<7&&picurl.indexOf(".GIF")<7&&picurl.indexOf(".jpg")<7&&picurl.indexOf(".JPG")<7&&picurl.indexOf(".swf")<7&&picurl.indexOf(".SWF")<7))
{
alert("帖图路径不正确,请仔细检查!"+picurl.indexOf(".gif"));
}
else
{
document.forms[0].putwords_temp.value=document.forms[0].putwords_temp.value+"[img]"+picurl+"[/img]";
}
}
}
function putlink()
{
var linkurl=window.prompt("请输入超链接地址:","http://");
if (linkurl!=null&&linkurl!="http://")
{
document.forms[0].putwords_temp.value=document.forms[0].putwords_temp.value+"[url]"+linkurl+"[/url]";
}
}
function bulletinsub()
{
if(document.forms[0].putwords_temp.value!="")
{
document.forms[0].putwords.value='[bulletin]'+document.forms[0].putwords_temp.value;
document.forms[0].putwords_temp.value='';
document.forms[0].submit();
}
else
{
alert("请先填上作为公告发布的话语啊!");
}
}
function winopen(url,width,height)
{
cmdstr=document.forms[0].chattools.options[document.forms[0].chattools.selectedIndex].value;
if(cmdstr=="newusers"||cmdstr=="clicktop"||cmdstr=="onlinetop")
{
keystr=20;
window.open(url+"?act="+cmdstr+"&keystr="+keystr,"","toolbar=no,scrollbars=no,status=no,resizeables=no,location=no,width="+width+",height="+height);
}
else if(cmdstr=="regmoreinfo")
{
window.open("inforeg.asp","","toolbar=no,scrollbars=no,status=no,resizeables=no,location=no,width="+width+",height="+height);
}
<%if session("grade")>=gradetitle then%>
else if(cmdstr=="newannounce")
{
window.open("newchatsub.asp?ntime=<%=ntime%>","","toolbar=no,scrollbars=no,status=no,resizeables=no,location=no,width=260,height=150");
}
<%end if%>else if(cmdstr=="pwd")
{
keystr=window.prompt("请输入你的新密码:","");
if(keystr!=null&&keystr!="")
{
window.open(url+"?act="+cmdstr+"&keystr="+keystr,"","toolbar=no,scrollbars=no,status=no,resizeables=no,location=no,width="+width+",height="+height);
}
}
else if(cmdstr=="sex")
{
keystr=window.prompt("请输入你要更改成的性别(帅哥,靓妹 或 神秘人):","帅哥");
if(keystr=="帅哥"||keystr=="靓妹"||keystr=="神秘人")
{
window.open(url+"?act="+cmdstr+"&keystr="+keystr,"","toolbar=no,scrollbars=no,status=no,resizeables=no,location=no,width="+width+",height="+height);
}
else if(keystr!=null)
{
alert("对不起,性别只能是“帅哥”,“靓妹”,“神秘人”之一");
}
}
else
{
keystr=window.prompt("请输入聊友用户名:","");
if(null!=keystr)
{
window.open(url+"?act="+cmdstr+"&keystr="+keystr,"","toolbar=no,scrollbars=no,status=no,resizeables=no,location=no,width="+width+",height="+height);
}
}
document.forms[0].chattools.selectedIndex=0;
}
//-->
</script>
<script language="vbscript">
<!--
function norepeat_char(s_string,n_repeatlen)
n=1
issubmit=true
s_char=left(s_string,1)
if asc(s_char)>0 and asc(s_char)<255 then
n_step=1
else
n_step=2
end if
for i=1 to len(s_string)
s_nchar=mid(s_string,i,1)
if s_nchar=s_char then
n=n+n_step
else
s_char=mid(s_string,i,1)
if asc(s_char)>0 and asc(s_char)<255 then
n_step=1
else
n_step=2
end if
n=1
end if
if n>n_repeatlen then
issubmit=false
exit for
end if
next
norepeat_char=issubmit
end function
function valid_words()
if trim(document.forms(0).putwords_temp.value)="" then
msgbox("请您填上想说的话!")
valid_words=false
'elseif trim(document.forms(0).putwords_temp.value)<>document.forms(0).putwords_temp.value then
' msgbox("语句中不能包含空格!")
' valid_words=false
elseif document.forms(0).putwords_temp.value=trim(document.forms(0).putwords.value) then
document.forms(0).putwords_temp.value=""
msgbox("重复的话请不要发送多次!")
valid_words=false
elseif norepeat_char(document.forms(0).putwords_temp.value,46)=false then
msgbox("输入的连续相同的字符未免太多了点吧!")
valid_words=false
else
document.forms(0).putwords.value=trim(document.forms(0).putwords_temp.value)
document.forms(0).putwords_temp.value=""
valid_words=true
end if
document.forms(0).putwords_temp.focus()
end function
//-->
</script>
</head>
<body>
<form method="POST" action="main.asp" target="main" onsubmit="return valid_words()">
<table width="550" align="center">
<tr>
<td valign="top">
<p style="margin-top: 6; margin-bottom: 6">
<input type="hidden" name="formsubmit" value="发送">
颜色<select name="textcolor" style=font-size:12px>
<option style="color:#<%=colorA%>" value="<%=colorA%>">绝对黑色
<option style="color:#<%=colorB%>" value="<%=colorB%>">忧郁的蓝
<option style="color:#<%=colorC%>" value="<%=colorC%>">碧空蓝天
<option style="color:#<%=colorD%>" value="<%=colorD%>">灰蓝种族
<option style="color:#<%=colorE%>" value="<%=colorE%>">蔚蓝海洋
<option style="color:#<%=colorF%>" value="<%=colorF%>">清清之蓝
<option style="color:#<%=colorG%>" value="<%=colorG%>">发亮篮紫
<option style="color:#<%=colorH%>" value="<%=colorH%>">紫的拘谨
<option style="color:#<%=colorI%>" value="<%=colorI%>">卡其制服
<option style="color:#<%=colorJ%>" value="<%=colorJ%>">伦敦灰雾
<option style="color:#<%=colorK%>" value="<%=colorK%>">卡布其诺
<option style="color:#<%=colorL%>" value="<%=colorL%>">苦涩心红
<option style="color:#<%=colorM%>" value="<%=colorM%>">正宗喜红
<option style="color:#<%=colorN%>" value="<%=colorN%>">爱的暗示
<option style="color:#<%=colorO%>" value="<%=colorO%>">红的发紫
<option style="color:#<%=colorP%>" value="<%=colorP%>">红旗飘飘
<option style="color:#<%=colorQ%>" value="<%=colorQ%>">黄金岁月
<option style="color:#<%=colorR%>" value="<%=colorR%>">紫金绣贴
<option style="color:#<%=colorS%>" value="<%=colorS%>">橄榄树绿
<option style="color:#<%=colorT%>" value="<%=colorT%>">我不知道
</select>
表情<select name="userface" style=font-size:12px>
<option value="">请选择
<option value="笑着">笑着
<option value="高兴地">高兴地
<option value="含情脉脉">含情脉脉
<option value="微笑">微笑
<option value="幸福">幸福
<option value="有点脸红">有点脸红
<option value="使劲安慰">使劲安慰
<option value="自言自语">自言自语
<option value="差点要哭">差点要哭
<option value="嚎啕大哭">嚎啕大哭
<option value="一把鼻涕">一把鼻涕
<option value="很无辜">很无辜
<option value="流口水">流口水
<option value="神秘兮兮">神秘兮兮
<option value="幸灾乐祸">幸灾乐祸
<option value="很不服气">很不服气
<option value="不怀好意">不怀好意
<option value="拳打脚踢">拳打脚踢
<option value="不知所措">不知所措
<option value="翻箱倒柜">翻箱倒柜
<option value="很遗憾">很遗憾
<option value="很严肃">很严肃
<option value="善意警告">善意警告
<option value="正气凛然">正气凛然
<option value="哈欠连天">哈欠连天
<option value="小声讲">小声讲
<option value="大声喊叫">大声喊叫
<option value="尖叫一声">尖叫一声
<option value="遗憾地说">遗憾地说
<option value="无精打采">无精打采
<option value="想吐">想吐
<option value="真诚">真诚
<option value="不好意思">不好意思
<option value="高兴地唱">高兴地唱
<option value="轻轻地唱">轻轻地唱
<option value="很诧异">很诧异
<option value="依依不舍">依依不舍
</select>
聊天对象:<select name="object" style=font-size:12px>
<option value="大家">所有的人
<%
sql="select userid from userinfo where isonline=true order by userid asc"
rs.open sql,conn,0,1
do while not rs.eof
response.write "<option value='"&rs("userid")&"'>"&rs("userid")&vbcrlf
rs.movenext
loop
rs.close
set rs=nothing
conn.close
set conn=nothing
response.write "</select>"&vbcrlf
response.write " <input type=checkbox name='ispublic' value='false'>密谈 "&vbcrlf
response.write " <select name='chattools' style='width:95px' onchange=""winopen('chatcmd.asp',400,320)"">"&vbcrlf
response.write "<option selected>==工具箱=="&vbcrlf
response.write "<option value='newusers'>最新注册排行"&vbcrlf
response.write "<option value='clicktop'>最高人气排行"&vbcrlf
response.write "<option value='onlinetop'>上站时间排行"&vbcrlf
response.write "<option value='view'>聊友信息查询"&vbcrlf
response.write "<option value='sex'>更改我的性别"&vbcrlf
response.write "<option value='pwd'>更改登陆密码"&vbcrlf
response.write "<option value='regmoreinfo'>注册详细资料"&vbcrlf
if session("grade")>=gradekick then
response.write "<option value='kick'>踢人"&vbcrlf
end if
if session("grade")>=gradeupuser then
response.write "<option value='upusergrade'>提升用户等级"&vbcrlf
end if
if session("grade")>=gradetitle then
response.write "<option value='newannounce'>发布聊天主题"&vbcrlf
end if
%>
</select>
</p>
<input type="button" value="超链" <%if session("grade")<gradeurl then response.write "disabled "%>onclick="putlink()" onfocus="this.form.putwords_temp.focus();">
<input type="button" value="贴图" <%if session("grade")<gradeimg then response.write "disabled "%>onclick="putpic()" onfocus="this.form.putwords_temp.focus();">
<input type="hidden" name="putwords">
<input type="text" name="putwords_temp" size=41 maxlength=100>
<input type=submit name="submitwords" style="width:36px" value="发送">
<input type="button" value="公告发布" style="width:60px" <%if session("grade")<gradebulletin then response.write "disabled "%>onclick="bulletinsub()" onfocus="this.form.putwords_temp.focus();">
<input type="button" style="width:36px" value="退出" onclick="top.window.location.href='loginout.asp?ntime=<%=ntime%>';">
</td>
</tr></table>
</form>
<!--#include file="incfoot.asp"-->
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -