현재 접속자 나오게..알라뷰님 스킨도용 > 그누4 플러그인

그누4 플러그인

그누보드에는 여러가지 기능 추가가 쉽도록 제작 되었습니다.
플러그인의 저작권은 해당 플러그인 제작자님께 있으며, 그누보드의 저작권과 다를 수 있습니다.
플러그인 다운로드시 좋아요와 감사의 코멘트를 남기시면 제작자에게 큰 힘이됩니다. ^^y

현재 접속자 나오게..알라뷰님 스킨도용 정보

현재 접속자 나오게..알라뷰님 스킨도용

첨부파일

bada_connec_2-1.zip (27.0K) 178회 다운로드 2007-04-11 12:32:03

본문

허락 없이 죄송합니다..

그리고 알라뷰님의 스킨을 약간 맞게 수정하여 올립니다.
안에 읽어보기를 참조하세요.


#################################################################
chat.php내용은 아래처럼...

<?
include_once("_common.php");
include_once("$g4[path]/_head.php");
?>

<!----------------------------------------------------------------------------------->
<!-- 채팅 -->
<!----------------------------------------------------------------------------------->
<div id='chatting'>
<TABLE cellpadding=0 cellspacing=0 border=0 width=720>
<TR>
<TD width=520 valign=top>
<b>그누채팅</b>
    <div id='chat' style='width:515px;height:320px;overflow-y:scroll;border:1px solid #aaaaaa;padding:5px;font-size:9pt;font-family:굴림;line-height:130%;text-align:left;'
        onmouseover='is_scroll=true;'
        onblur='is_scroll=false'></div>
    <div style="clear:both; padding:5px 0 0 0;"></div>
    <input type='hidden' id='last_id'>
    <input type='hidden' id='chat_color' value='#000000'>
    <input type='text' id='chat_name' style='border:0px solid #FFFFFF;' size=10 readonly>
    <input type='text' id='chat_msg' size=48>
    <input type=button value=' 전송 ' onclick='chat_update();'><BR>
<!-- 이모티콘 (C) <a href="http://www.nate.com" target=_blank><img src='<?=$g4[path]?>/chat/img/icon/nate.gif' border=0 align=absmiddle> nate.com</a>
 --></div>
</TD>
<TD width=200 valign=top><BR>
<?=connect2("bada"); // 접속자 ?>
</TD>
<script>
var colorTable = [
    "#5F9EA0", "#48D1CC", "#00FFFF", "#40E0D0", "#20B2AA", "#008B8B", "#008080", "#7FFFD4", "#66CDAA", "#8FBC8F",
    "#3CB371", "#2E8B57", "#006400", "#008000", "#228B22", "#32CD32", "#00FF00", "#7FFF00", "#7CFC00", "#ADFF2F",
    "#98FB98", "#90EE90", "#00FF7F", "#00FA9A", "#556B2F", "#6B8E23", "#808000", "#BDB76B", "#B8860B", "#DAA520",
    "#FFD700", "#F0E68C", "#EEE8AA", "#FFEBCD", "#FFE4B5", "#F5DEB3", "#FFDEAD", "#DEB887", "#D2B48C", "#BC8F8F",
    "#A0522D", "#8B4513", "#D2691E", "#CD853F", "#F4A460", "#8B0000", "#800000", "#A52A2A", "#B22222", "#CD5C5C",
    "#F08080", "#FA8072", "#E9967A", "#FFA07A", "#FF7F50", "#FF6347", "#FF8C00", "#FFA500", "#FF4500", "#DC143C",
    "#FF0000", "#FF1493", "#FF00FF", "#FF69B4", "#FFB6C1", "#FFC0CB", "#DB7093", "#C71585", "#800080", "#8B008B",
    "#9370DB", "#8A2BE2", "#4B0082", "#9400D3", "#9932CC", "#BA55D3", "#DA70D6", "#EE82EE", "#DDA0DD", "#D8BFD8", "#000000"
];
var k = 0;
var w = 3;
var h = 27;
document.write("<table width=520>");
for (var i = 0; i < w; i++) {
    document.write("<tr>");
    for (var j = 0; j < h; j++) {
        document.write("<td onclick=\"document.getElementById('chat_color').value='"+colorTable[k]+"';\" style='background-color:"+colorTable[k]+";cursor:pointer;' width=15px>&nbsp;</td>");
        k++;
    }
    document.write("</tr>");
}
document.write("</table>");
</script>

</TR>
</TABLE>

<script>
// request 객체 생성
var req = null;
function create_request() {
    var request = null;
    try {
        request = new XMLHttpRequest();
    } catch (trymicrosoft) {
        try {
            request = new ActiveXObject("Msxml12.XMLHTTP");
        } catch (othermicrosoft) {
            try {
                request = new ActiveXObject("Microsoft.XMLHTTP");
            } catch (failed) {
                request = null;
            }
        }
    }
    if (request == null)
        alert("Error creating request object!");
    else
        return request;
}

var req = create_request();

var interval = 1000;
var timer_id;
var is_scroll = false;
var max_chat = 50;
var cur_chat = 0;

function chat_update() {
    var chat_name = document.getElementById('chat_name').value;
    var chat_msg = document.getElementById('chat_msg').value;
    var chat_color = document.getElementById('chat_color').value;
    var last_id = document.getElementById('last_id').value;

    var url = '<?=$g4[path]?>/chat/chat_update.php';
    var param = '';
    param += 'name=' + encodeURIComponent(chat_name);
    param += '&msg=' + encodeURIComponent(chat_msg);
    param += '&color=' + encodeURIComponent(chat_color);
    param += '&last_id=' + escape(last_id);

    req.open("POST", url, true);
    req.onreadystatechange = chat_update_complete;
    req.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
    req.send(param);
}

function chat_update_complete() {
    if (req.readyState == 4) {
        if (req.status == 200) {
            chat_result_display(req);
        }
    } else {
        timer_id = setTimeout("chat_get()", interval);
    }

    document.getElementById('chat').scrollTop = 100000;
    document.getElementById('chat_msg').value = '';
}

function chat_get() {
    //alert(req.responseText);
    var last_id = document.getElementById('last_id').value;

    if (cur_chat > max_chat) {
        document.getElementById('chat').innerHTML = "";
        cur_chat = 0;
        last_id = '';
    }
   

    var url = '<?=$g4[path]?>/chat/chat_update.php';
    var param = '';
    param += 'last_id=' + last_id;

    req.open("POST", url, true);
    req.onreadystatechange = chat_get_complete;
    req.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
    req.send(param);
}

function chat_get_complete() {
    if (req.readyState == 4) {
        if (req.status == 200) {
            chat_result_display(req);

            timer_id = setTimeout("chat_get()", interval);

            if (!is_scroll) document.getElementById('chat').scrollTop = 100000;
        }
    }
}

function chat_result_display(req) {
    var chat = req.responseXML.getElementsByTagName("chat");
    //document.getElementById('chat').innerHTML = req.responseText;
    //alert(req.responseText);

    for (i=0; i<chat.length; i++) {
        document.getElementById('last_id').value = chat[i].getElementsByTagName("ch_id")[0].firstChild.nodeValue;
        ch_name = chat[i].getElementsByTagName("ch_name")[0].firstChild.nodeValue;
        ch_msg = chat[i].getElementsByTagName("ch_msg")[0].firstChild.nodeValue;
        ch_msg = ch_msg.replace(/개/g,"<img src='<?=$g4[path]?>/chat/img/icon/1.gif'>(개)");
        ch_msg = ch_msg.replace(/게임/g,"<img src='<?=$g4[path]?>/chat/img/icon/2.gif'>(게임)");
        ch_msg = ch_msg.replace(/경고/g,"<img src='<?=$g4[path]?>/chat/img/icon/3.gif'>(경고)");
        ch_msg = ch_msg.replace(/기도/g,"<img src='<?=$g4[path]?>/chat/img/icon/4.gif'>(기도)");
        ch_msg = ch_msg.replace(/김밥/g,"<img src='<?=$g4[path]?>/chat/img/icon/5.gif'>(김밥)");
        ch_msg = ch_msg.replace(/꽃/g,"<img src='<?=$g4[path]?>/chat/img/icon/6.gif'>(꽃)");
        ch_msg = ch_msg.replace(/남자/g,"<img src='<?=$g4[path]?>/chat/img/icon/7.gif'>(남자)");
        ch_msg = ch_msg.replace(/냉무/g,"<img src='<?=$g4[path]?>/chat/img/icon/8.gif'>(냉무)");
        ch_msg = ch_msg.replace(/노래/g,"<img src='<?=$g4[path]?>/chat/img/icon/9.gif'>(노래)");
        ch_msg = ch_msg.replace(/농구/g,"<img src='<?=$g4[path]?>/chat/img/icon/10.gif'>(농구)");
        ch_msg = ch_msg.replace(/달/g,"<img src='<?=$g4[path]?>/chat/img/icon/11.gif'>(달)");
        ch_msg = ch_msg.replace(/담배/g,"<img src='<?=$g4[path]?>/chat/img/icon/12.gif'>(담배)");
        ch_msg = ch_msg.replace(/돈/g,"<img src='<?=$g4[path]?>/chat/img/icon/13.gif'>(돈)");
        ch_msg = ch_msg.replace(/돌/g,"<img src='<?=$g4[path]?>/chat/img/icon/14.gif'>(돌)");
        ch_msg = ch_msg.replace(/똥/g,"<img src='<?=$g4[path]?>/chat/img/icon/15.gif'>(똥)");
        ch_msg = ch_msg.replace(/마귀/g,"<img src='<?=$g4[path]?>/chat/img/icon/16.gif'>(마귀)");
        ch_msg = ch_msg.replace(/맥주/g,"<img src='<?=$g4[path]?>/chat/img/icon/17.gif'>(맥주)");
        ch_msg = ch_msg.replace(/메롱/g,"<img src='<?=$g4[path]?>/chat/img/icon/18.gif'>(메롱)");
        ch_msg = ch_msg.replace(/미소/g,"<img src='<?=$g4[path]?>/chat/img/icon/19.gif'>(미소)");
        ch_msg = ch_msg.replace(/밥/g,"<img src='<?=$g4[path]?>/chat/img/icon/20.gif'>(밥)");
        ch_msg = ch_msg.replace(/방긋/g,"<img src='<?=$g4[path]?>/chat/img/icon/21.gif'>(방긋)");
        ch_msg = ch_msg.replace(/버스/g,"<img src='<?=$g4[path]?>/chat/img/icon/22.gif'>(버스)");
        ch_msg = ch_msg.replace(/별/g,"<img src='<?=$g4[path]?>/chat/img/icon/23.gif'>(별)");
        ch_msg = ch_msg.replace(/삐질/g,"<img src='<?=$g4[path]?>/chat/img/icon/24.gif'>(삐질)");
        ch_msg = ch_msg.replace(/사랑/g,"<img src='<?=$g4[path]?>/chat/img/icon/25.gif'>(사랑)");
        ch_msg = ch_msg.replace(/샌드위치/g,"<img src='<?=$g4[path]?>/chat/img/icon/26.gif'>(샌드위치)");
        ch_msg = ch_msg.replace(/선물/g,"<img src='<?=$g4[path]?>/chat/img/icon/27.gif'>(선물)");
        ch_msg = ch_msg.replace(/승용차/g,"<img src='<?=$g4[path]?>/chat/img/icon/28.gif'>(승용차)");
        ch_msg = ch_msg.replace(/시간/g,"<img src='<?=$g4[path]?>/chat/img/icon/29.gif'>(시간)");
        ch_msg = ch_msg.replace(/씨익/g,"<img src='<?=$g4[path]?>/chat/img/icon/30.gif'>(씨익)");
        ch_msg = ch_msg.replace(/ㅜ/g,"<img src='<?=$g4[path]?>/chat/img/icon/31.gif'>(ㅜ)");
        ch_msg = ch_msg.replace(/아픔/g,"<img src='<?=$g4[path]?>/chat/img/icon/32.gif'>(아픔)");
        ch_msg = ch_msg.replace(/약/g,"<img src='<?=$g4[path]?>/chat/img/icon/33.gif'>(약)");
        ch_msg = ch_msg.replace(/여자/g,"<img src='<?=$g4[path]?>/chat/img/icon/34.gif'>(여자)");
        ch_msg = ch_msg.replace(/우산/g,"<img src='<?=$g4[path]?>/chat/img/icon/35.gif'>(우산)");
ch_msg = ch_msg.replace(/윀/g,"<img src='<?=$g4[path]?>/chat/img/icon/36.gif'>(윀)");
        ch_msg = ch_msg.replace(/윙크/g,"<img src='<?=$g4[path]?>/chat/img/icon/37.gif'>(윙크)");
        ch_msg = ch_msg.replace(/전화/g,"<img src='<?=$g4[path]?>/chat/img/icon/38.gif'>(전화)");
        ch_msg = ch_msg.replace(/젠장/g,"<img src='<?=$g4[path]?>/chat/img/icon/39.gif'>(젠장)");
ch_msg = ch_msg.replace(/지하철/g,"<img src='<?=$g4[path]?>/chat/img/icon/40.gif'>(지하철)");
ch_msg = ch_msg.replace(/짜잔/g,"<img src='<?=$g4[path]?>/chat/img/icon/41.gif'>(짜잔)");
        ch_msg = ch_msg.replace(/짜증/g,"<img src='<?=$g4[path]?>/chat/img/icon/42.gif'>(짜증)");
        ch_msg = ch_msg.replace(/천사/g,"<img src='<?=$g4[path]?>/chat/img/icon/43.gif'>(천사)");
        ch_msg = ch_msg.replace(/ㅋ/g,"<img src='<?=$g4[path]?>/chat/img/icon/44.gif'>(ㅋ)");
        ch_msg = ch_msg.replace(/커피/g,"<img src='<?=$g4[path]?>/chat/img/icon/45.gif'>(커피)");
        ch_msg = ch_msg.replace(/컴퓨터/g,"<img src='<?=$g4[path]?>/chat/img/icon/46.gif'>(컴퓨터)");
        ch_msg = ch_msg.replace(/케잌/g,"<img src='<?=$g4[path]?>/chat/img/icon/47.gif'>(케잌)");
        ch_msg = ch_msg.replace(/쿨/g,"<img src='<?=$g4[path]?>/chat/img/icon/48.gif'>(쿨)");
        ch_msg = ch_msg.replace(/크억/g,"<img src='<?=$g4[path]?>/chat/img/icon/49.gif'>(크억)");
        ch_msg = ch_msg.replace(/태극기/g,"<img src='<?=$g4[path]?>/chat/img/icon/50.gif'>(태극기)");
ch_msg = ch_msg.replace(/퇘/g,"<img src='<?=$g4[path]?>/chat/img/icon/51.gif'>(퇘)");
ch_msg = ch_msg.replace(/퇴장/g,"<img src='<?=$g4[path]?>/chat/img/icon/52.gif'>(퇴장)");
        ch_msg = ch_msg.replace(/편지/g,"<img src='<?=$g4[path]?>/chat/img/icon/53.gif'>(편지)");
        ch_msg = ch_msg.replace(/아자/g,"<img src='<?=$g4[path]?>/chat/img/icon/54.gif'>(아자)");
        ch_msg = ch_msg.replace(/ㅎ/g,"<img src='<?=$g4[path]?>/chat/img/icon/55.gif'>(ㅎ)");
        ch_msg = ch_msg.replace(/맑음/g,"<img src='<?=$g4[path]?>/chat/img/icon/56.gif'>(맑음)");
        ch_msg = ch_msg.replace(/핸드폰/g,"<img src='<?=$g4[path]?>/chat/img/icon/57.gif'>(핸드폰)");
        ch_msg = ch_msg.replace(/헉/g,"<img src='<?=$g4[path]?>/chat/img/icon/58.gif'>(헉)");
        ch_msg = ch_msg.replace(/헤/g,"<img src='<?=$g4[path]?>/chat/img/icon/59.gif'>(헤)");
        ch_msg = ch_msg.replace(/화남/g,"<img src='<?=$g4[path]?>/chat/img/icon/60.gif'>(화남)");
        ch_msg = ch_msg.replace(/화이팅/g,"<img src='<?=$g4[path]?>/chat/img/icon/61.gif'>(화이팅)");
        ch_msg = ch_msg.replace(/황금/g,"<img src='<?=$g4[path]?>/chat/img/icon/62.gif'>(황금)");
        ch_msg = ch_msg.replace(/휴/g,"<img src='<?=$g4[path]?>/chat/img/icon/63.gif'>(휴)");
        ch_color = chat[i].getElementsByTagName("ch_color")[0].firstChild.nodeValue;
        document.getElementById('chat').innerHTML += "<span style='color:"+ch_color+";'>" + ch_name + "</span> : <span style='color:"+ch_color+";'>" + ch_msg + "</span></br>";
        cur_chat++;
    }
}

var g4_is_ie    = navigator.userAgent.toLowerCase().indexOf("msie") != -1;
if (g4_is_ie)
    document.getElementById('chat_msg').onkeypress = function() { if (event.keyCode==13) chat_update(); }
else
    document.getElementById('chat_msg').onkeypress = function(event) { if (event.keyCode==13) chat_update(); }

document.getElementById('chat_name').value = "<?=$member[mb_id]?$member[mb_nick]:'손님_'.rand(1,1000)?>";
document.getElementById('chat_msg').focus();

chat_get();
</script>
<!----------------------------------------------------------------------------------->
<?
include_once("$g4[path]/_tail.php");
?>
추천
0
  • 복사

댓글 전체

© SIRSOFT
현재 페이지 제일 처음으로