📄 main.php
字号:
{
if(fm.to_user.value=="大家")
{
showNotice("您不能为〖<font color='blue'>大家</font>〗调整级别");
fm.temp.value = "";
fm.temp.focus();
return false;
}
var why = content.substring(5,content.length);
window.open("dialog.php?mode="+msg_rank+"&username="+fm.to_user.value+"&why="+why,"","height=120,width=300,status=no");
return false;
}
if(!content.indexOf("/forbid"))
{
if(fm.to_user.value=="大家")
{
showNotice("您不能禁用〖<font color='blue'>大家</font>〗");
fm.temp.value = "";
fm.temp.focus();
return false;
}
var why = content.substring(7,content.length);
window.open("dialog.php?mode="+msg_forbid+"&username="+fm.to_user.value+"&why="+why,"","height=120,width=300,status=no");
return false;
}
if(!content.indexOf("/unforbid"))
{
if(fm.to_user.value=="大家")
{
showNotice("您不能解禁〖<font color='blue'>大家</font>〗");
fm.temp.value = "";
fm.temp.focus();
return false;
}
var why = content.substring(9,content.length);
window.open("dialog.php?mode="+msg_unforbid+"&username="+fm.to_user.value+"&why="+why,"","height=120,width=300,status=no");
return false;
}
if(!content.indexOf("/call"))
{
if(fm.to_user.value=="大家")
{
showNotice("您不能呼叫〖<font color='blue'>大家</font>〗");
fm.temp.value = "";
fm.temp.focus();
return false;
}
var why = content.substring(5,content.length);
window.open("dialog.php?mode="+msg_call+"&username="+fm.to_user.value+"&why="+why,"","height=120,width=300,status=no");
return false;
}
if(!content.indexOf("/ungrade"))
{
if(fm.to_user.value=="大家")
{
showNotice("您不能操作〖<font color='blue'>大家</font>〗");
fm.temp.value = "";
fm.temp.focus();
return false;
}
var why = content.substring(8,content.length);
window.open("dialog.php?mode="+msg_ungrade+"&username="+fm.to_user.value+"&why="+why,"","height=120,width=300,status=no");
return false;
}
if(!content.indexOf("/grade"))
{
var why = content.substring(6,content.length);
window.open("dialog.php?mode="+msg_grade+"&username="+fm.to_user.value+"&why="+why,"","height=120,width=300,status=no");
return false;
}
if(!content.indexOf("/unlock"))
{
var why = content.substring(7,content.length);
window.open("dialog.php?mode="+msg_unlock+"&username="+fm.to_user.value+"&why="+why,"","height=120,width=300,status=no");
return false;
}
fm.temp.value = "";
}
if(!userExists(fm.to_user.value))
{
showNotice("〖"+fm.to_user.value.fontcolor("blue")+"〗不在聊天室!");
fm.to_user.value = "大家";
return false;
}
if(fm.to_user.value==username)
{
showNotice("您自己跟自己说话?");
fm.to_user.value = "大家";
return false;
}
if(fm.to_user.value=="大家")
{
fm.pri.checked=false;
}
if(fm.pri.checked)
{
fm.private.value = 1;
}
else
{
fm.private.value = 0;
}
if(fm.tit.checked)
{
fm.to_user.value = "大家";
fm.title.value = 1;
fm.tit.checked = false;
}
else
{
fm.title.value = 0;
}
//send message
if(fm.title.value)
{
lastTitleTime = Date.parse(new Date())/1000;
}
timer_value = max_nosay_time;
fm.content.value = content.substr(0,say_maxlength);
lastSayContent = fm.temp.value;
fm.temp.value = "";
fm.temp.focus();
fm.send.disabled = true;
lastTo = fm.to_user.value;
lastSayTime = nowTime;
var request = urlpath+"addmessage.php?from_user="+fm.from_user.value+"&to_user="+fm.to_user.value+"&content="+encode(fm.content.value)+"&saycolor="+fm.saycolor.value+"&namecolor="+fm.namecolor.value+"&private="+fm.private.value+"&title="+fm.title.value+"&face="+fm.face.value+"&filter="+fm.filter.value;
xmlhttp.open("get",request,false);
xmlhttp.setRequestHeader("CONTENT-TYPE","application/x-www-form-urlencoded");
xmlhttp.send();
eval(bytes2BSTR(xmlhttp.responseBody));
setTimeout("inputmessage.document.MessageForm.send.disabled=false",max_nosay_time);
return false;
}
function autoRemove(s)
{
var x = s.replace(/<img src=/gi,"<img onerror='this.src=\"images/picerror.gif\"' src=");
return x;
}
function encode(str)
{
var reg = /#/g;
var newStr = str.replace(reg,escape("#"));
reg = /\&/g;
newStr = newStr.replace(reg,escape("&"));
return newStr;
}
function scrollWindow()
{
if(!inputmessage.MessageForm.scroll.checked)
return;
showmessage.scrollTo(showmessage.document.body.scrollLeft,showmessage.document.body.scrollTop+20);
showselfmessage.scrollTo(showselfmessage.document.body.scrollLeft,showselfmessage.document.body.scrollTop+20);
showallmessage.scrollTo(showallmessage.document.body.scrollLeft,showallmessage.document.body.scrollTop+20);
}
function PointTo(name)
{
inputmessage.document.MessageForm.to_user.value = name;
inputmessage.document.MessageForm.temp.focus();
}
function leaveSoon()
{
var state = inputmessage.document.MessageForm.leave.checked;
if(state)
{
inputmessage.document.MessageForm.send.disabled = true;
inputmessage.document.MessageForm.send.value = "离开";
inputmessage.document.MessageForm.temp.value = "我不在,请稍后跟我联系。";
}
else
{
inputmessage.document.MessageForm.send.disabled = false;
inputmessage.document.MessageForm.send.value = "发言";
inputmessage.document.MessageForm.temp.value ="";
}
}
function userExists(name)
{
if(name=="大家")
return true;
for(var i=0;i<onlines.nameLists.length;i++)
{
if(name==onlines.nameLists[i])
{
return true;
}
}
return false;
}
function getSays(i)
{
if(i)
{
//下一条语句
Sayed.moveNext();
inputmessage.document.MessageForm.temp.value = Sayed.getItem();
}
else
{
//前一条语句
Sayed.movePrev();
inputmessage.document.MessageForm.temp.value = Sayed.getItem();
}
}
function replaceConfig(you,me,str)
{
var me_str = /{##}/g;
var you_str = /{%%}/g;
str = str.replace(you_str,"<a href=javascript:parent.PointTo('"+you+"')>"+you+"</a>");
str = str.replace(me_str,"<a href=javascript:parent.PointTo('"+me+"')>"+me+"</a>");
return str;
}
function saveCents()
{
var query = "manage.php?mode=savecents";
xmlhttp.open("get",query,false);
xmlhttp.send();
eval(bytes2BSTR(xmlhttp.responseBody));
}
function splitWindow()
{
if(inputmessage.document.MessageForm.split.checked)
{
messageframe.rows = "50%,50%,0%";
}
else
{
messageframe.rows = "0%,0%,100%";
}
}
function saveDocuments()
{
showallmessage.document.execCommand("saveAs","t","【"+username+"】在【"+chatroom_name+"】的聊天记录");
}
function showDebug(tm,num)
{
window.status = "取信息消费时间:"+tm+"秒,查询数据库"+num+"次";
}
var timer_value = max_nosay_time;
function timer()
{
if(!timer_value&&max_nosay_time)
{
location.href = "manage.php?mode="+msg_clear;
}
if(max_nosay_time)
{
inputmessage.document.MessageForm.autoClearTime.value = timer_value;
}
else
{
inputmessage.document.MessageForm.autoClearTime.value = "不限";
}
setTimeout("timer()",1000);
timer_value --;
}
function clearScreen()
{
if(!confirm("此操作会丢失所有聊天记录,建议将聊天记录先保存到本地。\n\n\t您真的要清除屏幕信息吗?"))
return;
showmessage.document.close();
showmessage.document.open();
showselfmessage.document.close();
showselfmessage.document.open();
showallmessage.document.close();
showallmessage.document.open();
showMessageFramePreWrite();
preWriteShowPriMessage();
}
function pingbi()
{
var pbWindow = window.open("","","width=250,height=300");
var s = "<html><head><title>屏蔽名单</title></head><style>";
s += "body{color:black;font-family:宋体;font-size:9pt;background-color:buttonface;border-bottom:medium none;border-left:medium none;border-right:medium none;border-top:medium none;padding-bottom:0px;padding-left:0px;padding-right:0px;padding-top:0px};td{font-size:12px}";
s += "</style></head>";
s += "<body scroll=auto>";
s += "<center>屏蔽列表</center><form name='pb'>";
s += "<table align='center' bgcolor='black' cellspacing=1 cellpadding=0 width=180>";
s += "<tr><td width=60 bgcolor='buttonface' align='center'>用户名</td><td width=60 bgcolor='buttonface' align='center'>性别</td><td width=60 bgcolor='buttonface' align='center'>选择</td>";
for(var i=0;i<onlines.length();i++)
{
var nms = onlines.getItem(i)
if(nms ==username)
{
continue;
}
else
{
var st = "";
if(isPBed(nms))
st += " checked";
s += "<tr><td width=60 bgcolor='white' align='center'>"+onlines.getItem(i)+"</td><td width=60 bgcolor='white' align='center'>"+onlines.getGenderItem(i)+"</td><td width=60 bgcolor='white' align='center'><input name='nm' type='checkbox' value='"+onlines.getItem(i)+"'"+st+"></td></tr>";
}
}
s += "</table><center><button onclick='opener.saveResult(window)'>确定</button> <button onclick='window.close()'>取消</button></center></form>";
s += "<center>如果该用户在屏蔽名单中,该用户的所有发言将不会显示在您的屏幕上。</center>";
s += "</body></html>";
pbWindow.document.write(s);
}
function isPBed(name)
{
for(var j=0;j<pingbilist.length;j++)
{
if(pingbilist[j]==name)
return true;
}
return false;
}
function saveResult(w)
{
var fm = w.document.pb;
var pbNames = "";
var t = 0;
for(var i=0;i<fm.elements.length;i++)
{
var e = fm.elements[i];
if(e.name=="nm"&&e.checked)
{
if (!t)
pbNames += e.value;
else
pbNames += ","+e.value;
t++;
}
}
pingbilist = pbNames.split(",");
showNotice("屏蔽操作成功!目前被屏蔽的名单有:<font color='blue'>"+(pbNames.length?pbNames:"没有人被屏蔽")+"</font>");
w.close();
}
function showRoomInfo()
{
var str = "聊天室房间信息<br>";
str += " 房间名称:"+chatroom_roomname+"<br>";
str += " 最大在线:"+room_maxonline+"<br>";
str += " 房间标识:"+roomid+"<br>";
str += " 允许级别:"+room_grade+"<br>";
str += " 房间主人:"+masters;
showNotice(str);
}
function preWriteOnlineList()
{
<?php
while($onlineRow = $db->fetchArray($onlineResult))
{
echo "onlines.addName('{$onlineRow["username"]}',{$onlineRow["gender"]});";
}
?>
onlines.write();
}
window.onerror = procError;
function procError(sMsg,sUrl,sLine)
{
//自动发送错误
var why = "&sMsg="+sMsg+"&sUrl="+sUrl+"&sLine="+sLine+"&lastContent="+lastContent+"&username="+username+"&roomid="+roomid+"&userrank="+userrank+"&chatroom_name="+chatroom_name+"&chatroom_roomname="+chatroom_roomname+"&getMessageNumber="+getMessageNumber;
var errorWindow = window.open("manage.php?mode=posterror"+why,"errorWindow","height=10,width=10,top=-100,left=-100");
setTimeout('location.reload(true)',3000);
}
</script>
<script language=vbscript>
Function bytes2BSTR(vIn)
dim i
strReturn = ""
For i = 1 To LenB(vIn)
ThisCharCode = AscB(MidB(vIn,i,1))
If ThisCharCode < &H80 Then
strReturn = strReturn & Chr(ThisCharCode)
Else
NextCharCode = AscB(MidB(vIn,i+1,1))
strReturn = strReturn & Chr(CLng(ThisCharCode) * &H100 + CInt(NextCharCode))
i = i + 1
End If
Next
bytes2BSTR = strReturn
End Function
</script>
<frameset cols="83%,*" border=0>
<frameset rows="10%,70%,20%" border=0>
<frame src="about:blank" name="showtitle">
<frameset rows="100%,0,0" name="messageframe" frameborder=1>
<frame src="about:blank" name="showmessage">
<frame src="about:blank" name="showselfmessage">
<frame src="about:blank" name="showallmessage">
</frameset>
<frame src="inputmessage.php" name="inputmessage">
</frameset>
<frameset rows="100%,*," noresize border=0>
<frame src="about:blank" name="onlinelist">
<frame src="readmessage.php" name="readmessage">
</frameset>
</frameset>
</html>
<?php
$db->close();
?>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -