The forum of the forums
Welcome to the Official Support Forum of Forumotion!

To take full advantage of everything offered by our forum, please log in if you are already a member, or join our community if you've not yet.



Create a free forum like this one.

Problem with chatbox auto-login javascript

View previous topic View next topic Go down

Solved Problem with chatbox auto-login javascript

Post by Van-Helsing on February 24th 2015, 3:01 pm

Hello,
I am using the following javascript for chatbox members auto-login but it conflicts other javascripts is there a way to fix it?

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();
    }, 3000);

});


Last edited by Black-Shadow on February 24th 2015, 3:39 pm; edited 1 time in total

Van-Helsing
Hyperactive

Male Posts : 2197
Reputation : 82
Language : English, Greek

http://helpgr.forumgreek.com/

Back to top Go down

Solved Re: Problem with chatbox auto-login javascript

Post by Ange Tuteur on February 24th 2015, 3:18 pm

Hi @Black-shadow,

Try this instead :
Code:
$(window).load(function() {
  var chatbox_script = function() {
    setTimeout(function(){ $('#chatbox_option_co:visible').click() }, 1000);
  };
  var s=document.createElement('script');s.text="("+chatbox_script.toString()+")();";$('object[data^="/chatbox/index.forum"],iframe[src^="/chatbox/index.forum"]').each(function(){try{$(this.contentDocument||this.contentWindow.document).find("#chatbox").closest("html").find("head").first().each(function(){this.appendChild(s.cloneNode(true))})}catch(a){}})
});

Ange Tuteur
Forumaster

Male Posts : 13021
Reputation : 2683
Language : EN10, FR5
Location : Pennsylvania

http://fmdesign.forumotion.com

Back to top Go down

Solved Re: Problem with chatbox auto-login javascript

Post by Van-Helsing on February 24th 2015, 3:23 pm

Hi Ange Tuteur,
It seems working is there a way to hide the options archive/login/logout due the members are always connect in chatbox?

Van-Helsing
Hyperactive

Male Posts : 2197
Reputation : 82
Language : English, Greek

http://helpgr.forumgreek.com/

Back to top Go down

Solved Re: Problem with chatbox auto-login javascript

Post by Ange Tuteur on February 24th 2015, 3:28 pm

Add the following code to your stylesheet.
Administration Panel > Display > Colors > CSS stylesheet
Code:
a[href="/chatbox/index.forum?archives=1"], #chatbox_option_disco { display:none }

Ange Tuteur
Forumaster

Male Posts : 13021
Reputation : 2683
Language : EN10, FR5
Location : Pennsylvania

http://fmdesign.forumotion.com

Back to top Go down

Solved Re: Problem with chatbox auto-login javascript

Post by Van-Helsing on February 24th 2015, 3:40 pm

Thank you very much Ange it seems solved.
~1~

Van-Helsing
Hyperactive

Male Posts : 2197
Reputation : 82
Language : English, Greek

http://helpgr.forumgreek.com/

Back to top Go down

Solved Re: Problem with chatbox auto-login javascript

Post by Ange Tuteur on February 24th 2015, 4:05 pm

You're welcome ^^

Topic arhived

Have a nice day Smile

Ange Tuteur
Forumaster

Male Posts : 13021
Reputation : 2683
Language : EN10, FR5
Location : Pennsylvania

http://fmdesign.forumotion.com

Back to top Go down

View previous topic View next topic Back to top


 
Permissions in this forum:
You cannot reply to topics in this forum