我自己写的聊天室源代码(十_2)

来源:岁月联盟 编辑:zhuzhu 时间:2003-07-11
<%'************************刷新,中*******************************%>

                    if trim(request.form("who")) <> "所有人" then
                        if isnumeric(request.form("time1")) then
                            sc_who = session("ss_name")
                            sc_who1 = trim(request.form("who"))
                            sc_time = cstr(now)
                            sc_time1 = cstr(dateadd("n",cint(request.form("time1")),now))
                            sc_ss = "3"
                            sc_long = trim(cstr(request.form("time1")))
                            application.lock
                                sc_userout = application("ap_userout")
                                sc_point = application("ap_point")
                                sc_message = application("ap_message")
                                for i = 1 to 30
                                    if trim(sc_userout(i,1)) = "" then
                                        sc_userout(i,1) = sc_who
                                        sc_userout(i,2) = sc_who1
                                        sc_userout(i,3) = sc_ss
                                        sc_userout(i,4) = sc_time
                                        sc_userout(i,5) = sc_time1
                                        sc_userout(i,6) = sc_long
                                        if sc_point > 50 then
                                            sc_point = 1
                                        end if
                                        sc_message(sc_point,1) = sc_who
                                        sc_message(sc_point,2) = "所有人"
                                        sc_message(sc_point,3) = "<strong>" + sc_who + "</strong> 封闭了 <strong>" + sc_who1 + "</strong> 的刷新功能!"
                                        sc_message(sc_point,4) = ""
                                        sc_message(sc_point,5) = "3"
                                        sc_message(sc_point,6) = "<font color='#FF0000'>"
                                        sc_ttt = now
                                        if hour(sc_ttt) < 10 then
                                            sc_message(sc_point,7) = "0" + cstr(hour(sc_ttt)) + ":"
                                        else
                                            sc_message(sc_point,7) = "" + cstr(hour(sc_ttt)) + ":"
                                        end if
                                        if minute(sc_ttt) < 10 then
                                            sc_message(sc_point,7) = sc_message(sc_point,7) + "0" + cstr(minute(sc_ttt)) + ":"
                                        else
                                            sc_message(sc_point,7) = sc_message(sc_point,7) + cstr(minute(sc_ttt)) + ":"
                                        end if
                                        if second(sc_ttt) < 10 then
                                            sc_message(sc_point,7) = sc_message(sc_point,7) + "0" + cstr(second(sc_ttt))
                                        else
                                            sc_message(sc_point,7) = sc_message(sc_point,7) + cstr(second(sc_ttt))
                                        end if
                                        sc_point = sc_point + 1
                                        if sc_point > 50 then
                                            sc_point = 1
                                        end if
                                        exit for
                                    end if
                                next
                                application("ap_userout") = sc_userout
                                application("ap_point") = sc_point
                                application("ap_message") = sc_message
                            application.unlock
                        end if
                    end if
            end select
            '配置输出
            application.lock
                my_message = application("ap_message")
                my_point = application("ap_point")
                my_usernum = application("ap_usernum")
            application.unlock
            j = 0
            sc_xx = 0
            for i = session("ss_oldpoint") + 1 to 50
                if i = my_point then
                    session("ss_oldpoint") = my_point - 1
                    sc_xx = 1
                    exit for
                end if
                j = j+1
                '建立语句
                my_message1(j)=""
                '分清说话类别
                '标志位:1踢人,2禁止说话,3禁止浏览,4公开话,5悄悄话,6动作,7进入,8退出
                select case my_message(i,5)
                    case "1"
                        '踢人
                        my_message1(j) = "<font color='#008000'>系统消息(踢人):</font>"
                        my_message1(j) = my_message1(j) + my_message(i,6) + my_message(i,3)
                        my_message1(j) = my_message1(j) + "[<small>" + my_message(i,7) + "</small>]" + "</font>"
                    case "2"
                        '禁止说话
                        my_message1(j) = "<font color='#008000'>系统消息(禁止说话):</font>"
                        my_message1(j) = my_message1(j) + my_message(i,6) + my_message(i,3)
                        my_message1(j) = my_message1(j) + "[<small>" + my_message(i,7) + "</small>]" + "</font>"
                    case "3"
                        '禁止浏览
                        my_message1(j) = "<font color='#008000'>系统消息(禁止浏览):</font>"
                        my_message1(j) = my_message1(j) + my_message(i,6) + my_message(i,3)
                        my_message1(j) = my_message1(j) + "[<small>" + my_message(i,7) + "</small>]" + "</font>"
                    case "4"
                        '公开话
                        '源
                        my_message1(j) = "<strong>" + my_message(i,1) + "</strong>"
                        '表情
                        my_message1(j) = my_message1(j) + "<font color='#FF00FF'><small>" + my_message(i,4) + "</small></font>,"
                        my_message1(j) = my_message1(j) + "<font color='#FF0000'><small>" + "对" + "</small></font>"
                        '目标
                        my_message1(j) = my_message1(j) + "<strong>" + my_message(i,2) + "</strong>"
                        my_message1(j) = my_message1(j) + "<font color='#008000'>" + "说:" + "</font>"
                        '内容
                        my_message1(j) = my_message1(j) + my_message(i,6) + my_message(i,3)
                        '时间
                        my_message1(j) = my_message1(j) + "[<small>" + my_message(i,7) + "</small>]" + "</font>"
                    case "5"
                        '悄悄话
                        '源
                        if (trim(session("ss_name")) = trim(my_message(i,2))) or (trim(session("ss_name")) = trim(my_message(i,1))) then
                            my_message1(j) = "<strong>" + my_message(i,1) + "</strong>"
                            '表情
                            my_message1(j) = my_message1(j) + "<font color='#FF00FF'><small>" + my_message(i,4) + "</small></font>,"
                            my_message1(j) = my_message1(j) + "<font color='#FF0000'><small>" + "悄悄对" + "</small></font>"
                            '目标
                            my_message1(j) = my_message1(j) + "<strong>" + my_message(i,2) + "</strong>"
                            my_message1(j) = my_message1(j) + "<font color='#008000'>" + "说:" + "</font>"
                            '内容
                            my_message1(j) = my_message1(j) + my_message(i,6) + my_message(i,3)
                            '时间
                            my_message1(j) = my_message1(j) + "[<small>" + my_message(i,7) + "</small>]" + "</font>"
                        end if
                    case "6"
                        '动作
                        my_message1(j) = "<font color='#008000'><strong>" + my_message(i,1) + "</strong></font>:"
                        my_message1(j) = my_message1(j) + my_message(i,6) + my_message(i,3)
                        my_message1(j) = my_message1(j) + "[<small>" + my_message(i,7) + "</small>]" + "</font>"
                    case "7"
                        '进入
                        my_message1(j) = "<font color='#008000'>系统消息(" + my_message(i,1) + "进入聊天室):</font>"
                        my_message1(j) = my_message1(j) + my_message(i,6) + my_message(i,3)
                        my_message1(j) = my_message1(j) + "[<small>" + my_message(i,7) + "</small>]" + "</font>"
                    case "8"
                        '退出
                        my_message1(j) = "<font color='#008000'>系统消息(" + my_message(i,1) + "离开聊天室):</font>"
                        my_message1(j) = my_message1(j) + my_message(i,6) + my_message(i,3)
                        my_message1(j) = my_message1(j) + "[<small>" + my_message(i,7) + "</small>]" + "</font>"
                end select
            next
            if sc_xx = 0 then
                for i = 1 to my_point
                    if i = my_point then
                        session("ss_oldpoint") = my_point - 1
                        if session("ss_oldpoint") < 1 then
                            session("ss_oldpoint") = 50
                        end if
                        sc_xx = 1
                        exit for
                    end if
                    j = j+1
                    '建立语句
                    my_message1(j)=""
                    '分清说话类别
                    '标志位:1踢人,2禁止说话,3禁止浏览,4公开话,5悄悄话,6动作,7进入,8退出
                    select case my_message(i,5)
                        case "1"
                            '踢人
                            my_message1(j) = "<font color='#008000'>系统消息(踢人):</font>"
                            my_message1(j) = my_message1(j) + my_message(i,6) + my_message(i,3)
                            my_message1(j) = my_message1(j) + "[<small>" + my_message(i,7) + "</small>]" + "</font>"
                        case "2"
                            '禁止说话
                            my_message1(j) = "<font color='#008000'>系统消息(禁止说话):</font>"
                            my_message1(j) = my_message1(j) + my_message(i,6) + my_message(i,3)
                            my_message1(j) = my_message1(j) + "[<small>" + my_message(i,7) + "</small>]" + "</font>"
                        case "3"
                            '禁止浏览
                            my_message1(j) = "<font color='#008000'>系统消息(禁止浏览):</font>"
                            my_message1(j) = my_message1(j) + my_message(i,6) + my_message(i,3)
                            my_message1(j) = my_message1(j) + "[<small>" + my_message(i,7) + "</small>]" + "</font>"
                        case "4"
                            '公开话
                            '源
                            my_message1(j) = "<strong>" + my_message(i,1) + "</strong>"
                            '表情
                            my_message1(j) = my_message1(j) + "<font color='#FF00FF'><small>" + my_message(i,4) + "</small></font>,"
                            my_message1(j) = my_message1(j) + "<font color='#FF0000'><small>" + "对" + "</small></font>"
                            '目标
                            my_message1(j) = my_message1(j) + "<strong>" + my_message(i,2) + "</strong>"
                            my_message1(j) = my_message1(j) + "<font color='#008000'>" + "说:" + "</font>"
                            '内容
                            my_message1(j) = my_message1(j) + my_message(i,6) + my_message(i,3)
                            '时间
                            my_message1(j) = my_message1(j) + "[<small>" + my_message(i,7) + "</small>]" + "</font>"
                        case "5"
                            '悄悄话
                            '源
                            if (trim(session("ss_name")) = trim(my_message(i,2))) or (trim(session("ss_name")) = trim(my_message(i,1))) then
                                my_message1(j) = "<strong>" + my_message(i,1) + "</strong>"
                                '表情
                                my_message1(j) = my_message1(j) + "<font color='#FF00FF'><small>" + my_message(i,4) + "</small></font>,"
                                my_message1(j) = my_message1(j) + "<font color='#FF0000'><small>" + "悄悄对" + "</small></font>"
                                '目标
                                my_message1(j) = my_message1(j) + "<strong>" + my_message(i,2) + "</strong>"
                                my_message1(j) = my_message1(j) + "<font color='#008000'>" + "说:" + "</font>"
                                '内容
                                my_message1(j) = my_message1(j) + my_message(i,6) + my_message(i,3)
                                '时间
                                my_message1(j) = my_message1(j) + "[<small>" + my_message(i,7) + "</small>]" + "</font>"
                            end if
                        case "6"
                            '动作
                            my_message1(j) = "<font color='#008000'><strong>" + my_message(i,1) + "</strong></font>:"
                            my_message1(j) = my_message1(j) + my_message(i,6) + my_message(i,3)
                            my_message1(j) = my_message1(j) + "[<small>" + my_message(i,7) + "</small>]" + "</font>"
                        case "7"
                            '进入
                            my_message1(j) = "<font color='#008000'>系统消息(" + my_message(i,1) + "进入聊天室):</font>"
                            my_message1(j) = my_message1(j) + my_message(i,6) + my_message(i,3)
                            my_message1(j) = my_message1(j) + "[<small>" + my_message(i,7) + "</small>]" + "</font>"
                        case "8"
                            '退出
                            my_message1(j) = "<font color='#008000'>系统消息(" + my_message(i,1) + "离开聊天室):</font>"
                            my_message1(j) = my_message1(j) + my_message(i,6) + my_message(i,3)
                            my_message1(j) = my_message1(j) + "[<small>" + my_message(i,7) + "</small>]" + "</font>"
                    end select
                next
            end if
            my_usernum = application("ap_usernum")
            if my_usernum <> session("ss_usernum") then
                session("ss_usernum") = my_usernum%>
<script language="JavaScript"><!--
parent.topright.location.href = "online.asp";
// --></script>
<%            end if
        case 1
            '被踢%>
<script language="javascript"><!--
            parent.location.href = "goout.asp";
//--></script>
<%        case 2
            '禁止聊天
            '配置输出
            application.lock
                my_message = application("ap_message")
                my_point = application("ap_point")
                my_usernum = application("ap_usernum")
            application.unlock
            j = 0
            sc_xx = 0
            for i = session("ss_oldpoint") + 1 to 50
                if i = my_point then
                    session("ss_oldpoint") = my_point - 1
                    sc_xx = 1
                    exit for
                end if
                j = j+1
                '建立语句
                my_message1(j)=""
                '分清说话类别
                '标志位:1踢人,2禁止说话,3禁止浏览,4公开话,5悄悄话,6动作,7进入,8退出
                select case my_message(i,5)
                    case "1"
                        '踢人
                        my_message1(j) = "<font color='#008000'>系统消息(踢人):</font>"
                        my_message1(j) = my_message1(j) + my_message(i,6) + my_message(i,3)
                        my_message1(j) = my_message1(j) + "[<small>" + my_message(i,7) + "</small>]" + "</font>"
                    case "2"
                        '禁止说话
                        my_message1(j) = "<font color='#008000'>系统消息(禁止说话):</font>"
                        my_message1(j) = my_message1(j) + my_message(i,6) + my_message(i,3)
                        my_message1(j) = my_message1(j) + "[<small>" + my_message(i,7) + "</small>]" + "</font>"
                    case "3"
                        '禁止浏览
                        my_message1(j) = "<font color='#008000'>系统消息(禁止浏览):</font>"
                        my_message1(j) = my_message1(j) + my_message(i,6) + my_message(i,3)
                        my_message1(j) = my_message1(j) + "[<small>" + my_message(i,7) + "</small>]" + "</font>"
                    case "4"
                        '公开话
                        '源
                        my_message1(j) = "<strong>" + my_message(i,1) + "</strong>"
                        '表情
                        my_message1(j) = my_message1(j) + "<font color='#FF00FF'><small>" + my_message(i,4) + "</small></font>,"
                        my_message1(j) = my_message1(j) + "<font color='#FF0000'><small>" + "对" + "</small></font>"
                        '目标
                        my_message1(j) = my_message1(j) + "<strong>" + my_message(i,2) + "</strong>"
                        my_message1(j) = my_message1(j) + "<font color='#008000'>" + "说:" + "</font>"
                        '内容
                        my_message1(j) = my_message1(j) + my_message(i,6) + my_message(i,3)
                        '时间
                        my_message1(j) = my_message1(j) + "[<small>" + my_message(i,7) + "</small>]" + "</font>"
                    case "5"
                        '悄悄话
                        '源
                        if (trim(session("ss_name")) = trim(my_message(i,2))) or (trim(session("ss_name")) = trim(my_message(i,1))) then
                            my_message1(j) = "<strong>" + my_message(i,1) + "</strong>"
                            '表情
                            my_message1(j) = my_message1(j) + "<font color='#FF00FF'><small>" + my_message(i,4) + "</small></font>,"
                            my_message1(j) = my_message1(j) + "<font color='#FF0000'><small>" + "悄悄对" + "</small></font>"
                            '目标
                            my_message1(j) = my_message1(j) + "<strong>" + my_message(i,2) + "</strong>"
                            my_message1(j) = my_message1(j) + "<font color='#008000'>" + "说:" + "</font>"
                            '内容
                            my_message1(j) = my_message1(j) + my_message(i,6) + my_message(i,3)
                            '时间
                            my_message1(j) = my_message1(j) + "[<small>" + my_message(i,7) + "</small>]" + "</font>"
                        end if
                    case "6"
                        '动作
                        my_message1(j) = "<font color='#008000'><strong>" + my_message(i,1) + "</strong></font>:"
                        my_message1(j) = my_message1(j) + my_message(i,6) + my_message(i,3)
                        my_message1(j) = my_message1(j) + "[<small>" + my_message(i,7) + "</small>]" + "</font>"
                    case "7"
                        '进入
                        my_message1(j) = "<font color='#008000'>系统消息(" + my_message(i,1) + "进入聊天室):</font>"
                        my_message1(j) = my_message1(j) + my_message(i,6) + my_message(i,3)
                        my_message1(j) = my_message1(j) + "[<small>" + my_message(i,7) + "</small>]" + "</font>"
                    case "8"
                        '退出
                        my_message1(j) = "<font color='#008000'>系统消息(" + my_message(i,1) + "离开聊天室):</font>"
                        my_message1(j) = my_message1(j) + my_message(i,6) + my_message(i,3)
                        my_message1(j) = my_message1(j) + "[<small>" + my_message(i,7) + "</small>]" + "</font>"
                end select
            next
            if sc_xx = 0 then