var ghost = window.location.hostname+":2258";
var sendrefresh = true;
var showicon = true;
var portraiturl = "http://" + host + "/IceBeans/";
var usenickname = 0;
var listmode = 1;
function UserList() {
this.nSort = 0;
this.nSort0 = 0;
this.m_pUsers = new Array();
this.GetCount = function () { return this.m_pUsers.length; }
this.GetAdminCount = function () {
var num = 0;
for (var i = 0; i < this.GetCount(); i++) {
if (this.GetObject(i).usertype == "11") {
num++;
}
}
return num;
}
this.GetUserCount = function () {
return this.m_pUsers.length;// - this.GetAdminCount();
}
this.GetObject = function (n) { return this.m_pUsers[n]; }
this.GetID = function (strName) {
var obj;
for (var i = 0; i < this.GetCount(); i++) {
if (this.GetObject(i).name == strName) {
obj = this.GetObject(i);
return obj.id;
}
}
return 0;
}
this.Find = function (strName) {
for (var i = 0; i < this.GetCount(); i++)
if (this.GetObject(i).name == strName) return i;
return -1;
}
this.FindObject = function (strName) {
var i = this.Find(strName);
if (i != -1)
return this.GetObject(i);
return null;
}
this.FindbyID = function (ID) {
for (var i = 0; i < this.GetCount(); i++)
if (this.GetObject(i).id == ID) return i;
return -1;
}
this.FindObjectbyID = function (ID) {
var i = this.FindbyID(ID);
if (i != -1)
return this.GetObject(i);
return null;
}
this.Add = function (name, adminmode, usertype, extinfo, icon, id, sex, voice, video) {
var obj, n;
if ((n = this.Find(name)) != -1) obj = this.GetObject(n);
else obj = new UserObject();
obj.name = name;
obj.adminmode = adminmode;
obj.usertype = usertype;
obj.extinfo = extinfo;
obj.icon = icon;
obj.id = id;
obj.sex = sex;
obj.voice = voice;
obj.video = video;
obj.level = get_user_type(name);
if (n == -1) this.m_pUsers[this.GetCount()] = obj;
this.DoSort();
}
this.Del = function (strName) {
var n = this.Find(strName);
if (n != -1) {
delete this.m_pUsers[n];
this.m_pUsers.sort(this.SortOnNull);
this.m_pUsers.length--;
return true;
} return false;
}
this.RemoveAll = function () {
for (var i = 0; i < this.GetCount(); i++)
delete this.m_pUsers[i];
this.m_pUsers.length = 0;
}
this.SortOnXB = function (a, b) {
var n1 = a.sex;
var n2 = b.sex;
if (n1 == n2) return 0;
if (n1 > n2) return 1;
if (n1 < n2) return -1;
}
this.SortOnName = function (a, b) {
var n1 = a.name.length;
var n2 = b.name.length;
if (n1 == n2) return 0;
if (n1 > n2) return -1;
if (n1 < n2) return 1;
}
this.SortOnName1 = function (a, b) {
var a2 = new String(a.name);
var b2 = new String(b.name);
if (a.adminmode == 1 && b.adminmode != 1) {
t = -1;
} else if (a.adminmode != 1 && b.adminmode == 1) {
t = 1;
} else {
if (a2.substr(0, 1) == "*" && b2.substr(0, 1) != "*") {
t = -1;
} else if (a2.substr(0, 1) != "*" && b2.substr(0, 1) == "*") {
t = 1;
} else {
if (a2 == b2) {
t = 0;
}
if (a2 > b2) {
t = -1;
}
if (a2 < b2) {
t = 1;
}
}
}
return t;
}
this.SortOnName2 = function (a, b) {
if (a.adminmode == 1 && b.adminmode != 1) {
t = -1;
} else if (a.adminmode != 1 && b.adminmode == 1) {
t = 1;
} else {
t = 0;
}
return t;
}
this.SortOnUserType = function (a, b) {
if (a.adminmode == 1 && b.adminmode != 1) {
t = -1;
} else if (a.adminmode != 1 && b.adminmode == 1) {
t = 1;
} else {
if (a.usertype > b.usertype) {
t = 1;
} else if (a.usertype < b.usertype) {
t = -1;
} else {
if (a.name < b.name) {
t = 1;
} else if (a.name > b.name) {
t = -1;
} else {
t = 0;
}
}
}
return t;
}
this.SortOnNull = function (a, b) {
if (a == null || b == null) return -1;
return 0;
}
this.DoSort = function () {
return;
}
this.SortByLevel = function () {
this.m_pUsers.sort(function (a, b) { return a.level - b.level; });
}
}
var timerID = null, timerRunning = false;
function refreshstop() { if (timerRunning) clearTimeout(timerID); timerRunning = false; }
function refreshstart() { refreshstop(); writeuserlist(); }
function Users_Add(name, adminmode, usertype, extinfo, icon, id, sex, voice, video, exps, nickname) {
var isnewuser = (parent.Users.FindObject(name) == null);
try {
this.d.refreshsdx(name, id);
} catch (e) { }
if (limituserlist == 1) {
if ((voice == 0) && (video == 0)) {
newlogin(name, id, nickname);
}
if (usertype != "11") { //如果是管理员保证列出。可以在脚本中重定义本函数使得VIP用户也可以保证列出
if (this.Users.GetCount() > limituserlistnum) {
return;
}
}
}
this.Users.Add(name, adminmode, usertype, extinfo, icon, id, sex, voice, video, exps, nickname);
if (this.Users.GetCount() < refreshatonce_threshold) {
refreshstart();
}
if (listmode == 1) {
if (list_parsed == 0) {
var tmp = name + "-'" + adminmode + "-'" + usertype + "-'" + extinfo + "-'" + icon + "-'" + id + "-'" + exps + "-'" + nickname + "'-" + sex + "'-" + voice + "'-" + video;
list.push(tmp);
list_length = list.length;
} else {
addusertolist(name, adminmode, usertype, extinfo, icon, id, sex, voice, video, exps, nickname);
}
}
if (isAutoWelcome && isnewuser) {
if (get_user_type(name) > 10) {
setTimeout('parent.d.send_msg_ex("' + name + '","[Advertising][username=' + parent.myinfo.USER + ']","",1,11,"",1)', 15000);
}
}
}
function Users_Add1(name, adminmode, usertype, extinfo, icon, id, sex, voice, video, exps, nickname) {
if (limituserlist == 1) {
if ((voice == 0) && (video == 0)) {
newlogin(name, id, nickname);
}
if (usertype != "11") { //如果是管理员保证列出。可以在脚本中重定义本函数使得VIP用户也可以保证列出
if (this.Users.GetCount() > limituserlistnum) {
return;
}
}
}
this.Users.Add(name, adminmode, usertype, extinfo, icon, id, sex, voice, video, exps, nickname);
this.Users.SortByLevel();
if (this.Users.GetCount() < refreshatonce_threshold) {
//refreshstart();
}
/*增加到用户列表*/
if (listmode == 1) {
addusertolist(name, adminmode, usertype, extinfo, icon, id, sex, voice, video, exps, nickname);
}
}
function newlogin(name, id, nickname) {
if (this.n == null) return;
if (this.n.document == null) return;
var objTable = this.n.document.getElementById('newuserlisttable');
var row = objTable.rows.length;
var i = 0;
for (i = 1; i < row; i++) {
if (objTable.rows[i].id == id) {
return;
}
}
if (objTable.rows.length >= 6) {
objTable.deleteRow(1);
}
var objRow = objTable.insertRow();
objRow.id = id;
var objCell = objRow.insertCell();
if (usenickname) {
objCell.innerHTML = "[" + nickname + "]";
} else {
objCell.innerHTML = "[" + name + "]";
}
}
function Users_Del(str) {
if (this.Users.Del(str))
if (this.Users.GetCount() < refreshatonce_threshold) {
refreshstart();
}
if (listmode == 1) {
deluserfromlist(str);
}
}
function Users_GetID(str) {
return this.Users.GetID(str);
}
var Users = new UserList();
function dodeluserfromlist(listtable, name) {
var i;
var rown = 0;
rown = listtable.rows.length;
for (i = 0; i < rown; i++) {
if (listtable.rows[i].id == name) {
listtable.deleteRow(i);
return 1;
break;
}
}
return 0;
}
function smdeluser(listtable,name)
{
var table = this.r.document.getElementById(""+listtable+"");
dodeluserfromlist(table, name);
this.r.document.getElementById("AdminCount").innerHTML = this.r.document.getElementById("AdminCount").innerHTML-1;
}
function checkvipuser(name) {
return "Z";
}
function getlist(type) {
if (type != "adm") return;
alist = new Array();
listtable = this.r.document.getElementById("listtable_" + type);
rown = listtable.rows.length;
for (i = 0; i < rown; i++) {
alist[alist.length] = listtable.rows[i].id;
}
}
function Swap(table, i, j) {
if (i < 0 || j > table.rows.length - 1) return;
if (i < j) {
table.moveRow(i, j);
table.moveRow(j - 1, i);
}
else {
table.moveRow(i, j);
table.moveRow(j + 1, i);
}
}
function addusertolist(name, adminmode, usertype, extinfo, icon, id, sex, voice, video, exps, nickname) {
if (this.r == null) return;
if (this.r.document == null) return;
if (list_parsed == 1) {
//this.r.document.getElementById("usercount").innerHTML = Users.GetCount();
this.r.document.getElementById("AdminCount").innerHTML = Users.GetAdminCount();
this.r.document.getElementById("UserCount").innerHTML = Users.GetUserCount();
}
if (ppmode == 1) { voice = 1; }
var i;
var listtable, listrow, listcell;
var rown = 0;
if (adminmode == 0) { //remove from listtable_adm
/*下管情况需删除管理员里相同名字*/
listtable = this.r.document.getElementById("listtable_adm");
dodeluserfromlist(listtable, name);
}
/*取相关列表表格*/
level = get_user_type(name);
portrait = "";
//icon = "";
displayname = new String(name);
if (extinfo != 0) t = extinfo;
else t = "";
var infolist = new Array("");
if (typeof (t) != "undefined" && t != "" && displayname.substr(0, 1) == "*") {
infolist = t.split(":");
if (!infolist[0]) { infolist[0] = "" };
if (!infolist[1]) { infolist[1] = "" };
if (!infolist[2]) { infolist[2] = "" };
portrait = infolist[0];
//icon = infolist[1];
}
userinfo0 = getptid(name, portrait, adminmode)
userinfo = userinfo0.split("\t");
styletext = ""
title = "";
adminmode_ret = adminmode;
if (userinfo.length >= 1) {
ptid = userinfo[0];
if (userinfo.length >= 2) {
styletext = userinfo[1];
if (userinfo.length >= 3) {
title = userinfo[2];
if (userinfo.length >= 4) {
adminmode_ret = userinfo[3];
}
}
}
} else {
ptid = userinfo0;
}
if (usertype == "11") {
listtable = this.r.document.getElementById("listtable_sm");
} else if (level > 0 ) {
listtable = this.r.document.getElementById("listtable_vip");
} else if (name.charAt(0) == '*' ) {
listtable = this.r.document.getElementById("listtable_reg");
} else {
listtable = this.r.document.getElementById("listtable_other");
}
rown = listtable.rows.length;
listrow = null;
/*按级别和昵称字符排序*/
for (i = 0; i < rown; i++) {
cmpname = listtable.rows[i].id;
cmplevel = listtable.rows[i].level;
cmpstr = cmplevel + cmpname;
if (cmpstr == level + name) {
listrow = listtable.rows[i];
}
}
// var p_length = listtable.rows.length;
// for (var i = 0; i <= p_length - 2; i++) {
// for (var j = p_length - 1; j >= 1; j--) {
// if (listtable.rows[j].level < listtable.rows[j - 1].level) {
// Swap(listtable, j, j - 1);
// }
// }
// }
if (listrow == null) {
/*没有此名的*/
/*上管情况下需从其他列表表格中删除同名者,*/
if (adminmode > 0) {
var listtable1;
listtable1 = this.r.document.getElementById("listtable_vip");
if (dodeluserfromlist(listtable1, name) == 0) {
listtable1 = this.r.document.getElementById("listtable_reg");
if (dodeluserfromlist(listtable1, name) == 0) {
listtable1 = this.r.document.getElementById("listtable_other");
dodeluserfromlist(listtable1, name);
}
}
}
/*增加进相关列表表格*/
listrow = listtable.insertRow(i);
listrow.id = name;
listrow.level = level;
} else {
/*有此名的,先删除该行第一列(声频视频状态可能变化,需要重写)*/
listrow.deleteCell(0);
}
/*重写该行第一列*/
listcell = listrow.insertCell(0);
var cellcontent = "";
if (showicon == true) {
//portrait = "<image src=" + ptid + ".gif border=0 align=absmiddle>";
var s = sex == 0 ? "0" : "1";
s = "1";
var imgurl = myvip.GetImgUrl(name, s);
portrait = "<image src='" + imgurl + "' border='0' align='absmiddle'>";
//portrait += "<img src='" + "http://m.ABC.COM/xq/" + icon + "_x.gif" + "' border='0' align='absmiddle'>";
} else {
portrait = "";
}
if (voice == 1) {
voicenote = "<font face=\"Webdings\" color=000000>¯</font>";
nametitle = name + " 开麦";
} else if (voice == 2) {
voicenote = "<font face=\"Wingdings\" color=black>(</font>";
nametitle = name + " 双工";
} else {
voicenote = "";
nametitle = name + " 关麦";
}
if (adminmode_ret == 1) {
nametitle += " 在线管理员";
}
if (title != "") {
nametitle += " " + title;
}
if (nametitle != "") nametitle = " title=\"" + nametitle + "\"";
if (adminmode_ret == 1) {
if (styletext == "") {
styletext = "color:red;";
displayname += "<font color=red></font>";
} else {
displayname += "*";
}
}
if (styletext == "0") styletext = "";
var ucolor = usercolor.FindObject(name);
var xc = is_uservip(name);
if (xc != null) {
var v = xc.split(",");
//displayname += "<img src=http://www.ABC.COM/user/xc2/" + v[5] + " border=0 hspace=1 vspace=1 align='absmiddle' /> ";
//displayname = "<a target=d href=\"javascript:parent.cs('" + name + "')\"title=\"" + v[6] + "\">";
if (v[0] == '1') {
displayname = "<img src=http://www.ABC.COM/user/xc1/" + v[1] + " border=0><font style=\"filter: glow(color=#9933FF,strength=4); Height:8pt; color:#FFFFFF; padding:1px;cursor:hand\">" + v[7] + "</font>"
} else {
displayname = "<font style=\"filter: glow(color=#" + v[2] + ",strength=4); Height:8pt; color:#" + v[3] + "; padding:1px;cursor:hand\">" + v[4] + "</font><font style=\"filter: glow(color=#9933FF,strength=4); Height:8pt; color:#FFFFFF; padding:1px;cursor:hand\">" + v[7] + "</font>";
}
} else if (ucolor != null) {
if (styletext) {
displayname = "<span style='filter: glow(color=" + ucolor.outcolor + ",strength=4); PADDING-BOTTOM: 1px; padding-left: 1px; padding-right: 1px; height: 8pt; color: red; cursor: hand; padding-top: 1px;'>" + displayname + "</span>";
}
else {
displayname = "<span style='filter: glow(color=" + ucolor.outcolor + ",strength=4); PADDING-BOTTOM: 1px; padding-left: 1px; padding-right: 1px; height: 8pt; color: " + ucolor.incolor + "; cursor: hand; padding-top: 1px;'>" + displayname + "</span>";
}
} else if (styletext) {
displayname = "<span style='" + styletext + "'>" + displayname + "</span>";
}
cellcontent += portrait + " <a class='name' target=d href=\"javascript:parent.cs('" + name + "')\" " + nametitle + ">" + displayname + "</a>";
cellcontent += voicenote;
if (video == 1) {
cellcontent += "";
}
var twgif="";
if ((level >= 13 && level <= 15) && video == 1) {
cellcontent += "";
cellcontent += "";
twgif = "";
}
listcell.innerHTML = "<span class='ydt'></span>" + twgif + cellcontent;
}
function deluserfromlist(name) {
if (this.r == null) return;
if (this.r.document == null) return;
if (list_parsed == 1) {
//this.r.document.getElementById("usercount").innerHTML = Users.GetCount();
this.r.document.getElementById("AdminCount").innerHTML = Users.GetAdminCount();
this.r.document.getElementById("UserCount").innerHTML = Users.GetUserCount();
}
var listtable;
listtable = this.r.document.getElementById("listtable_adm");
if (dodeluserfromlist(listtable, name) > 0) return;
listtable = this.r.document.getElementById("listtable_vip");
if (dodeluserfromlist(listtable, name) > 0) return;
listtable = this.r.document.getElementById("listtable_reg");
if (dodeluserfromlist(listtable, name) > 0) return;
listtable = this.r.document.getElementById("listtable_other");
if (dodeluserfromlist(listtable, name) > 0) return;
return;
}
function removealluserfromlist() {
if (this.r == null) return;
if (this.r.document == null) return;
if (list_parsed == 1) {
//this.r.document.getElementById("usercount").innerHTML = Users.GetCount();
this.r.document.getElementById("AdminCount").innerHTML = Users.GetAdminCount();
this.r.document.getElementById("UserCount").innerHTML = Users.GetUserCount();
}
var i;
var listtable;
var rown = 0;
listtable = this.r.document.getElementById("listtable_adm");
rown = listtable.rows.length;
for (i = rown - 1; i >= 0; i--) {
listtable.deleteRow(i);
}
listtable = this.r.document.getElementById("listtable_vip");
rown = listtable.rows.length;
for (i = rown - 1; i >= 0; i--) {
listtable.deleteRow(i);
}
listtable = this.r.document.getElementById("listtable_reg");
rown = listtable.rows.length;
for (i = rown - 1; i >= 0; i--) {
listtable.deleteRow(i);
}
listtable = this.r.document.getElementById("listtable_other");
rown = listtable.rows.length;
for (i = rown - 1; i >= 0; i--) {
listtable.deleteRow(i);
}
}
/* 由setInterval循环调用本函数初始用户数组list(按先后顺序)赋值至Users,利用list_parsing标识避免冲突 */
function dolistparse() {
if (list_parsing) {
return;
}
list_parsing = 1;
list_i++;
var i = list_i;
if (i < list_length) {
if (list[i] != null) {
sublists = list[i].split("'-");
if (sublists.length == 4) {
if (!sublists[1]) sublists[1] = '';
if (!sublists[2]) sublists[2] = '';
if (!sublists[3]) sublists[3] = '';
sex = sublists[1];
voice = sublists[2];
if (ppmode == 1) { voice = 1; }
video = sublists[3];
} else {
if (!sublists[1]) sublists[1] = '';
if (!sublists[2]) sublists[2] = '';
voice = sublists[1];
if (ppmode == 1) { voice = 1; }
video = sublists[2];
sex = 0;
}
lists = sublists[0].split("-'");
if (!lists[1]) lists[1] = '';
if (!lists[2]) lists[2] = '';
if (!lists[3]) lists[3] = '';
if (!lists[4]) lists[4] = '';
if (!lists[5]) lists[5] = '';
if (!lists[6]) lists[6] = '0';
if (!lists[7]) lists[7] = '';
name = lists[0];
adminmode = lists[1];
usertype = lists[2];
extinfo = lists[3];
icon = lists[4];
id = lists[5];
exps = lists[6];
nickname = lists[7];
Users_Add1(name, adminmode, usertype, extinfo, icon, id, sex, voice, video, exps, nickname);
}
} else {
clearInterval(list_timer);
list_parsed = 1;
//this.r.document.getElementById("usercount").innerHTML = Users.GetCount();
this.r.document.getElementById("AdminCount").innerHTML = Users.GetAdminCount();
this.r.document.getElementById("UserCount").innerHTML = Users.GetUserCount();
}
list_parsing = 0;
}
function RefreshUsers() {
if (listmode == 1) {
list_parsed = 0;
list_i = 0;
list_length = 0;
list_parsing = 0;
list_length = list.length;
Users.RemoveAll();
removealluserfromlist();
list_timer = setInterval("dolistparse()", 1);
if ((this.r != null) && (this.r.document != null)) {
//this.r.document.getElementById("usercount").innerHTML = this.usercount;
this.r.document.getElementById("AdminCount").innerHTML = Users.GetAdminCount();
this.r.document.getElementById("UserCount").innerHTML = Users.GetUserCount();
}
return;
}
Users.RemoveAll();
for (var i = 1; i < list.length; i++)
if (list[i] != null) {
sublists = list[i].split("'-");
if (sublists.length == 4) {
if (!sublists[1]) sublists[1] = '';
if (!sublists[2]) sublists[2] = '';
if (!sublists[3]) sublists[3] = '';
sex = sublists[1];
voice = sublists[2];
video = sublists[3];
} else {
if (!sublists[1]) sublists[1] = '';
if (!sublists[2]) sublists[2] = '';
voice = sublists[1];
video = sublists[2];
sex = 0;
}
lists = sublists[0].split("-'");
if (!lists[1]) lists[1] = '';
if (!lists[2]) lists[2] = '';
if (!lists[3]) lists[3] = '';
if (!lists[4]) lists[4] = '';
if (!lists[5]) lists[5] = '';
name = lists[0];
adminmode = lists[1];
usertype = lists[2];
extinfo = lists[3];
icon = lists[4];
id = lists[5];
Users_Add(name, adminmode, usertype, extinfo, icon, id, sex, voice, video);
}
refreshclick = true;
writeuserlist();
}
function writerframe() {
if (listmode == 0) {
return;
}
if (this.r == null) return;
if (this.r.document == null) return;
this.r.document.open();
this.r.document.writeln("
this.r.document.writeln("");
this.r.document.writeln("");
this.r.document.writeln(" ");<br> this.r.document.writeln(" function openShutManager(oSourceObj, oTargetObj, shutAble, oOpenTip, oShutTip) {");<br> this.r.document.writeln(" var sourceObj = typeof oSourceObj == \"string\" ? document.getElementById(oSourceObj) : oSourceObj;");<br> this.r.document.writeln(" var targetObj = typeof oTargetObj == \"string\" ? document.getElementById(oTargetObj) : oTargetObj;");<br> this.r.document.writeln(" var openTip = oOpenTip || \"\";");<br> this.r.document.writeln(" var shutTip = oShutTip || \"\";");<br> this.r.document.writeln(" if (targetObj.style.display != \"none\") {");<br> this.r.document.writeln(" if (shutAble) return;");<br> this.r.document.writeln(" targetObj.style.display = \"none\";");<br> this.r.document.writeln(" if (openTip && shutTip) {");<br> this.r.document.writeln(" sourceObj.innerHTML = shutTip;");<br> this.r.document.writeln(" }");<br> this.r.document.writeln(" } else {");<br> this.r.document.writeln(" targetObj.style.display = \"block\";");<br> this.r.document.writeln(" if (openTip && shutTip) {");<br> this.r.document.writeln(" sourceObj.innerHTML = openTip;");<br> this.r.document.writeln(" }");<br> this.r.document.writeln(" }");<br> this.r.document.writeln(" }");<br> this.r.document.writeln(" function setTab(name, cursel, n) {");<br> this.r.document.writeln(" for (i = 1; i <= n; i++) {");<br> this.r.document.writeln(" var menu = document.getElementById(name + i);");<br> this.r.document.writeln(" var con = document.getElementById(\"con_\" + name + \"_\" + i);");<br> this.r.document.writeln(" menu.className = i == cursel ? \"hover\" : \"\";");<br> this.r.document.writeln(" con.style.display = i == cursel ? \"block\" : \"none\";");<br> this.r.document.writeln(" }");<br> this.r.document.writeln(" }");<br> this.r.document.writeln(" <\/script>");<br> this.r.document.writeln(" <div class=\"Tab1\">");<br> this.r.document.writeln(" <div class=\"Menubox\">");<br> this.r.document.writeln(" <ul>");<br> this.r.document.writeln(" <li id=\"one1\" onmousemove=\"setTab(\'one\',1,2)\" class=\"hover\" style=\"margin-right: 1px;\">");<br> this.r.document.writeln(" 用户/<span id=\"UserCount\">0</span></li>");<br> this.r.document.writeln(" <li id=\"one2\" onmousemove=\"setTab(\'one\',2,2)\" class=\"\">管理/<span id=\"AdminCount\">0</span></li>");<br> this.r.document.writeln(" <li style=\"background: none; width: 10px; padding-left: 4px;\"><a href=\"#\" onclick=\"openShutManager(this,\'box\')\">");<br> this.r.document.writeln(" <img src=\"" + portraiturl + "images/rig04.gif\"></a></li>");<br> this.r.document.writeln(" <li style=\"background: none; width: 10px; padding-left: 4px;\">");<br> this.r.document.writeln(" <img src=\"" + portraiturl + "images/rig05.gif\"></li>");<br> this.r.document.writeln(" </ul>");<br> this.r.document.writeln(" </div>");<br> this.r.document.writeln(" <div id=\"box\" style=\"display: none\" class=\"rig01\">");<br> this.r.document.writeln(" <div style=\"float: left\">");<br> this.r.document.writeln(" <img src=\"" + portraiturl + "images/rig07.gif\"></div>");<br> this.r.document.writeln(" <div class=\"rig03\">");<br> this.r.document.writeln(" <input type=\"text\" style=\"color: #999999; background: transparent; border: none\"");<br> this.r.document.writeln(" onfocus=\"if(value==defaultValue){value=\'\';this.style.color=\'#000\'}\" onblur=\"if(!value){value=defaultValue;this.style.color=\'#999\'}\"");<br> this.r.document.writeln(" value=\"请输入房间名\" size=\"17\"></div>");<br> this.r.document.writeln(" <div style=\"float: left; padding-left: 3px; padding-top: 3px;\">");<br> this.r.document.writeln(" <a href=\"#\">邀请好友</a></div>");<br> this.r.document.writeln(" </div>");<br> this.r.document.writeln(" <div class=\"Contentbox\">");<br> this.r.document.writeln(" <div id=\"con_one_1\" style=\"display: block;\">");<br> this.r.document.writeln(" <table class=\'list\' width=\"100%\" border=\"0\" id=\"listtable_adm\" cellspacing=\"5\">");<br> this.r.document.writeln(" </table>");<br> this.r.document.writeln(" <table class=\'list\' width=\"100%\" border=\"0\" id=\"listtable_vip\" cellspacing=\"5\">");<br> this.r.document.writeln(" </table>");<br> this.r.document.writeln(" <table class=\'list\' width=\"100%\" border=\"0\" id=\"listtable_reg\" cellspacing=\"5\">");<br> this.r.document.writeln(" </table>");<br> this.r.document.writeln(" <table class=\'list\' width=\"100%\" border=\"0\" id=\"listtable_other\" cellspacing=\"5\">");<br> this.r.document.writeln(" </table>");<br> this.r.document.writeln(" </div>");<br> this.r.document.writeln(" <div id=\"con_one_2\" style=\"display: none;\">");<br> this.r.document.writeln(" <table class=\'list\' width=\"100%\" border=\"0\" id=\"listtable_adm\" cellspacing=\"5\">");<br> this.r.document.writeln(" </table>");<br> this.r.document.writeln(" </div>");<br> this.r.document.writeln(" </div>");<br> this.r.document.writeln(" </div>");<br> this.r.document.writeln("</body></html>");<br> this.r.document.writeln("<script type=\"text/javascript\">");<br> this.r.document.writeln(" setTimeout('parent.BindListMenu();',5000);");<br> this.r.document.writeln("<\/script>");<br> this.r.document.close();<br> }<br> writerframe();</p> <p>function writeuserlist() {<br> if (listmode == 1) {<br> return;<br> }<br> if (sendrefresh == false) {<br> sendrefresh = true;<br> } else {<br> var count = Users.GetCount();<br> if ((count < autorefresh_threshold) || (autorefreshuserlist == true) || (refreshclick == true) && (listshow == 0)) {<br> // for (var i = 0; i < list.length; i++) {<br> // delete list[i]; <br> // }<br> list = new Array();<br> list[0] = "";<br> for (i = 0; i < count; i++) {<br> //name-'adminmode-'usertype-'extinfo-'icon'-sex'-voice'-video<br> obj = Users.GetObject(i);<br> tmp = obj.name + "-'" + obj.adminmode + "-'" + obj.usertype + "-'" + obj.extinfo + "-'" + obj.icon + "'-" + obj.voice + "'-" + obj.video<br> list[i + 1] = tmp;<br> }<br> //list.sort();<br> if (this.d.loaded == 1) write();<br> if (refreshclick == true) {<br> refreshclick = false;<br> }<br> }<br> }<br> timerRunning = true;<br> timerID = setTimeout("refreshstart()", nTimer * 1000);<br> }<br> function sortuser() {<br> user_sorted = new Array();<br> for (var i = 1; i < list.length; i++) {<br> if (list[i] != "") {<br> var lists_split = list[i].split("'-");</p> <pre><code> if (!lists_split[1]) lists_split[1] = '0'; if (!lists_split[2]) lists_split[2] = '0'; var lists_split_2 = lists_split[0].split("-'"); if (lists_split_2[1] != '1') lists_split_2[1] = '2'; if (lists_split_2[0].substr(0, 1) == "*") { usertype = "0"; } else { usertype = "1"; } userinfo = ""; user_str = lists_split_2[1]; user_str += "&"; user_str += usertype; user_str += "&"; user_str += userinfo; user_str += "&"; user_str += lists_split_2[0]; user_str += "&"; user_str += lists_split[1]; user_str += "&"; user_str += lists_split[2]; user_str += "&"; user_str += lists_split_2[3]; user_sorted[user_sorted.length] = user_str; } } user_sorted.sort(); </code></pre> <p>}<br> function writerframes() {<br> if (listmode == 1) {<br> return;<br> }<br> sortuser();<br> count = user_sorted.length;<br> if (this.r.document == null) return; this.r.document.open();<br> this.r.document.writeln("<html><head><meta http-equiv=\"Content-Type\" content=\"text/html; charset=gb2312\">");<br> this.r.document.writeln("<style type=text/css>");<br> this.r.document.writeln("<!--");<br> this.r.document.writeln(".p9 { font-size: 9pt}");<br> this.r.document.writeln("body { font-size: 9pt; margin:0; padding:0; width:175px; overflow-x:hidden}");<br> this.r.document.writeln("td { font-size: 9pt}");<br> this.r.document.writeln("a { color: #0000FF; text-decoration: none}");<br> this.r.document.writeln("#bl_yh_lb{margin:0 0 0 3px; padding:0;width:175px;}");<br> this.r.document.writeln("#bl_yh_lb li{line-height:21px; height:21px; list-style-type:none; margin:0; padding:2px 0;}");<br> this.r.document.writeln("-->");<br> this.r.document.writeln("</style>");<br> this.r.document.writeln("<div id=\"Tips\" style=\"position:absolute; left:0; top:0; width:130; display=none; z-index:2\">");<br> this.r.document.writeln(" <p class=\"\"> </p>");<br> this.r.document.writeln("</div>");<br> this.r.document.writeln("</head><body bgcolor=\"#F3FFE1\" leftMargin=0>");<br> this.r.document.writeln("<div align=center id=\"topbanner\"><image src=http://" + host + "/bl/$E/upload/tb.gif border=0><br><font color=#FF0000><marquee width=140 scrolldelay=200>您好!欢迎您光临《$$title》网址:http://$E.abc.com</marquee></font></div>");<br> this.r.document.writeln("<div id=\"chatbody\" class=\"p9\"><div style=\"margin:3px; border-bottom:1px dashed #666666; \"> <a style=\"float:right;\" accesskey=\"n\" href=\"javascript:\" onclick=\"parent.d.document.getElementById('REFRESHUSERLIST').click()\"><img src=\"" + portraiturl + "chattools/refresh.png\" alt=\"刷新在线列表\" border=0 align=\"absmiddle\"></a>");<br> this.r.document.writeln("<a style=\"float:right; margin:0 5px;\" accesskey=r href=\"javascript:parent.cs('所有人')\"><img src=\"" + portraiturl + "chattools/all.png\" alt=\"所有人\" border=0 align=\"absmiddle\"></a><img src=\"" + portraiturl + "chattools/online.png\" alt=\"在线人数\" align=\"absmiddle\"><font color=red>" + count + "</font></div>");<br> this.r.document.writeln("<ul id=\"bl_yh_lb\">");<br> //alist=new Array();</p> <pre><code>for (var i = 0; i < count; i++) { this.r.document.writeln("<li>"); var displayname; thislists = user_sorted[i].split("&"); thisadminmode = thislists[0]; thistype = thislists[1]; thisinfo = thislists[2]; thisname = thislists[3]; thisvoice = thislists[4]; thisvideo = thislists[5]; thisextinfo = thislists[6]; thisex = ""; if (thisadminmode != "1") thisadminmode = "0"; displayname = new String(thisname); myportrait = ""; myicon = ""; if (thisextinfo != 0) t = thisextinfo; else t = ""; var infolist = new Array(""); if (t != "" && displayname.substr(0, 1) == "*") { infolist = t.split(":"); if (!infolist[0]) { infolist[0] = "" }; if (!infolist[1]) { infolist[1] = "" }; if (!infolist[2]) { infolist[2] = "" }; myportrait = infolist[0]; myicon = infolist[1]; } userinfo0 = getptid(thisname, myportrait, thisadminmode) userinfo = userinfo0.split("\t"); styletext = "" title = ""; adminmode_ret = thisadminmode; if (userinfo.length >= 1) { ptid = userinfo[0]; if (userinfo.length >= 2) { styletext = userinfo[1]; if (userinfo.length >= 3) { title = userinfo[2]; if (userinfo.length >= 4) { adminmode_ret = userinfo[3]; if (userinfo.length == 5) { title = userinfo[4]; } } } } } else { ptid = userinfo0; } if (showicon == true) { portrait = "<image src=" + ptid + ".gif border=0 align=absmiddle>"; } else portrait = ""; if (thisvoice == 1) { voicenote = "<font face=\"Wingdings\" color=#009900>(</font>"; nametitle = thisname + " 开麦"; } else if (thisvoice == 2) { voicenote = "<font face=\"Wingdings\" color=black>(</font>"; nametitle = thisname + " 双工"; } else { voicenote = ""; nametitle = thisname + " 关麦"; } if (adminmode_ret == 1) { nametitle += " 在线管理员"; } if (title != "") { nametitle += " " + title; } if (nametitle != "") nametitle = " title=\"" + nametitle + "\""; if (adminmode_ret == 1) { //alist[alist.length]=thisname; if (styletext == "") { styletext = "color:red;"; displayname += "<font color=red>*</font>"; } else { displayname += "*"; } } if (styletext == "0") styletext = ""; if (styletext) { displayname = "<span style='" + styletext + "'>" + displayname + "</span>"; } this.r.document.writeln(portrait + "<a target=d href=\"javascript:parent.cs('" + thisname + "')\" " + nametitle + ">" + displayname + "</a>"); this.r.document.writeln(voicenote); if (thisvideo == 1) { this.r.document.writeln("<font face=\"Webdings\" color=000000>N</font>"); } this.r.document.writeln("</li>"); } this.r.document.writeln("</ul>"); this.r.document.writeln("</div><div align=center id='bottombanner' style='border:0px solid #000000;padding:0;POSITION: relative; Left: 0px; TOP: 0px; HEIGHT: 40px; WIDTH: 130px;'></div>"); this.r.document.writeln('</body></html>'); this.r.document.close(); </code></pre> <p>}<br> //////////////<br> function getptid(username, portrait, adminmode) {<br> style = "";<br> return portraiturl + portrait + "\t" + style;<br> }</p> <p>var ListTable = ["listtable_adm", "listtable_vip", "listtable_reg", "listtable_other"];<br> var ListUserCount = 0;<br> var Order = false;<br> window.setInterval(function () {<br> var num = Users.GetCount();<br> if (num - ListUserCount < 30 && ListUserCount - num < 30 && !Order) {<br> for (var s = 0; s < ListTable.length; s++) {<br> var listtable = this.r.document.getElementById(ListTable[s]);<br> var p_length = listtable.rows.length;<br> for (var i = 0; i <= p_length - 2; i++) {<br> for (var j = p_length - 1; j >= 1; j--) {<br> if (listtable.rows[j].level < listtable.rows[j - 1].level) {<br> Swap(listtable, j, j - 1);<br> }<br> }<br> }<br> }<br> Order = true;<br> }<br> else if (ListUserCount != num) {<br> Order = false;<br> ListUserCount = num;<br> }<br> }, 3000);</p> <p>parent.refreshstop = refreshstop;<br> parent.refreshstart = refreshstart;<br> parent.Users_Add = Users_Add;<br> parent.Users_Add1 = Users_Add1;<br> parent.newlogin = newlogin;<br> parent.Users_Del = Users_Del;<br> parent.Users_GetID = Users_GetID;<br> var Users = new UserList();<br> parent.dodeluserfromlist = dodeluserfromlist;<br> parent.checkvipuser = checkvipuser;<br> parent.getlist = getlist;<br> parent.addusertolist = addusertolist;<br> parent.deluserfromlist = deluserfromlist;<br> parent.removealluserfromlist = removealluserfromlist;<br> parent.dolistparse = dolistparse;<br> parent.RefreshUsers = RefreshUsers;<br> parent.writerframe = writerframe;<br> parent.writeuserlist = writeuserlist;<br> parent.sortuser = sortuser;<br> parent.write = write;<br> parent.getptid = getptid;</p> <p>function showElement(elementId) {<br> document.getElementById(elementId).style.display = "block";<br> }<br> function hideElement(elementId) {<br> document.getElementById(elementId).style.display = "none";<br> }</p>