The forum of the forums

Would you like to react to this message? Create an account in a few clicks or log in to continue.
The forum of the forums
3 posters

    How can I make users auto-login in new chatbox?

    Van-Helsing
    Van-Helsing
    Hyperactive


    Male Posts : 2431
    Reputation : 116
    Language : English, Greek

    Solved How can I make users auto-login in new chatbox?

    Post by Van-Helsing February 11th 2015, 2:31 pm

    Hi all,
    How can I make users auto-login in new chatbox?


    Last edited by Black-Shadow on February 11th 2015, 10:16 pm; edited 1 time in total
    Wagner'
    Wagner'
    Forumember


    Male Posts : 48
    Reputation : 6
    Language : Portuguese
    Location : Brazil

    Solved Re: How can I make users auto-login in new chatbox?

    Post by Wagner' February 11th 2015, 6:03 pm

    Simples as 1, 2, 3...  :wouhou:

    Code:
    $(function() {

        var chatbox_window = document.getElementById('frame_chatbox');
        var iframewindow = chatbox_window.contentWindow ? chatbox_window.contentWindow : chatbox_window.contentDocument.defaultView;
        var chat = iframewindow.chatbox;

        function check_logged()
        {
            if( !chat.connected ) {
                chat.connect();
            }
        }
        check_logged();

        setInterval(function() {
            check_logged();
        }, 30000);

    });

    Check this part of the code

    Code:
        setInterval(function() {
            check_logged();
        }, 30000 );

    This will check if the user is logged every 30 seconds, you can change this to whatever you like.

    If you want this "check" just one time, you can remove this part too. So the code will check if the user is logged every time he reload the page. (this is better!!)

    Best regards. king
    Van-Helsing
    Van-Helsing
    Hyperactive


    Male Posts : 2431
    Reputation : 116
    Language : English, Greek

    Solved Re: How can I make users auto-login in new chatbox?

    Post by Van-Helsing February 11th 2015, 10:15 pm

    Hello @Wagner'
    Thank you very much it solved as it seems.
    SLGray
    SLGray
    Administrator
    Administrator


    Male Posts : 51498
    Reputation : 3523
    Language : English
    Location : United States

    Solved Re: How can I make users auto-login in new chatbox?

    Post by SLGray February 12th 2015, 12:02 am

    Topic solved and archived



    How can I make users auto-login in new chatbox? Slgray10

    When your topic has been solved, ensure you mark the topic solved.
    Never post your email in public.

      Current date/time is September 22nd 2024, 2:18 pm