⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 roomlist.htm

📁 这是基于网络编程的
💻 HTM
字号:
<HTML>
<HEAD>
<TITLE>房间列表</TITLE>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<script language="JavaScript">
/** 系统用脚本定义开始,普通用户不建议修改 **/
function ChatRoom()
{
	this.RoomID	;
	this.RoomName	;
	this.URL	;
	this.UserCount	;	// 在线人数
	this.MaxOnline	;	// 最高在线
	this.State	;	// 满员状态	0=正常 1=热闹 -1=满员禁止登录
	this.Topic	;	// 当前话题
	this.AdminNames ;	// 管理员名单
	this.RoomArea=0;	//  地区	
	this.RoomType	;	// 房间分类ID
	this.Private = 0 ; // 是否自建  1:是,0:否
	this.Locked = 0 ;  // 是否加锁  1:是,0:否
	this.SupportAudio=0;// 是否支持语音  1:是,0:否
	this.SupportVideo=0;// 是否支持视频  1:是,0:否	
	this.RoomDisplay=1;
	this.Other=0;		
	this.Reserve="";
	this.UserList = null;	
}
function ChatServer()
{
	this.MaxOnline = 0;	// 最高在线
	this.RegUsers = 0;	// 总注册人数
	this.TotalUsers = 0;	// 当前在线人数
	
	this.m_pChatRoom	= new Array();
	this.RoomsCount = function(){return this.m_pChatRoom.length;}	// 房间数
	this.GetRoomObject = function(n) // 取得房间对象
	{	if(n < this.RoomsCount()) return this.m_pChatRoom[n];
		return null;
	}
	this.SortRule= function(a, b)
	{	var n1 = a.UserCount ;
		var n2 = b.UserCount ;
		if(n1 == n2)	return 0 ;
		if(n1 > n2)		return -1 ;
		if(n1 < n2)		return 1;
	}
	this.Sort= function(){this.m_pChatRoom.sort(this.SortRule);}
	this.Add = function(nRoomID,strRoomName, strURL, nUserCount, nMax, nState, strTopic, strAdmins, nRoomArea,nRoomType, bPrivate, bLocked,nSupportAudio,nSupportVideo,nRoomDisplay,nOther,strReserve)
	{
		var obj = new ChatRoom() ;
		obj.RoomID		= nRoomID ;
		obj.RoomName		= strRoomName ;
		obj.URL			= strURL;
		obj.UserCount	= nUserCount ;
		obj.MaxOnline	= nMax ;
		obj.State		= nState ;
		obj.Topic		= strTopic ;
		obj.AdminNames	= strAdmins ;
		obj.RoomArea = nRoomArea;		
		obj.RoomType	= nRoomType ;
		obj.Private		= bPrivate ;
		obj.Locked		= bLocked ;
		obj.SupportAudio = nSupportAudio;
		obj.SupportVideo = nSupportVideo;
		obj.RoomDisplay = nRoomDisplay;
		obj.Other = nOther;	
		obj.Reserve = strReserve		
		this.m_pChatRoom[this.RoomsCount()] = obj ;
	}
	this.SetCount = function(nMax, nReg, nTotal)
	{	this.MaxOnline	= nMax ;
		this.RegUsers	= nReg ;
		this.TotalUsers = nTotal ;
	}
} 
function GoRoom(n)	// 换房间函数
{	
	var Room = Server.GetRoomObject(n) ;
	parent.form.inputform.msg.focus() ;
	if(Room.RoomName==parent.RoomName){alert("您已经在" + Room.RoomName + "内了!"); return;}
	if(confirm("您确定要转到"+Room.RoomName+"吗?"))
	{	parent.cs(parent.everyone) ;
		parent.form.inputform.msg.value = "/c go " + Room.RoomID;
		parent.form.inputform.submit1.click(); // 调整此行的注释符,可选择自动换房或手动换房
	}
}
function OnUserList(n)
{
	;	
}
var Server = new ChatServer() ;
<!--$SimpleRoomList-->
/*脚本定义完毕*/
</script>
<style type="text/css">
<!--
body {  font-family: "宋体"; font-size: 9pt; line-height: 12pt}
table{  font-family: "宋体"; font-size: 9pt; line-height: 10pt}
select {  font-family: "宋体"; font-size: 9pt}
a:visited {  color: #0000FF; text-decoration: none}
a:link {  color: #0000FF; text-decoration: none}
a:hover {  color: #FF0000}
.boy { color: 0000FF}
.girl { color: FF80FF}
.private { color: green}
-->
</style>
</HEAD>
<BODY bgcolor=#ddddff rightmargin=0 onkeydown="if(event.keyCode==27)return false;">
<script>this.document.bgColor=parent.skin.UserColor;</script>
<Div align=center>
<BR><BR>
[<A href="javascript:window.location.reload();">刷新</A>/<A href="javascript:parent.ToUserList()">用户列表</A>]
<BR><BR>
</DIV>
[共有:<font color=red><B><script>document.write(Server.RoomsCount())</script></B></font>个房间]
<HR>
<TABLE>
<script language="JavaScript">
Server.Sort() ; // 按在线人数多少排序
var Room ;
for(var i = 0; i < Server.RoomsCount(); i++)
{
	Room = Server.GetRoomObject(i) ;
	
	if(Room.RoomDisplay==0)
	{
		continue;
	}	
	
	document.write("<TR><TD>") ;
	document.write("<a href='javascript:GoRoom(" + i + ")'>");
	document.write(Room.RoomName) ;
	document.write("</a>") ;
	if(Room.Private == true || Room.Locked == true)
	{
		document.write("[") ;
		if(Room.Private == true)	document.write("自建"); // 自建
		if(Room.Locked == true)		document.write("<font color=red>L</font>"); // 加锁
		document.write("]") ;
	}
	document.write("</TD><TD>") ;
	document.write("(<a href='javascript:OnUserList(" + i + ")'>" + Room.UserCount + "</a>)") ;
	document.write("</TD></TR>") ;
}
</script>
</TABLE>
<HR>
[在线用户:<font color=red><B><script>document.write(Server.TotalUsers)</script></B></font>人]
<DIV align=center>
<BR><BR>
<BR>
<a href="javascript:parent.modify();">注册 修改个人资料</a>
<BR><BR>
</DIV>
</BODY>
</HTML>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -