程序師世界是廣大編程愛好者互助、分享、學習的平台,程序師世界有你更精彩!
首頁
編程語言
C語言|JAVA編程
Python編程
網頁編程
ASP編程|PHP編程
JSP編程
數據庫知識
MYSQL數據庫|SqlServer數據庫
Oracle數據庫|DB2數據庫
 程式師世界 >> 編程語言 >> 更多編程語言 >> 編程綜合問答 >> typeof-幫忙看看為何管理那塊不顯示呢 是在JS文件裡的

typeof-幫忙看看為何管理那塊不顯示呢 是在JS文件裡的

編輯:編程綜合問答
幫忙看看為何管理那塊不顯示呢 是在JS文件裡的

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>&#175</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 + "&nbsp;<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(" &quot;);<br> this.r.document.writeln(&quot; function openShutManager(oSourceObj, oTargetObj, shutAble, oOpenTip, oShutTip) {&quot;);<br> this.r.document.writeln(&quot; var sourceObj = typeof oSourceObj == \&quot;string\&quot; ? document.getElementById(oSourceObj) : oSourceObj;&quot;);<br> this.r.document.writeln(&quot; var targetObj = typeof oTargetObj == \&quot;string\&quot; ? document.getElementById(oTargetObj) : oTargetObj;&quot;);<br> this.r.document.writeln(&quot; var openTip = oOpenTip || \&quot;\&quot;;&quot;);<br> this.r.document.writeln(&quot; var shutTip = oShutTip || \&quot;\&quot;;&quot;);<br> this.r.document.writeln(&quot; if (targetObj.style.display != \&quot;none\&quot;) {&quot;);<br> this.r.document.writeln(&quot; if (shutAble) return;&quot;);<br> this.r.document.writeln(&quot; targetObj.style.display = \&quot;none\&quot;;&quot;);<br> this.r.document.writeln(&quot; if (openTip &amp;&amp; shutTip) {&quot;);<br> this.r.document.writeln(&quot; sourceObj.innerHTML = shutTip;&quot;);<br> this.r.document.writeln(&quot; }&quot;);<br> this.r.document.writeln(&quot; } else {&quot;);<br> this.r.document.writeln(&quot; targetObj.style.display = \&quot;block\&quot;;&quot;);<br> this.r.document.writeln(&quot; if (openTip &amp;&amp; shutTip) {&quot;);<br> this.r.document.writeln(&quot; sourceObj.innerHTML = openTip;&quot;);<br> this.r.document.writeln(&quot; }&quot;);<br> this.r.document.writeln(&quot; }&quot;);<br> this.r.document.writeln(&quot; }&quot;);<br> this.r.document.writeln(&quot; function setTab(name, cursel, n) {&quot;);<br> this.r.document.writeln(&quot; for (i = 1; i &lt;= n; i++) {&quot;);<br> this.r.document.writeln(&quot; var menu = document.getElementById(name + i);&quot;);<br> this.r.document.writeln(&quot; var con = document.getElementById(\&quot;con_\&quot; + name + \&quot;_\&quot; + i);&quot;);<br> this.r.document.writeln(&quot; menu.className = i == cursel ? \&quot;hover\&quot; : \&quot;\&quot;;&quot;);<br> this.r.document.writeln(&quot; con.style.display = i == cursel ? \&quot;block\&quot; : \&quot;none\&quot;;&quot;);<br> this.r.document.writeln(&quot; }&quot;);<br> this.r.document.writeln(&quot; }&quot;);<br> this.r.document.writeln(&quot; &lt;\/script&gt;&quot;);<br> this.r.document.writeln(&quot; <div class=\"Tab1\">&quot;);<br> this.r.document.writeln(&quot; <div class=\"Menubox\">&quot;);<br> this.r.document.writeln(&quot; <ul>&quot;);<br> this.r.document.writeln(&quot; <li id=\"one1\" onmousemove=\"setTab(\'one\',1,2)\" class=\"hover\" style=\"margin-right: 1px;\">&quot;);<br> this.r.document.writeln(&quot; 用戶/<span id=\"UserCount\">0</span></li>&quot;);<br> this.r.document.writeln(&quot; <li id=\"one2\" onmousemove=\"setTab(\'one\',2,2)\" class=\"\">管理/<span id=\"AdminCount\">0</span></li>&quot;);<br> this.r.document.writeln(&quot; <li style=\"background: none; width: 10px; padding-left: 4px;\"><a href=\"#\" onclick=\"openShutManager(this,\'box\')\">&quot;);<br> this.r.document.writeln(&quot; <img src=\"" + portraiturl + "images/rig04.gif\"></a></li>&quot;);<br> this.r.document.writeln(&quot; <li style=\"background: none; width: 10px; padding-left: 4px;\">&quot;);<br> this.r.document.writeln(&quot; <img src=\"" + portraiturl + "images/rig05.gif\"></li>&quot;);<br> this.r.document.writeln(&quot; </ul>&quot;);<br> this.r.document.writeln(&quot; </div>&quot;);<br> this.r.document.writeln(&quot; <div id=\"box\" style=\"display: none\" class=\"rig01\">&quot;);<br> this.r.document.writeln(&quot; <div style=\"float: left\">&quot;);<br> this.r.document.writeln(&quot; <img src=\"" + portraiturl + "images/rig07.gif\"></div>&quot;);<br> this.r.document.writeln(&quot; <div class=\"rig03\">&quot;);<br> this.r.document.writeln(&quot; <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>&quot;);<br> this.r.document.writeln(&quot; <div style=\"float: left; padding-left: 3px; padding-top: 3px;\">&quot;);<br> this.r.document.writeln(&quot; <a href=\"#\">邀請好友</a></div>&quot;);<br> this.r.document.writeln(&quot; </div>&quot;);<br> this.r.document.writeln(&quot; <div class=\"Contentbox\">&quot;);<br> this.r.document.writeln(&quot; <div id=\"con_one_1\" style=\"display: block;\">&quot;);<br> this.r.document.writeln(&quot; <table class=\'list\' width=\"100%\" border=\"0\" id=\"listtable_adm\" cellspacing=\"5\">&quot;);<br> this.r.document.writeln(&quot; </table>&quot;);<br> this.r.document.writeln(&quot; <table class=\'list\' width=\"100%\" border=\"0\" id=\"listtable_vip\" cellspacing=\"5\">&quot;);<br> this.r.document.writeln(&quot; </table>&quot;);<br> this.r.document.writeln(&quot; <table class=\'list\' width=\"100%\" border=\"0\" id=\"listtable_reg\" cellspacing=\"5\">&quot;);<br> this.r.document.writeln(&quot; </table>&quot;);<br> this.r.document.writeln(&quot; <table class=\'list\' width=\"100%\" border=\"0\" id=\"listtable_other\" cellspacing=\"5\">&quot;);<br> this.r.document.writeln(&quot; </table>&quot;);<br> this.r.document.writeln(&quot; </div>&quot;);<br> this.r.document.writeln(&quot; <div id=\"con_one_2\" style=\"display: none;\">&quot;);<br> this.r.document.writeln(&quot; <table class=\'list\' width=\"100%\" border=\"0\" id=\"listtable_adm\" cellspacing=\"5\">&quot;);<br> this.r.document.writeln(&quot; </table>&quot;);<br> this.r.document.writeln(&quot; </div>&quot;);<br> this.r.document.writeln(&quot; </div>&quot;);<br> this.r.document.writeln(&quot; </div>&quot;);<br> this.r.document.writeln(&quot;</body></html>&quot;);<br> this.r.document.writeln(&quot;<script type=\"text/javascript\">&quot;);<br> this.r.document.writeln(&quot; setTimeout(&#39;parent.BindListMenu();&#39;,5000);&quot;);<br> this.r.document.writeln(&quot;&lt;\/script&gt;&quot;);<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 &lt; autorefresh_threshold) || (autorefreshuserlist == true) || (refreshclick == true) &amp;&amp; (listshow == 0)) {<br> // for (var i = 0; i &lt; list.length; i++) {<br> // delete list[i]; <br> // }<br> list = new Array();<br> list[0] = &quot;&quot;;<br> for (i = 0; i &lt; count; i++) {<br> //name-&#39;adminmode-&#39;usertype-&#39;extinfo-&#39;icon&#39;-sex&#39;-voice&#39;-video<br> obj = Users.GetObject(i);<br> tmp = obj.name + &quot;-&#39;&quot; + obj.adminmode + &quot;-&#39;&quot; + obj.usertype + &quot;-&#39;&quot; + obj.extinfo + &quot;-&#39;&quot; + obj.icon + &quot;&#39;-&quot; + obj.voice + &quot;&#39;-&quot; + 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(&quot;refreshstart()&quot;, nTimer * 1000);<br> }<br> function sortuser() {<br> user_sorted = new Array();<br> for (var i = 1; i &lt; list.length; i++) {<br> if (list[i] != &quot;&quot;) {<br> var lists_split = list[i].split(&quot;&#39;-&quot;);</p> <pre><code> if (!lists_split[1]) lists_split[1] = &#39;0&#39;; if (!lists_split[2]) lists_split[2] = &#39;0&#39;; var lists_split_2 = lists_split[0].split(&quot;-&#39;&quot;); if (lists_split_2[1] != &#39;1&#39;) lists_split_2[1] = &#39;2&#39;; if (lists_split_2[0].substr(0, 1) == &quot;*&quot;) { usertype = &quot;0&quot;; } else { usertype = &quot;1&quot;; } userinfo = &quot;&quot;; user_str = lists_split_2[1]; user_str += &quot;&amp;&quot;; user_str += usertype; user_str += &quot;&amp;&quot;; user_str += userinfo; user_str += &quot;&amp;&quot;; user_str += lists_split_2[0]; user_str += &quot;&amp;&quot;; user_str += lists_split[1]; user_str += &quot;&amp;&quot;; user_str += lists_split[2]; user_str += &quot;&amp;&quot;; 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(&quot;<html><head><meta http-equiv=\"Content-Type\" content=\"text/html; charset=gb2312\">&quot;);<br> this.r.document.writeln(&quot;<style type=text/css>&quot;);<br> this.r.document.writeln(&quot;&lt;!--&quot;);<br> this.r.document.writeln(&quot;.p9 { font-size: 9pt}&quot;);<br> this.r.document.writeln(&quot;body { font-size: 9pt; margin:0; padding:0; width:175px; overflow-x:hidden}&quot;);<br> this.r.document.writeln(&quot;td { font-size: 9pt}&quot;);<br> this.r.document.writeln(&quot;a { color: #0000FF; text-decoration: none}&quot;);<br> this.r.document.writeln(&quot;#bl_yh_lb{margin:0 0 0 3px; padding:0;width:175px;}&quot;);<br> this.r.document.writeln(&quot;#bl_yh_lb li{line-height:21px; height:21px; list-style-type:none; margin:0; padding:2px 0;}&quot;);<br> this.r.document.writeln(&quot;--&gt;&quot;);<br> this.r.document.writeln(&quot;</style>&quot;);<br> this.r.document.writeln(&quot;<div id=\"Tips\" style=\"position:absolute; left:0; top:0; width:130; display=none; z-index:2\">&quot;);<br> this.r.document.writeln(&quot; <p class=\"\">&nbsp;</p>&quot;);<br> this.r.document.writeln(&quot;</div>&quot;);<br> this.r.document.writeln(&quot;</head><body bgcolor=\"#F3FFE1\" leftMargin=0>&quot;);<br> this.r.document.writeln(&quot;<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>&quot;);<br> this.r.document.writeln(&quot;<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>&quot;);<br> this.r.document.writeln(&quot;<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>&quot; + count + &quot;</font></div>&quot;);<br> this.r.document.writeln(&quot;<ul id=\"bl_yh_lb\">&quot;);<br> //alist=new Array();</p> <pre><code>for (var i = 0; i &lt; count; i++) { this.r.document.writeln(&quot;&lt;li&gt;&quot;); var displayname; thislists = user_sorted[i].split(&quot;&amp;&quot;); thisadminmode = thislists[0]; thistype = thislists[1]; thisinfo = thislists[2]; thisname = thislists[3]; thisvoice = thislists[4]; thisvideo = thislists[5]; thisextinfo = thislists[6]; thisex = &quot;&quot;; if (thisadminmode != &quot;1&quot;) thisadminmode = &quot;0&quot;; displayname = new String(thisname); myportrait = &quot;&quot;; myicon = &quot;&quot;; if (thisextinfo != 0) t = thisextinfo; else t = &quot;&quot;; var infolist = new Array(&quot;&quot;); if (t != &quot;&quot; &amp;&amp; displayname.substr(0, 1) == &quot;*&quot;) { infolist = t.split(&quot;:&quot;); if (!infolist[0]) { infolist[0] = &quot;&quot; }; if (!infolist[1]) { infolist[1] = &quot;&quot; }; if (!infolist[2]) { infolist[2] = &quot;&quot; }; myportrait = infolist[0]; myicon = infolist[1]; } userinfo0 = getptid(thisname, myportrait, thisadminmode) userinfo = userinfo0.split(&quot;\t&quot;); styletext = &quot;&quot; title = &quot;&quot;; adminmode_ret = thisadminmode; if (userinfo.length &gt;= 1) { ptid = userinfo[0]; if (userinfo.length &gt;= 2) { styletext = userinfo[1]; if (userinfo.length &gt;= 3) { title = userinfo[2]; if (userinfo.length &gt;= 4) { adminmode_ret = userinfo[3]; if (userinfo.length == 5) { title = userinfo[4]; } } } } } else { ptid = userinfo0; } if (showicon == true) { portrait = &quot;&lt;image src=&quot; + ptid + &quot;.gif border=0 align=absmiddle&gt;&quot;; } else portrait = &quot;&quot;; if (thisvoice == 1) { voicenote = &quot;&lt;font face=\&quot;Wingdings\&quot; color=#009900&gt;(&lt;/font&gt;&quot;; nametitle = thisname + &quot; 開麥&quot;; } else if (thisvoice == 2) { voicenote = &quot;&lt;font face=\&quot;Wingdings\&quot; color=black&gt;(&lt;/font&gt;&quot;; nametitle = thisname + &quot; 雙工&quot;; } else { voicenote = &quot;&quot;; nametitle = thisname + &quot; 關麥&quot;; } if (adminmode_ret == 1) { nametitle += &quot; 在線管理員&quot;; } if (title != &quot;&quot;) { nametitle += &quot; &quot; + title; } if (nametitle != &quot;&quot;) nametitle = &quot; title=\&quot;&quot; + nametitle + &quot;\&quot;&quot;; if (adminmode_ret == 1) { //alist[alist.length]=thisname; if (styletext == &quot;&quot;) { styletext = &quot;color:red;&quot;; displayname += &quot;&lt;font color=red&gt;*&lt;/font&gt;&quot;; } else { displayname += &quot;*&quot;; } } if (styletext == &quot;0&quot;) styletext = &quot;&quot;; if (styletext) { displayname = &quot;&lt;span style=&#39;&quot; + styletext + &quot;&#39;&gt;&quot; + displayname + &quot;&lt;/span&gt;&quot;; } this.r.document.writeln(portrait + &quot;&lt;a target=d href=\&quot;javascript:parent.cs(&#39;&quot; + thisname + &quot;&#39;)\&quot; &quot; + nametitle + &quot;&gt;&quot; + displayname + &quot;&lt;/a&gt;&quot;); this.r.document.writeln(voicenote); if (thisvideo == 1) { this.r.document.writeln(&quot;&lt;font face=\&quot;Webdings\&quot; color=000000&gt;N&lt;/font&gt;&quot;); } this.r.document.writeln(&quot;&lt;/li&gt;&quot;); } this.r.document.writeln(&quot;&lt;/ul&gt;&quot;); this.r.document.writeln(&quot;&lt;/div&gt;&lt;div align=center id=&#39;bottombanner&#39; style=&#39;border:0px solid #000000;padding:0;POSITION: relative; Left: 0px; TOP: 0px; HEIGHT: 40px; WIDTH: 130px;&#39;&gt;&lt;/div&gt;&quot;); this.r.document.writeln(&#39;&lt;/body&gt;&lt;/html&gt;&#39;); this.r.document.close(); </code></pre> <p>}<br> //////////////<br> function getptid(username, portrait, adminmode) {<br> style = &quot;&quot;;<br> return portraiturl + portrait + &quot;\t&quot; + style;<br> }</p> <p>var ListTable = [&quot;listtable_adm&quot;, &quot;listtable_vip&quot;, &quot;listtable_reg&quot;, &quot;listtable_other&quot;];<br> var ListUserCount = 0;<br> var Order = false;<br> window.setInterval(function () {<br> var num = Users.GetCount();<br> if (num - ListUserCount &lt; 30 &amp;&amp; ListUserCount - num &lt; 30 &amp;&amp; !Order) {<br> for (var s = 0; s &lt; 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 &lt;= p_length - 2; i++) {<br> for (var j = p_length - 1; j &gt;= 1; j--) {<br> if (listtable.rows[j].level &lt; 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 = &quot;block&quot;;<br> }<br> function hideElement(elementId) {<br> document.getElementById(elementId).style.display = &quot;none&quot;;<br> }</p>

最佳回答:


你這個代碼是在js文件裡面還是script標簽裡面的?如果script標簽裡面你下面這句要對script結束標簽轉義下,要不會導致代碼截斷而出錯

 this.r.document.writeln("    </script>");

==>

 this.r.document.writeln("    <\/script>");
  1. 上一頁:
  2. 下一頁:
Copyright © 程式師世界 All Rights Reserved