Page 15 of 16

Re: [RC] cBB Chat 1.0.1

Posted: Wed Feb 25, 2015 12:41 am
by DavidIQ
bachusteam wrote:work with phhpbb 3.1.3?
MODs don't work with 3.1. You would need an extension.

Re: [RC] cBB Chat 1.0.1

Posted: Wed Feb 25, 2015 12:50 am
by bachusteam
meens?

Re: [RC] cBB Chat 1.0.1

Posted: Wed Feb 25, 2015 12:52 am
by DavidIQ
bachusteam wrote:meens?
The answer is no this MOD, and pretty much any other MOD, does not work with 3.1. Look in the extensions forums if you want something for 3.1.

Re: [RC] cBB Chat 1.0.1

Posted: Wed Feb 25, 2015 1:43 am
by 777Firebrand777
If anybody wants to force date and time format on chat, do the following:

chat/includes/functions_ajax.php

Find:

Code: Select all

$user->format_date($row['topic_time'])
Replace:

Code: Select all

$user->format_date($row['topic_time'], 'Y. m. d. - H:i:s')
Find:

Code: Select all

$user->format_date($row['message_time'])
Replace:

Code: Select all

$user->format_date($row['message_time'], 'Y. m. d. - H:i:s')
Some users don't bother with setting date and time settings, so you better force this on chat. Otherwise all the messages will be labeled as (less then one minute) unless you refresh.

Re: [RC] cBB Chat 1.0.1

Posted: Thu Mar 12, 2015 7:10 am
by Dead Man
How can one get the entire BACKGROUND BLACK. For some reason I cannot find anything that lets me change the color of WHITE from the EVEN number rows.

Re: [RC] cBB Chat 1.0.1

Posted: Thu Mar 12, 2015 3:51 pm
by 777Firebrand777
If you want the chat to be visible to guests but with no mandatory login with a custom nickname:
primehalo wrote:
Open: chat/includes/functions_ajax.php

Find:

Code: Select all

case 'refresh': 
After, add:

Code: Select all

//-- mod: Guest View --------------------------------------------------------//
                if ($user->data['user_id'] == ANONYMOUS && $auth->acl_get('u_chat_view'))
                {
                    $this->user_data = array(
                        'user_id'                => $user->data['user_id'],
                        'user_ip'                => $user->ip,
                    #    'username'                => $username,
                        'session_start'            => time(),
                    #    'session_viewonline'    => $user->data['session_viewonline'],
                        'user_lastjoin'            => time(),
                    #    'user_key'                => $this->user_key,
                    #    'user_online'            => 1,
                    #    'user_status'            => CHAT_STATUS_AVAILABLE,
                        'exclude_time'            => 0,
                    );
                }
//-- end: Guest view --------------------------------------------------------//      
primehalo wrote: Open: styles/prosilver/template/chat/chat_header.html

Find:

Code: Select all

<!-- IF S_CHAT_AUTOCONNECT -->true<!-- ELSE -->false<!-- ENDIF --> 
Replace with:

Code: Select all

<!-- IF S_CHAT_AUTOCONNECT --><!-- IF S_USER_LOGGED_IN -->true<!-- ELSE -->"guest"<!-- ENDIF --><!-- ELSE -->false<!-- ENDIF --> 

You will also have to replace jchat.js. For a strange reason, I cannot use attachments here, so I'll just paste it in here:

Code: Select all

/*
 * @name jchat.js
 * @package cBB Chat
 * @version $Id: jchat.js, v1.0.1 10/09/2014 $
 *
 * @copyright (c) 2014 CaniDev
 * @license http://opensource.org/licenses/gpl-license.php GNU Public License
 */
var jchat = jQuery.noConflict(true);

jchat(function($) {
    function append_conversation_data(e) {
        var t = false;
        $("#ic-data-container .room").each(function() {
            var n = parseInt($(this).attr("id").replace("room-", ""));
            if ($.inArray(n, $.chat.open_rooms) == -1) {
                $.chat.open_rooms.push(n);
                var r = {
                    ROOM_ID: n,
                    TITLE: $(this).attr("title")
                };
                $("#chat-right-panel").append_tpl("userlist", r);
                $("#chat-conversation-container").append_tpl("conversation", r);
                $("#chat-tabs").append_tpl("tab", r);
                if ($(this).is(".js-public-room")) {
                    $(".js-conversation-" + n).addClass("js-public-room");
                    $("#chat-tab-" + n).find(".tab-close").remove()
                }
                $.chat.bind_tabs()
            }
            var i = $.trim($(this).children(".js-conversation").html()),
                s = $.trim($(this).children(".js-userlist").html());
            if (i) {
                var o = $(".js-conversation-" + n);
                o[$.chat.method].apply(o, [i]);
                var u = o.children(".chat-row").length,
                    a = $.chat.options.direction == "up" ? ":last" : ":first";
                while (u > $.chat.options.max_rows) {
                    o.children(".chat-row" + a).remove();
                    u--
                }
                if (e == "refresh" && n != $.chat.current_room) {
                    $("#chat-tab-" + n).addClass("new-msg")
                }
                t = true
            }
            if (s) {
                $(".js-userlist-" + n).html(s);
                $.chat.bind_userlist(n)
            }
        });
        return t
    }

    function inverse_conversations() {
        $("#chat-conversation-container").children(".ic-conversation").each(function() {
            var e = $(this).children(".chat-row");
            if (e.length) {
                $(this).html("");
                for (i = e.length - 1; i > -1; i--) {
                    $(this).append(e[i])
                }
            }
        })
    }

    function rgbtohex(e) {
        function n(e) {
            return ("0" + parseInt(e).toString(16)).slice(-2)
        }
        var t = e.match(/rgb\((\d+),\s*(\d+),\s*(\d+)\)/);
        if (t == null) {
            return e
        }
        return "#" + n(t[1]) + n(t[2]) + n(t[3])
    }

    function getFlashObject(e) {
        if (window.document[e]) {
            return window.document[e]
        }
        if (navigator.appName.indexOf("Microsoft Internet") == -1) {
            if (document.embeds && document.embeds[e]) {
                return document.embeds[e]
            }
        } else {
            return document.getElementById(e)
        }
    }

    function parse_error_code(e) {
        if ($.chat.options.debug && e.responseText) {
            var t = e.responseText.replace(/<br \/?>/g, "\n");
            if ((match = t.match(/<div id\=\"content\">(.*?)<\/div>/)) != null) {
                t = match[1].replace(/[\t]+/g, "\n")
            }
            t = t.replace(/<\/?(.*?)>/g, "");
            alert($.trim(t))
        }
    }
    var msg, xhr, timer = null,
        flood_timer = null,
        in_load = false,
        sound_muted = false,
        background_action = false,
        last_post_time = 0;
    $.browser = {
        ie: navigator.appVersion.indexOf("MSIE") != -1 ? true : false,
        opera: navigator.appName == "Opera" ? true : false
    };
    $.chat = {
        initialized: false,
        active_box: null,
        connected: false,
        current_menu: null,
        current_room: false,
        id: $("#chat-body"),
        method: "append",
        mode: "chat",
        open_rooms: [],
        lang: {
            flood_wait: "Wait..."
        },
        options: {
            autoconnect: false,
            debug: true,
            cookie: {
                name: "chat",
                settings: ""
            },
            direction: "down",
            flood_time: 0,
            guest_room: 1,
            height: 220,
            max_chars: 0,
            max_rows: 25,
            notice_timeout: 2e4,
            page: "",
            player: false,
            position: "bottom",
            refresh: 5e3,
            tip_timeout: 15e3
        },
        positions: {},
        tpl: {
            colour: '<a class="colour" href="#!colour/{COLOUR}"><span style="background: #{COLOUR};"></span></a>',
            conversation: '<div class="ic-conversation js-conversation-{ROOM_ID}"></div>',
            dloading: '<div class="chat-dialog-loading"></div>',
            overlay: '<div class="chat-overlay"></div>',
            sep: '<div class="sep"></div>',
            tab: '<li id="chat-tab-{ROOM_ID}" class="chat-corner-bottom">{TITLE} <a href="#" class="tab-close chat-icon"></a></li>',
            userlist: '<ul class="ic-userlist js-userlist-{ROOM_ID}"></ul>'
        },
        init: function() {
            $.each(["guest_room", "flood_time", "height", "max_chars", "max_rows", "refresh"], function(e, t) {
                $.chat.options[t] = parseInt($.chat.options[t])
            });
            if ($.chat.mode != "chat" || !$.chat.options.guest_room || !$.chat.options.height || !$.chat.options.max_rows) {
                return false
            }
            msg = $.chat.id.find("textarea:first");
            var e = false;
            if ($.chat.options.page == "custom" && $.chat.positions.chat) {
                e = $.chat.positions.chat
            } else if ($.chat.options.page != "custom" && $.chat.options.position) {
                var t = {};
                if ($.chat.positions[$.chat.options.page]) {
                    t = $.chat.positions[$.chat.options.page]
                } else if ($.chat.positions.undefined) {
                    t = $.chat.positions.undefined
                } else {
                    return false
                }
                e = t[$.chat.options.position]
            }
            if (e !== false) {
                if ($(e[0]).length == 0 && $.chat.positions.undefined && $.chat.options.position) {
                    e = $.chat.positions.undefined[$.chat.options.position]
                }
                var n = $(e[0]),
                    r = e[1];
                if (n.length > 1) {
                    n = $(n[0])
                }
                if (n.length == 1) {
                    n[r].apply(n, [$.chat.id])
                }
            }
            $.chat.id.show();
            msg.editable({
                onSubmit: $.chat.submit
            });
            $("#chat-toolbar a, .chat-button").click($.chat.event_dispatch);
            $.chat.id.find(".bbcode-box a, .smiley-box a").click($.chat.event_dispatch);
            $.chat.id.find(".color-box").colorPalette();
            $("#ic-font-select").change(function() {
                $.chat.insert_bbcode("size=" + $(this).val(), true);
                $(this).val("100")
            });
            $("#ic-bbcode-select").change(function() {
                $.chat.insert_bbcode($(this).val(), true);
                $(this).val("")
            });
            if ($.chat.cookie("mute") == 1) {
                $.chat.player("mute", true)
            }
            $("#chat-conversation-container").css("height", $.chat.options.height);
            $("#chat-right-panel").css("height", $.chat.options.height + $("#chat-tabs").height());
            $("#chat-toolbar a").addClass("chat-corner-top chat-corner-bottom");
            $(".ic-box").addClass("chat-corner-top");
            $(".bbcode-box a").addClass("chat-button");
            $.chat.init_messages();
            $.chat.player("init");
            $.chat.status("stop");
//-- mod: Guest View ---------------------------------------------------------//
			if ($.chat.options.autoconnect == "guest") {
				$.chat.connected = true;
				$.chat.refresh();
			} else
//-- end: Guest View ---------------------------------------------------------//
            if ($.chat.options.autoconnect) {
                $.chat.connect(true)
            } else {
                $.chat.disconnect()
            }
        },
        connect: function(e) {
            var t = $.chat.connected ? "disconnect" : "connect";
            background_action = e == true ? true : false;
            $.chat.send(t, false, function() {
                background_action = false;
                if (t == "connect") {
                    $.chat.id.find("#purge-button").removeClass("disabled")
                }
            })
        },
        disconnect: function(e) {
            var t = $("#chat-main-message").clone();
            $.chat.status("stop");
            $.chat.id.find(".chat-icon-signin").removeClass("connected");
            $.chat.id.find("#purge-button").addClass("disabled");
            if (e) {
                t.html(e)
            }
            $("#chat-conversation-container").append(t);
            t.show()
        },
        init_messages: function() {
            function i(e, t, n) {
                var r = e.data("current_text");
                if (typeof r == "undefined") {
                    r = -1
                }
                r++;
                if (!t[r]) {
                    r = 0
                }
                t.display(false);
                $(t[r]).display(true);
                e.data("current_text", r);
                if (t.length > 1 && n) {
                    setTimeout(function() {
                        i(e, t, n)
                    }, n)
                }
            }
            var e = $("#chat-notices"),
                t = $("#chat-tips");
            var n = e.find(".js-message"),
                r = t.find(".js-message");
            if (n.length > 0) {
                e.display(true);
                i(e, n, $.chat.options.notice_timeout)
            }
            if (r.length > 0) {
                t.display(true);
                i(t, r, $.chat.options.tip_timeout)
            }
        },
        refresh: function() {
            var e = $.chat.connected ? "refresh" : "connect";
//-- mod: Guest View --------------------------------------------------------//
            if (!$.chat.connected) {
				$.chat.connected = true;
				e = "refresh";
            }
//-- end: Guest View --------------------------------------------------------//
            $.chat.status("pause");
            $.chat.send(e)
        },
        submit: function() {
            var e = msg.val().replace(/\[\/?[^\]]+\]/g, "");
            if (!$.trim(e) || flood_timer != null) {
                return false
            }
            $.chat.status("pause");
            return $.chat.send("post", {
                last_post_time: last_post_time
            })
        },
        send: function(action, data, on_success) {
            var send_ary = {
                icajx: 1,
                action: action
            };
            if ($.chat.status("loading")) {
                return false
            }
            if ($.inArray(action, ["post", "connect", "disconnect", "refresh", "set_available", "set_away", "set_busy", "set_hidden"]) != -1) {
                send_ary = $.extend(send_ary, $.chat.id.find("form").serializeObject())
            }
            if ($.chat.current_room) {
                send_ary.room = $.chat.current_room
            }
            if (data) {
                send_ary = $.extend(send_ary, data)
            }
            send_ary.rooms = $.chat.open_rooms;
            $.chat.status("load-start");
            xhr = $.ajax({
                url: $.chat.id.find("form").attr("action"),
                data: send_ary,
                dataType: "html",
                type: "POST",
                proccessData: false,
                success: function(data, textStatus, jqXHR) {
                    data = $.trim(data);
                    $.chat.status("load-end");
                    $("#ic-data-container").html(data);
                    var json_str = $.trim($("#ic-json-data").text()),
                        json = {},
                        force_rebind = false,
                        now = new Date;
                    if (json_str.indexOf("{") == 0 && json_str.lastIndexOf("}") == json_str.length - 1) {
                        eval("json=" + json_str + ";")
                    }
                    $("#ic-json-data").remove();
                    data = $("#ic-data-container").html();
                    if (!json.success) {
                        if ($.dialog.opened) {
                            $.dialog.close(true)
                        }
                        if (json.message) {
                            alert(json.message)
                        }
                        parse_error_code(jqXHR);
                        return false
                    }
                    if (json.dialog) {
                        $.dialog.init({
                            onInit: function() {
                                $.dialog.show(data)
                            }
                        });
                        return false
                    }
                    switch (json.action) {
                        case "disable":
                            $.chat.disconnect();
                            window.location.reload();
                            return true;
                            break;
                        case "disconnect":
                            $.chat.disconnect();
                            break;
                        case "exclude":
                            $.chat.disconnect(json.message);
                            return true;
                            break;
                        case "login":
                            $.chat.connected = false;
                            $.dialog.init({
                                onInit: function() {
                                    $.dialog.show(data);
                                    if (!background_action) {
                                        $("#chat-dialog input:first").focus();
                                        $.dialog.find("input[name=username]").keydown(function(e) {
                                            if (e.which == 13 && $(this).val()) {
                                                $.dialog.submit();
                                                e.preventDefault();
                                                e.stopPropagation();
                                                return false
                                            }
                                        })
                                    }
                                },
                                beforeSubmit: function(e) {
                                    if (!e.username) {
                                        $.dialog.find("input[name=username]").addClass("chat-state-error").focus();
                                        return false
                                    }
                                    return true
                                },
                                onSubmit: function(e) {
                                    e.submit = 1;
                                    $.chat.send("connect", e)
                                }
                            });
                            return true;
                            break;
                        case "update":
                            $.chat.id.find("input[name=last_update]").val(json.last_time);
                            $.chat.options.flood_time = json.flood_time;
                            if (json.msg_direction && json.msg_direction != $.chat.options.direction) {
                                $.chat.options.direction = json.msg_direction;
                                $.chat.method = json.msg_direction == "up" ? "prepend" : "append";
                                inverse_conversations();
                                force_rebind = true
                            }
                            break;
                        case "banuser":
                            $.chat.close_room(json.user_key);
                        case "unbanuser":
                            var user_row = $.chat.id.find(".js-user-" + json.user_key);
                            user_row.html($("#ic-data-container").find(".js-userlist li:first").html());
                            $.chat.bind_userlist(false, json.user_key);
                            break;
                        case "close_room":
                            $.chat.close_room(json.room_key);
                            break
                    }
                    switch (action) {
                        case "disconnect":
                            $.chat.disconnect();
                            break;
                        case "post":
                            msg.editable("update", "");
                            if ($.chat.options.flood_time) {
                                msg.val($.chat.lang.flood_wait).prop("disabled", true).addClass("disabled").blur();
                                flood_timer = setTimeout(function() {
                                    msg.val("").prop("disabled", false).removeClass("disabled").focus();
                                    flood_timer = null
                                }, $.chat.options.flood_time)
                            }
                            last_post_time = now.getTime() / 1e3;
                        case "set_available":
                        case "set_away":
                        case "set_busy":
                        case "set_hidden":
                        case "connect":
                            if (!$.chat.connected) {
                                $("#chat-conversation-container").html("")
                            }
                            if (action == "connect" || action == "post") {
                                $.chat.connected = true
                            }
                            if (action == "connect") {
                                $.chat.id.find(".chat-icon-signin").addClass("connected")
                            };
                        case "refresh":
                            if (data && data.substring(0, 1) != "<") {
                                if ($.chat.options.debug) {
                                    try {
                                        throw new Error(data)
                                    } catch (e) {
                                        alert(data)
                                    }
                                }
                                break
                            }
                            if (!$.chat.connected) {
                                break
                            }
                            var newmsg = append_conversation_data(action);
                            $("#ic-data-container").html("");
                            if ($.inArray($.chat.options.guest_room, $.chat.open_rooms) != -1 && !$.chat.current_room) {
                                $.chat.open_room($.chat.options.guest_room)
                            }
                            if (newmsg || force_rebind) {
                                $.chat.bind_rows();
                                if (newmsg && action == "refresh") {
                                    $.chat.player("play", "add")
                                }
                                var cn = $("#chat-conversation-container")[0];
                                cn.scrollTop = $.chat.options.direction == "up" ? 0 : cn.scrollHeight
                            }
                            $.chat.status("resume");
                            $.chat.cookie("lastcheck", parseInt(now.getTime() / 1e3), -1);
                            break;
                        case "quote":
                            msg.editable("update", data, data.length);
                            break
                    }
                    if (typeof on_success === "function") {
                        on_success.apply(false, [data])
                    }
                },
                error: function(e, t, n) {
                    $.chat.status("load-end");
                    parse_error_code(e)
                }
            })
        },
        close_room: function(e) {
            if (e == undefined || e == $.chat.options.guest_room) {
                return false
            }
            if ((pos = $.inArray(e, $.chat.open_rooms)) != -1) {
                $("#chat-tab-" + e + ", .js-conversation-" + e + ", .js-userlist-" + e).remove();
                $.chat.open_rooms.splice(pos, 1);
                var t = $.chat.current_room == e ? $.chat.options.guest_room : $.chat.current_room;
                $.chat.open_room(t, true)
            }
        },
        open_room: function(e, t) {
            var n = $.chat.current_room,
                r = $("#chat-tab-" + e);
            if (e == n && t !== true) {
                return false
            }
            if (n) {
                $(".js-conversation-" + n + ", .js-userlist-" + n).hide();
                $("#chat-tabs li").removeClass("active before-active after-active");
                $("#chat-tabs .tab-close").removeClass("active")
            }
            $.chat.current_room = e;
            $(".js-conversation-" + e + ", .js-userlist-" + e).show();
            r.addClass("active").removeClass("new-msg");
            r.prev("li").addClass("before-active");
            r.next("li").addClass("after-active");
            r.find(".tab-close").addClass("active");
            var i = $(".js-conversation-" + e).is(".js-public-room") ? "removeClass" : "addClass",
                s = $.chat.id.find("#purge-button");
            s[i].call(s, "disabled");
            var o = $("#chat-conversation-container")[0];
            o.scrollTop = $.chat.options.direction == "up" ? 0 : o.scrollHeight;
            if (!background_action) {
                msg.focus()
            }
        },
        insert_bbcode: function(e, t) {
            var n = msg.val(),
                r = msg.caret();
            var i = n.substring(0, r.start),
                s = n.substring(r.end, n.length);
            if (r.text && e.indexOf("list") != -1) {
                var o = r.text.split("\n");
                $.each(o, function(e, t) {
                    o[e] = "[*]" + t
                });
                r.text = o.join("\n")
            }
            n = i + "[" + e + "]" + r.text + (t == true ? "[/" + e.replace(/\=(.*)$/g, "") + "]" : "") + s;
            r.start = i.length + e.length + 2;
            r.end = r.start + r.text.length;
            msg.editable("update", n, [r.start, r.end])
        },
        close_box: function() {
            if ($.chat.active_box) {
                $.chat.active_box.removeClass("chat-corner-bl chat-corner-br").hide().find(".sep").remove();
                $("#chat-toolbar a.active").addClass("chat-corner-top").removeClass("active");
                $.chat.active_box = null
            }
        },
        bind_tabs: function() {
            $("#chat-tabs").find("li, .tab-close").unbind();
            $("#chat-tabs li").click(function(e) {
                var t = parseInt($(this).attr("id").replace("chat-tab-", ""));
                $.chat.open_room(t);
                e.preventDefault()
            });
            $("#chat-tabs li .tab-close").click(function(e) {
                var t = $(this).parent(),
                    n = parseInt(t.attr("id").replace("chat-tab-", ""));
                $.chat.send("close_room", {
                    rk: n
                }, function() {
                    $.chat.close_room(n)
                });
                e.preventDefault()
            })
        },
        bind_rows: function() {
            $(".chat-row").hover(function() {
                $(this).find(".ic-row-actions").show()
            }, function() {
                var e = $(this).find(".ic-row-actions");
                if ($.chat.mode == "archive") {
                    e.each(function() {
                        if ($(this).find(".row-id-list:checked").length > 0) {
                            return true
                        }
                        $(this).hide()
                    })
                } else {
                    e.hide()
                }
            }).find(".ic-row-actions a, .chat-quickmention").unbind("click").click($.chat.event_dispatch);
            if ($.chat.mode == "archive") {
                $(".row-id-list").change(function() {
                    var e = $(".row-id-list:checked").length > 0 ? true : false;
                    $(".js-delete-selected").display(e)
                })
            }
        },
        bind_userlist: function(e, t) {
            var n = t ? ".js-user-" + t : e ? ".js-userlist-" + e : ".ic-userlist",
                r = t ? $(n) : $(n).children("li");
            $(n).find("a").unbind("click").click($.chat.event_dispatch);
            r.children("a").bind("contextmenu", $.chat.event_dispatch)
        },
        event_dispatch: function(e) {
            var t = $(this).getdata("#!", "/"),
                n = t[1] ? t[1] : "";
            if ($(this).is(".disabled")) {
                e.preventDefault();
                return false
            }
            switch (n) {
                case "connect":
                case "refresh":
                    $.chat.close_box();
                case "submit":
                    $.chat[n].apply($);
                    break;
                case "clear":
                    $.dialog.init({
                        onInit: function() {
                            $.chat.send("clear", false, function(e) {
                                $.dialog.show(e)
                            })
                        },
                        onSubmit: function(e) {
                            e.submit = 1;
                            $.chat.send("clear", e, function(e) {
                                $(".js-conversation-" + $.chat.current_room).html("")
                            })
                        }
                    });
                    break;
                case "showbox":
                    var r = $(this),
                        i = $("#chat-content"),
                        s = i.offset(),
                        o = parseInt(i.css("border-left-width")),
                        u = r.offset(),
                        a = $("." + t[2] + "-box").parent();
                    u.top -= s.top;
                    u.left -= s.left + (o ? o : 0);
                    if (r.is(".active")) {
                        $.chat.close_box();
                        break
                    }
                    $.chat.close_box();
                    var f = i.width(),
                        l = a.width(),
                        c = $($.chat._getTpl("sep")),
                        h = false;
                    var p = {
                        bottom: -1,
                        width: r.width(),
                        height: 1,
                        background: a.css("background-color")
                    };
                    if (l + u.left > f) {
                        if (u.left > f / 2) {
                            h = true;
                            l = Math.min(l, u.left);
                            p.right = 0
                        } else {
                            l = f - u.left
                        }
                        a.css("width", l)
                    }
                    if (!h) {
                        p.left = 0
                    }
                    var d = {
                        top: u.top - parseInt(a.outerHeight()) + 2,
                        left: u.left - (h ? a.innerWidth() - r.width() : 0),
                        width: l
                    };
                    a.append(c);
                    c.css(p);
                    a.css(d).addClass(h ? "chat-corner-bl" : "chat-corner-br").show();
                    r.removeClass("chat-corner-top").addClass("active");
                    $.chat.active_box = a;
                    if (!t[3] || t[3] != "nofocus") {
                        msg.focus()
                    }
                    break;
                case "bbcode":
                    $.chat.insert_bbcode(t[2], t[2] == "*" ? false : true);
                    break;
                case "clear-bbcode":
                    var v = msg[0].value,
                        m = msg.caret(),
                        g = /\[\/?[^\]]+\]/g;
                    if (m.start != m.end) {
                        m.text = m.text.replace(g, "");
                        v = m.replace(m.text);
                        m.start += m.text.length
                    } else {
                        v = $.trim(v.replace(g, ""));
                        m.start = v.length
                    }
                    msg.editable("update", v, m.start);
                    break;
                case "clear-input":
                    msg.editable("update", "");
                    break;
                case "colour":
                    $.chat.insert_bbcode("color=#" + t[2], true);
                    break;
                case "rules":
                    $.dialog.init({
                        onInit: function() {
                            $.chat.send("rules", false, function(e) {
                                $.dialog.show(e)
                            })
                        }
                    });
                    break;
                case "smiley":
                    var v = msg.val(),
                        y = msg.caret();
                    v = v.substring(0, y.start) + " " + t[2] + " " + v.substring(y.end, v.length);
                    msg.editable("update", v, v.length);
                    break;
                case "sound":
                    $.chat.close_box();
                    $.chat.player("mute");
                    break;
                case "edit":
                    $.dialog.init({
                        onInit: function() {
                            $.chat.send("edit", {
                                id: t[2]
                            }, function(e) {
                                $.dialog.show(e);
                                var t = $.dialog.find("textarea"),
                                    n = t.val().length;
                                t.editable().focus().caret(n, n)
                            })
                        },
                        onSubmit: function(e) {
                            e = $.extend(e, {
                                id: t[2],
                                submit: 1
                            });
                            $.chat.send("edit", e, function(e) {
                                if (e) {
                                    $("#chat-row-" + t[2]).find(".ic-row-text").html(e)
                                }
                            })
                        }
                    });
                    break;
                case "delete":
                    $.chat.send("delete", {
                        id: t[2]
                    }, function() {
                        $.chat.player("play", "delete");
                        $("#chat-row-" + t[2]).fadeOut()
                    });
                    break;
                case "quote":
                    $.chat.send(n, {
                        id: t[2]
                    });
                    break;
                case "whois":
                    $.dialog.init({
                        onInit: function() {
                            $.chat.send("whois", {
                                id: t[2]
                            }, function(e) {
                                $.dialog.show(e)
                            })
                        }
                    });
                    break;
                case "user":
                    switch (e.type) {
                        case "click":
                            if (t[0]) {
                                window.open(t[0])
                            }
                            break;
                        case "contextmenu":
                            $.chat.contextmenu.apply(this, ["show", e]);
                            break
                    }
                    break;
                case "banuser":
                    $.dialog.init({
                        onInit: function() {
                            $.chat.send("banuser", {
                                uk: t[2]
                            }, function(e) {
                                $.dialog.show(e);
                                $("#ban-period").change(function() {
                                    var e = $(this).val() == "0" ? true : false;
                                    $.dialog.find("dl:has(#ban-date)").display(e);
                                    $.dialog.center();
                                    if (!e) {
                                        $.dialog.find("#ban-date").val("").removeClass("chat-state-error")
                                    }
                                })
                            })
                        },
                        beforeSubmit: function(e) {
                            if (e.period == "0" && e.date.match(/\d{2}\/\d{2}\/\d{4} \d{2}\:\d{2}\:\d{2}/) == null) {
                                $.dialog.find("#ban-date").addClass("chat-state-error").focus();
                                return false
                            }
                            return true
                        },
                        onSubmit: function(e) {
                            e = $.extend(e, {
                                uk: t[2],
                                submit: 1
                            });
                            $.chat.send("banuser", e)
                        }
                    });
                    break;
                case "quickmention":
                    var b = $(this).next(".ic-row-username:first"),
                        w = b.children("a");
                case "mentionuser":
                    if (n == "mentionuser") {
                        var b = $($.chat.current_menu.context),
                            w = b.children("span")
                    }
                    var v = msg.val(),
                        y = msg.caret();
                    var E = v.substring(0, y.start),
                        S = v.substring(y.start, v.length);
                    if (w.length > 0) {
                        v = "[color=" + rgbtohex(w.css("color")) + "][b]@" + w.text() + "[/b][/color]"
                    } else {
                        v = "[b]@" + b.text() + "[/b]"
                    }
                    if (E && E.substring(E.length - 1, E.length) != " ") {
                        v = " " + v
                    }
                    if (S.substring(0, 1) != " ") {
                        v += " "
                    }
                    msg.editable("update", E + v + S, E.length + v.length);
                    break;
                case "pmuser":
                    var x = parseInt(t[2]);
                    if ($.inArray(x, $.chat.open_rooms) == -1) {
                        $.chat.send("pmuser", {
                            uk: x
                        }, function() {
                            append_conversation_data("pmuser");
                            $.chat.open_room(x)
                        })
                    } else {
                        $.chat.open_room(x)
                    }
                    break;
                case "unbanuser":
                case "set_available":
                case "set_away":
                case "set_busy":
                case "set_hidden":
                    $.chat.send(n, {
                        uk: t[2]
                    });
                    break;
                default:
                    if (t[0]) {
                        window.open(t[0])
                    }
                    break
            }
            e.preventDefault()
        },
        player: function(e, t) {
            if ($.chat.options.player == false) {
                return false
            }
            switch (e) {
                case "init":
                    if (!$.browser.ie || t) {
                        $.chat.id.appendFlash({
                            id: "chatplayer",
                            url: $.chat.options.player.url + (t ? "&autoplay=" + t : ""),
                            width: 0,
                            height: 0,
                            params: {
                                play: "false",
                                allowScriptAccess: "always"
                            },
                            flashvars: $.chat.options.player.flashvars
                        })
                    }
                    break;
                case "mute":
                    if (!sound_muted || t === true) {
                        sound_muted = true;
                        $(".chat-icon-sound").addClass("sound-muted");
                        $.chat.cookie("mute", 1, 180)
                    } else if (sound_muted || t === false) {
                        sound_muted = false;
                        $(".chat-icon-sound").removeClass("sound-muted");
                        $.chat.cookie("mute", "")
                    }
                    break;
                case "play":
                    if (!sound_muted) {
                        var n = getFlashObject("chatplayer");
                        if (n && typeof n.control == "function") {
                            n.control("play", t)
                        } else {
                            $("#chatplayer").remove();
                            $.chat.player("init", t)
                        }
                    }
                    break
            }
        },
        contextmenu: function(e, t) {
            switch (e) {
                case "show":
                    $.chat.contextmenu("hide");
                    $.chat.current_menu = $(this).next(".chat-contextmenu");
                    if ($.chat.current_menu.length != 1) {
                        $.chat.current_menu = null;
                        break
                    }
                    var n = $("#chat-content").offset();
                    var r = {
                        width: $.chat.current_menu.outerWidth(),
                        height: $.chat.current_menu.outerHeight(),
                        left: t.pageX - n.left,
                        top: t.pageY - n.top + 5
                    };
                    if (r.left + r.width > $.chat.id.width()) {
                        r.left -= r.width
                    }
                    if (r.top + r.height > $.chat.id.height()) {
                        r.top -= r.height
                    }
                    $.chat.current_menu.css({
                        top: r.top,
                        left: r.left
                    }).show();
                    $("body").bind("click.chat", function() {
                        $.chat.contextmenu("hide");
                        $("body").unbind("click.chat")
                    });
                    $(window).bind("resize.chat", function() {
                        $.chat.contextmenu("hide");
                        $(window).unbind("resize.chat")
                    });
                    $.chat.status("pause");
                    break;
                case "hide":
                    if ($.chat.current_menu) {
                        $.chat.current_menu.hide();
                        $.chat.current_menu = null;
                        $.chat.status("resume")
                    }
                    break
            }
        },
        status: function(e) {
            switch (e) {
                case "load-start":
                    in_load = true;
                    if (!$.dialog.opened) {
                        $(".ic-loading").show()
                    }
                    break;
                case "load-end":
                    in_load = false;
                    $(".ic-loading").hide();
                    break;
                case "loading":
                    return in_load;
                    break;
                case "stop":
                    $("#chat-conversation-container, #chat-right-panel, #chat-tabs").html("");
                    $.chat.open_rooms = [];
                    $.chat.current_room = false;
                    $.chat.connected = false;
                    $.chat.id.find("input[name=last_update]").val(0);
                case "pause":
                    clearTimeout(timer);
                    timer = null;
                    if (xhr && xhr.readystate != 4) {
                        xhr.abort()
                    }
                    $.chat.status("load-end");
                    break;
                case "resume":
                    if ($.chat.connected && timer == null) {
                        timer = setTimeout($.chat.refresh, $.chat.options.refresh)
                    }
                    break
            }
        },
        cookie: function(e, t, n) {
            if (e[0] != "_") {
                e = "_" + e
            }
            var r = $.chat.options.cookie.name + e + "=";
            if (t == undefined) {
                var s = document.cookie.split(";");
                for (i = 0; i < s.length; i++) {
                    var o = $.trim(s[i]);
                    if (o.indexOf(r) == 0) {
                        var u = o.substring(r.length, o.length);
                        if ($.isNumeric(u)) {
                            return parseInt(u)
                        }
                        return u
                    }
                }
                return false
            } else {
                if (n != -1) {
                    var a = n ? n : 90,
                        f = new Date;
                    f.setTime(f.getTime() + a * 24 * 60 * 60 * 1e3)
                }
                var l = "; expires=" + (t === "" || n == -1 ? -1 : f.toGMTString());
                document.cookie = r + ($.isArray(t) ? t.join(":") : t) + l + $.chat.options.cookie.settings
            }
        },
        _getTpl: function(e, t) {
            var n = $.chat.tpl[e];
            if (n && typeof t === "object") {
                $.each(t, function(e, t) {
                    var r = "{" + e + "}";
                    while (n.indexOf(r) != -1) {
                        n = n.replace(r, t)
                    }
                })
            }
            return n ? n : ""
        }
    };
    $.fn.getdata = function(e, t) {
        var n = $(this).attr("href"),
            r = [];
        if (e == undefined || !n) {
            return r
        }
        n = n.replace("%21", "!");
        if (n.indexOf(e) != -1) {
            r = n.split(e);
            if (t && r[1].indexOf(t) != -1) {
                var s = r[1].split(t);
                for (i = 0; i < s.length; i++) {
                    r[i + 1] = s[i]
                }
            }
        } else {
            r.push(n)
        }
        return r
    };
    $.fn.colorPalette = function() {
        var e = 0,
            t = 0,
            n = 0;
        var r = ["00", "40", "80", "BF", "FF"];
        var i = "",
            s = "";
        for (e = 0; e < 5; e++) {
            for (t = 0; t < 5; t++) {
                for (n = 0; n < 5; n++) {
                    i = String(r[e]) + String(r[t]) + String(r[n]);
                    s += $.chat._getTpl("colour", {
                        COLOUR: i
                    })
                }
            }
        }
        $(this).html(s).find(".colour").click($.chat.event_dispatch)
    };
    $.fn.append_tpl = function(e, t) {
        $(this).append($.chat._getTpl(e, t))
    }
});

jchat(function(e) {
    e.fn.chat = function(t) {
        if (e.chat.initialized) {
            return this
        }
        e.chat.id = e(this);
        e.chat.initialized = true;
        if (typeof t === "object") {
            e.chat.lang = e.extend(e.chat.lang, t.lang);
            e.chat.options = e.extend(e.chat.options, t.options);
            if (t.mode) {
                e.chat.mode = t.mode
            }
            if (typeof jchat_style_options != "undefined") {
                e.chat = e.extend(e.chat, jchat_style_options)
            }
        }
        switch (e.chat.mode) {
            case "archive":
                e(document).ready(function() {
                    e.chat.bind_rows();
                    e.chat.init()
                });
                break;
            case "chat":
                if (e.chat.options.direction == "up") {
                    e.chat.method = "prepend"
                }
                e(document).ready(e.chat.init);
                break
        }
    };
    e.fn.display = function(t) {
        var n = t ? "removeClass" : "addClass",
            r = e(this);
        r[n].apply(r, ["chat-state-hidden"])
    };
    e.fn.appendFlash = function(t) {
        function i(t, n, r) {
            var i = [];
            e.each(t, function(e, t) {
                if (t !== "") {
                    if (r === true) {
                        i.push(e + "=" + encodeURIComponent(t))
                    } else {
                        i.push(e + '="' + t + '"')
                    }
                }
            });
            return i.join(n)
        }
        var n = {
            id: "flash",
            url: "",
            autoadjust: false,
            width: "100%",
            height: "100%",
            overwrite: false,
            params: {
                allowScriptAccess: "sameDomain",
                wmode: "window"
            },
            flashvars: {},
            style: {}
        };
        var r = e(this);
        t = e.extend(n, t);
        if (!t.url) {
            return this
        }
        e(document).ready(function() {
            var n = "",
                s = "";
            t.params.movie = t.url;
            s = i(t.flashvars, "&", true);
            if (s) {
                t.params.flashvars = s
            }
            e.each(t.params, function(e, t) {
                n += '<param name="' + e + '" value="' + t + '" />'
            });
            if (t.autoadjust !== false) {
                var o = r.width();
                if (typeof t.autoadjust === "number") {
                    o = o - Math.round(t.autoadjust * o / 100)
                }
                t.width = o;
                t.height = o
            }
            var u = {
                id: t.id,
                classid: "clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",
                codebase: "http://active.macromedia.com/flash2/cabs/swflash.cab#version=6,0,0,0",
                height: t.height,
                width: t.width
            };
            var a = {
                flashvars: s ? s : "",
                height: t.height,
                name: t.id,
                play: t.params.play ? t.params.play : "",
                pluginspage: "http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash",
                src: t.url,
                swliveconnect: "true",
                type: "application/x-shockwave-flash",
                width: t.width
            };
            var f = e("<object " + i(u, " ") + " >" + n + "<embed " + i(a, " ") + " /></object>");
            f.css(t.style);
            if (t.overwrite) {
                r.html(f)
            } else {
                r.append(f)
            }
        });
        return this
    }
});

jchat(function(e) {
    e.fn.caret = function(t, n) {
        var r = false,
            i = false,
            s = e(this)[0],
            o = e.browser.ie;
        if (typeof t === "object") {
            r = t.start;
            i = t.end
        } else if (t != undefined) {
            r = t;
            i = n != undefined ? n : t
        }
        if (r !== false) {
            if (o) {
                var u = s.createTextRange();
                u.collapse(true);
                u.moveStart("character", r);
                u.moveEnd("character", i - r);
                u.select()
            } else {
                s.selectionStart = r;
                s.selectionEnd = i
            }
            s.focus()
        } else {
            if (o) {
                var a = document.selection;
                if (s.tagName.toLowerCase() != "textarea") {
                    var f = this.val();
                    var l = a.createRange().duplicate();
                    l.moveEnd("character", f.length);
                    var c = l.text == "" ? f.length : f.lastIndexOf(l.text);
                    l = a.createRange().duplicate();
                    l.moveStart("character", -f.length);
                    var h = l.text.length
                } else {
                    var l = a.createRange();
                    var p = l.duplicate();
                    p.moveToElementText(s);
                    p.setEndPoint("EndToEnd", l);
                    var c = p.text.length - l.text.length;
                    var h = c + l.text.length
                }
            } else {
                var c = s.selectionStart;
                var h = s.selectionEnd
            }
            return {
                start: c,
                end: h,
                text: s.value.substring(c, h),
                replace: function(e) {
                    return s.value.substring(0, c) + e + s.value.substring(h, s.value.length)
                }
            }
        }
        return this
    }
});

jchat(function(e) {
    var t = {
        dom: null,
        eyefix: 15,
        overlay: null,
        parent: e("#chat-content"),
        mode: "inherit",
        width: "auto"
    };
    e.dialog = {
        opened: false,
        options: {},
        center: function(t) {
            var n = e.dialog.options.dom,
                r = e.dialog.options.overlay;
            var i, s, o, u;
            switch (e.dialog.options.mode) {
                case "archive":
                    i = e(window).width();
                    s = e(window).height();
                    o = i / 2 + e(document).scrollLeft();
                    u = s / 2 + e(document).scrollTop();
                    break;
                default:
                    i = r.width();
                    s = r.height();
                    o = i / 2;
                    u = s / 2;
                    break
            }
            if (e.dialog.options.width != "auto") {
                n.css("width", e.dialog.options.width)
            }
            i = Math.min(i - 10, n.outerWidth());
            d_left = o - i / 2 - 2;
            d_top = u - n.height() / 2 - e.dialog.options.eyefix;
            var a = {
                left: d_left,
                top: d_top,
                width: i - parseInt(n.css("padding-left")) - parseInt(n.css("padding-right")) - parseInt(n.css("border-width")) * 2
            };
            n.css(a);
            if (t != undefined && t.type == "resize") {
                r.css({
                    height: e.dialog.options.mode == "custom" ? e(document).outerHeight() : e.dialog.options.parent.outerHeight(),
                    width: e.dialog.options.mode == "custom" ? e(document).outerWidth() : e.dialog.options.parent.outerWidth()
                })
            }
        },
        close: function(t, n, r) {
            if (e.dialog.options.dom) {
                e.dialog.options.dom.fadeOut("fast", function() {
                    e(this).remove();
                    e.dialog.options.dom = null;
                    e.dialog.close(true, n, r)
                })
            }
            if (t) {
                e.dialog.opened = false;
                e.dialog.options.overlay.fadeOut("fast", function() {
                    e(this).remove();
                    e(window).unbind("resize.chat");
                    e(document).unbind("scroll.chat");
                    if (n != undefined && e.dialog.options.onSubmit) {
                        e.dialog.options.onSubmit(n, r)
                    }
                    if (e.dialog.options.onClose) {
                        e.dialog.options.onClose()
                    }
                    if (e.dialog.options.onDestroy) {
                        e.dialog.options.onDestroy()
                    } else {
                        e.dialog.reset();
                        e.chat.status("resume")
                    }
                })
            }
        },
        init: function(t) {
            var n, r;
            e.dialog.reset();
            e.dialog.options = e.extend(e.dialog.options, t);
            e.dialog.options.mode = e.dialog.options.mode == "custom" ? "custom" : e.chat.mode;
            switch (e.dialog.options.mode) {
                case "archive":
                    e.dialog.options.parent = e("body");
                    break;
                case "custom":
                    e.dialog.options.parent = e("body");
                    n = e(document).outerHeight();
                    r = e(document).outerWidth();
                    break;
                default:
                    e.chat.status("pause");
                    e.chat.close_box();
                    break
            }
            e.dialog.options.overlay = e(e.chat._getTpl("overlay"));
            e.dialog.options.parent.append(e.dialog.options.overlay);
            e.dialog.opened = true;
            e.dialog.options.overlay.css({
                height: n ? n : e.dialog.options.parent.outerHeight(),
                opacity: .6,
                width: r ? r : e.dialog.options.parent.outerWidth()
            }).fadeIn("fast", function() {
                e.dialog.show(e.chat._getTpl("dloading"));
                if (e.dialog.options.onInit) {
                    e.dialog.options.onInit()
                }
            }).click(function() {
                e.dialog.close()
            })
        },
        find: function(t) {
            if (e.dialog.options.dom) {
                return e.dialog.options.dom.find(t)
            }
            return e([])
        },
        reset: function() {
            e.dialog.options = e.extend({}, t)
        },
        submit: function(t) {
            var n = e.dialog.find("form"),
                r = n.serializeObject();
            if (n.attr("action")) {
                r.form_action = n.attr("action")
            }
            if (e.dialog.options.beforeSubmit) {
                if (!e.dialog.options.beforeSubmit(r)) {
                    return false
                }
            }
            e.dialog.close(false, r, t)
        },
        show: function(t) {
            if (!t) {
                return false
            }
            e("#ic-data-container").html("");
            if (e.dialog.options.dom) {
                e.dialog.options.dom.remove()
            }
            e.dialog.options.dom = e(t);
            var n = e.dialog.options.dom,
                r = e.dialog.options.overlay;
            if (n.length != 1) {
                n = null;
                if (e.chat.options.debug) {
                    alert(t)
                }
                e.dialog.close(true);
                return false
            }
            r.parent().append(n);
            e.dialog.center();
            n.show().find(".chat-button").click(function(t) {
                var n = e(this).getdata("#!");
                switch (n[1]) {
                    case "submit":
                        e.dialog.submit(e(this));
                        break;
                    case "close":
                        e.dialog.close();
                        break
                }
                t.preventDefault()
            });
            e(window).bind("resize.chat", e.dialog.center);
            if (e.dialog.options.mode == "archive" || e.dialog.options.mode == "custom") {
                e(document).bind("scroll.chat", e.dialog.center)
            }
        }
    }
});

jchat(function(e) {
    e.fn.editable = function(t) {
        var n = {
            init: function(t) {
                if (!e(this).is("textarea")) {
                    return false
                }
                e(this).data("editable", t ? t : {});
                e(this).keydown(function(t) {
                    if (t.which == 13) {
                        if (t.ctrlKey == true) {
                            var r = e(this).caret();
                            n.update.apply(this, [r.replace("\n"), r.start + 1])
                        } else {
                            var i = e(this).data("editable");
                            if (i.onSubmit) {
                                i.onSubmit.apply(this)
                            }
                        }
                        t.preventDefault();
                        t.stopPropagation();
                        return false
                    }
                });
                if (e.chat.options.max_chars) {
                    e(this).siblings(".ic-chars-info").show();
                    e(this).bind("input", function() {
                        n.update.apply(this)
                    });
                    n.update.apply(this)
                }
            },
            update: function(t, n) {
                var r = e(this).val(),
                    i = 0;
                if (t != undefined) {
                    if (e.chat.options.max_chars && t.length > e.chat.options.max_chars) {
                        return false
                    }
                    r = t
                }
                if (e.chat.options.max_chars && r.length >= e.chat.options.max_chars) {
                    r = r.substring(0, e.chat.options.max_chars)
                }
                if (r != e(this).val()) {
                    e(this).val(r);
                    e(this)[0].scrollTop = e(this)[0].scrollHeight
                }
                if (n != undefined) {
                    if (typeof n !== "object") {
                        n = [n]
                    }
                    e(this).caret.apply(this, n)
                }
                i = e.chat.options.max_chars - r.length;
                e(this).siblings(".ic-chars-info").children("span").text(i);
                if (t != undefined) {
                    e(this).focus()
                }
            }
        };
        if (typeof t === "object" || !t) {
            n.init.apply(this, [t])
        } else if (n[t]) {
            n[t].apply(this, Array.prototype.slice.call(arguments, 1))
        }
        return this
    }
});

jchat(function(e) {
    e.fn.serializeObject = function(t) {
        var n = e(this).serializeArray(),
            r = {};
        e.each(n, function(n, i) {
            var s = i.name.match(/(.*?)\[(\d+)?\]/);
            if (s != null) {
                i.name = s[1];
                i.id = s[2] ? parseInt(s[2]) : 0
            }
            if (typeof t === "object" && e.inArray(i.name, t) != -1) {
                return true
            }
            if (s != null) {
                if (!r[i.name]) {
                    r[i.name] = []
                }
                if (i.id) {
                    r[i.name][i.id] = i.value
                } else {
                    r[i.name].push(i.value)
                }
            } else {
                r[i.name] = i.value
            }
        });
        return r
    }
});
Thanks primehalo for the hotfix!

Re: [RC] cBB Chat 1.0.1

Posted: Thu Mar 12, 2015 3:54 pm
by 777Firebrand777
Do you want your users to be continously logged in, with no logouts without breaking the automatic "Away from keyboard" feature? You can apply this hotfix:
primehalo wrote: Alright, try this:

Open: chat/includes/functions_ajax.php

Find:

Code: Select all

                if($chat->time_limit !== false && ($action == 'connect' || $action == 'refresh'))
                { 
After, add:

Code: Select all

//-- mod: Keep User Active if they have a chat window open  -----------------//
                    $lastjoin = 0;
                    if (empty($config['chat_auto_away']))
                    {
                        $lastjoin = time();
                    }
                    else if (($chat_auto_away = time() - (intval($config['chat_auto_away']) * 60)) > $this->user_data['user_lastjoin'])
                    {
                        $lastjoin = $chat_auto_away - 1;    // When "Away", keep user_lastjoin less than $chat_auto_away
                    }
                    if ($lastjoin)
                    {
                        $sql = 'UPDATE ' . CHAT_USERS_TABLE . '
                            SET user_lastjoin = ' . $lastjoin . '
                            WHERE user_key = ' . (int)$this->user_key;
                        $result = $db->sql_query($sql);
                    }
//-- end: Keep User Active if they have a chat window open  -----------------//        

Thanks for Primehalo for this fix.

Re: [RC] cBB Chat 1.0.1

Posted: Thu Mar 12, 2015 7:49 pm
by Dead Man
I am enabling so Guest can view it but for some reason they cannot see it. What is weird is that I first tested it on one Site and Guest can see it there but on the Official One I did the same thing but for some reason they cannot see it any clues?

Re: [RC] cBB Chat 1.0.1

Posted: Fri Mar 13, 2015 11:55 am
by Dead Man
Fixed the Chat Guest Problem. Seems like the Member Anonymous was removed from the guest group.


Also is there a way to stop the chat box from auto scrolling to the top every time a new message is made. Sometimes one is trying to scroll down to read messages and all of a sudden the chat jumps up to the new post.

Re: [RC] cBB Chat 1.0.1

Posted: Sun Mar 22, 2015 7:28 pm
by NLGE
Hello,

I am a bit new to this, so this is probably not a very smart question.

I have been trying to edit the chat.css to change the box color, but it only changes every other box. Since for some reason that I can't figure out the text automatically shows up white, I have been trying to use a darker color to offset this. Is there any way I can change the background color of both boxes, instead of every other one?

Thanks!

Re: [RC] cBB Chat 1.0.1

Posted: Thu Mar 26, 2015 1:18 pm
by Dead Man
NLGE wrote:Hello,

I am a bit new to this, so this is probably not a very smart question.

I have been trying to edit the chat.css to change the box color, but it only changes every other box. Since for some reason that I can't figure out the text automatically shows up white, I have been trying to use a darker color to offset this. Is there any way I can change the background color of both boxes, instead of every other one?

Thanks!
Do not worry about it being smart. The Main thread does not give details on that. Many others have also had same issue including me.

Here is what you do. Mine is SubSilver2 Theme
REMEMBER AFTER YOU REUPLOAD the EDITED FILES. CLEAR YOUR SITE CACHE IN ACP

For ODD ROWS go to \root\styles\subsilver2\theme\chat.css
Find this code and change the Number Code to which ever color you want.

Code: Select all

#chat-right-panel, #chat-conversation-container,
#chat-tabs li.active, #chat-toolbar li.active, .ic-box  {
	background: #060606;
}
For EVEN ROWS go to \root\chat\assets\css\common.css
Find this code and change the Number Code to which ever color you want.

Code: Select all

.chat-row:nth-child(even) {
	background-color: #000000;
}

Re: [RC] cBB Chat 1.0.1

Posted: Thu Mar 26, 2015 11:18 pm
by NLGE
Dead Man wrote:
NLGE wrote:Hello,

I am a bit new to this, so this is probably not a very smart question.

I have been trying to edit the chat.css to change the box color, but it only changes every other box. Since for some reason that I can't figure out the text automatically shows up white, I have been trying to use a darker color to offset this. Is there any way I can change the background color of both boxes, instead of every other one?

Thanks!
Do not worry about it being smart. The Main thread does not give details on that. Many others have also had same issue including me.

Here is what you do. Mine is SubSilver2 Theme
REMEMBER AFTER YOU REUPLOAD the EDITED FILES. CLEAR YOUR SITE CACHE IN ACP

For ODD ROWS go to \root\styles\subsilver2\theme\chat.css
Find this code and change the Number Code to which ever color you want.

Code: Select all

#chat-right-panel, #chat-conversation-container,
#chat-tabs li.active, #chat-toolbar li.active, .ic-box  {
	background: #060606;
}
For EVEN ROWS go to \root\chat\assets\css\common.css
Find this code and change the Number Code to which ever color you want.

Code: Select all

.chat-row:nth-child(even) {
	background-color: #000000;
}

Thanks so much! This worked perfectly.

Re: [RC] cBB Chat 1.0.1

Posted: Mon Apr 20, 2015 8:15 pm
by Midway
Hi

I have a blank page when i install this mod

Re: [RC] cBB Chat 1.0.1

Posted: Tue Apr 21, 2015 10:06 am
by Midway
Sorry now it's ok

Re: [RC] cBB Chat 1.0.1

Posted: Wed Apr 29, 2015 7:49 am
by WroxVash
Hello!

Can i make accentuated letter?Because if i wanna write now i get this : ö ü ó ő ú ű á é
I need this latters: é á ü ú ű ö ő ó

ty!