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.

Replacing Chatbox With Xat Chat

View previous topic View next topic Go down

Solved Replacing Chatbox With Xat Chat

Post by kvance on Thu Mar 19, 2015 1:37 pm

Hello,

Over on my forum the admins and myself have decided to do away with the regular forumotion chatbox in favor of having a XAT chat. My question is is there a way to place the xat chat in the area where the chatbox usually is? So then the chat would be at the bottom of the forum? Like if the chatbox was still active. I've already got the code for the chatbox I just didn't know if this was possible.

Forum URL=http://xwlleague.forumotion.com


Last edited by kvance on Sat Mar 21, 2015 6:40 pm; edited 1 time in total

kvance
Forumember

Male Posts : 136
Reputation : 2
Language : English
Location : Ohio

http://xwlleague.forumotion.com/

Back to top Go down

Solved Re: Replacing Chatbox With Xat Chat

Post by Ange Tuteur on Thu Mar 19, 2015 3:53 pm

Hello @kvance,

Go to Administration panel > Modules > JavaScript codes management > Create a new script

Placement : Wherever you want the CB
Paste the following code :
Code:
$(function() {
  var content = '',
      d = document.createElement('DIV');
  d.innerHTML = content;
 
  document.getElementById('page-body').appendChild(d);
});

Where you see the quotes in content = '', you'll place your code between those quotes. I'm not exactly sure what the code looks like, so if it doesn't work, provide the code you have here.

Ange Tuteur
Forumaster

Male Posts : 13028
Reputation : 2704
Language : EN10, FR5
Location : Pennsylvania

http://fmdesign.forumotion.com

Back to top Go down

Solved Re: Replacing Chatbox With Xat Chat

Post by kvance on Thu Mar 19, 2015 4:44 pm

Alright. I'll try that now and let you know. This is my code atm btw.

<embed wmode="transparent" src="http://www.xatech.com/web_gear/chat/chat.swf" quality="high" width="540" height="405" name="chat" FlashVars="id=213433202" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://xat.com/update_flash.php" /><br><small><a target="_BLANK" href="http://xat.com/web_gear/?cb">Get your own Chat Box!</a> <a target="_BLANK" href="http://xat.com/web_gear/chat/go_large.php?id=213433202">Go Large!</a></small><br>

So I'm pretty sure that'll work, but, I'm gonna try it now. Is there a way to place it at the bottom of the homepage? Like where the initial chatbox goes?

kvance
Forumember

Male Posts : 136
Reputation : 2
Language : English
Location : Ohio

http://xwlleague.forumotion.com/

Back to top Go down

Solved Re: Replacing Chatbox With Xat Chat

Post by Ange Tuteur on Thu Mar 19, 2015 5:37 pm

That should work, try this :
Code:
$(function() {
  var content = '<embed wmode="transparent" src="http://www.xatech.com/web_gear/chat/chat.swf" quality="high" width="100%" height="405" name="chat" FlashVars="id=213433202" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://xat.com/update_flash.php" /><br><small><a target="_BLANK" href="http://xat.com/web_gear/?cb">Get your own Chat Box!</a> <a target="_BLANK" href="http://xat.com/web_gear/chat/go_large.php?id=213433202">Go Large!</a></small><br>',
      d = document.createElement('DIV');
  d.innerHTML = content;
 
  document.getElementById('page-body').appendChild(d);
});

It'll place the chat at the bottom of the page. If you want it to only display for logged in users, replace the script with this one :
Code:
$(function() {
  if (!_userdata.session_logged_in) return;
  var content = '<embed wmode="transparent" src="http://www.xatech.com/web_gear/chat/chat.swf" quality="high" width="100%" height="405" name="chat" FlashVars="id=213433202" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://xat.com/update_flash.php" /><br><small><a target="_BLANK" href="http://xat.com/web_gear/?cb">Get your own Chat Box!</a> <a target="_BLANK" href="http://xat.com/web_gear/chat/go_large.php?id=213433202">Go Large!</a></small><br>',
      d = document.createElement('DIV');
  d.innerHTML = content;
 
  document.getElementById('page-body').appendChild(d);
});

Ange Tuteur
Forumaster

Male Posts : 13028
Reputation : 2704
Language : EN10, FR5
Location : Pennsylvania

http://fmdesign.forumotion.com

Back to top Go down

Solved Re: Replacing Chatbox With Xat Chat

Post by kvance on Thu Mar 19, 2015 5:45 pm

Have to hear back from my other admins on which we want to use but I appreciate the help and I'll be trying these out soon. I'll respond back if it works. If it does this can be closed. Smile

kvance
Forumember

Male Posts : 136
Reputation : 2
Language : English
Location : Ohio

http://xwlleague.forumotion.com/

Back to top Go down

Solved Re: Replacing Chatbox With Xat Chat

Post by kvance on Fri Mar 20, 2015 6:51 am

Alright, so everything is perfect but, it's not centered with the rest of the page. Is there any way we can do that? If so I'll edit it on my site and then this is solved.

kvance
Forumember

Male Posts : 136
Reputation : 2
Language : English
Location : Ohio

http://xwlleague.forumotion.com/

Back to top Go down

Solved Re: Replacing Chatbox With Xat Chat

Post by Ange Tuteur on Fri Mar 20, 2015 10:52 pm

add this :
Code:
d.style.textAlign = 'center';

after this :
Code:
d.innerHTML = content;

Ange Tuteur
Forumaster

Male Posts : 13028
Reputation : 2704
Language : EN10, FR5
Location : Pennsylvania

http://fmdesign.forumotion.com

Back to top Go down

Solved Re: Replacing Chatbox With Xat Chat

Post by kvance on Sat Mar 21, 2015 6:06 am

Do I place it right after or on the same line just spaced over? As I placed it and I'm not sure if it's centered with the rest of the forum



"$(function() {
var content = '<embed wmode="transparent" src="http://www.xatech.com/web_gear/chat/chat.swf" quality="high" width="70%" height="405" name="chat" FlashVars="id=213433202" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://xat.com/update_flash.php" /><br><small><a target="_BLANK" href="http://xat.com/web_gear/?cb">Get your own Chat Box!</a> <a target="_BLANK" href="http://xat.com/web_gear/chat/go_large.php?id=213433202">Go Large!</a></small><br>',
d = document.createElement('DIV');
d.innerHTML = content;
d.style.textAlign = 'center';

document.getElementById('page-body').appendChild(d);
});"

Is how I have it written. Not sure if I need to put it on the same line or space it over one? Thanks for the help it's very appreciated.

Unless, this is as centered as it's going to get, if so then this is solved.

kvance
Forumember

Male Posts : 136
Reputation : 2
Language : English
Location : Ohio

http://xwlleague.forumotion.com/

Back to top Go down

Solved Re: Replacing Chatbox With Xat Chat

Post by Ange Tuteur on Sat Mar 21, 2015 5:43 pm

That's correct, I checked and it's centered. It doesn't look centered, because of your forum widgets. If you want, you can try replace the textAlign statement with this :
Code:
d.style.marginLeft = '180px';

I'm not sure how that would turn out. You could also change the textAlign value from 'center' to 'right' so it's directly to the right of the content. It depends on what you prefer.

Ange Tuteur
Forumaster

Male Posts : 13028
Reputation : 2704
Language : EN10, FR5
Location : Pennsylvania

http://fmdesign.forumotion.com

Back to top Go down

Solved Re: Replacing Chatbox With Xat Chat

Post by kvance on Sat Mar 21, 2015 6:40 pm

The margin 180px moved it just enough. So I'm satisfied now. Really appreciate all your help Ange.

kvance
Forumember

Male Posts : 136
Reputation : 2
Language : English
Location : Ohio

http://xwlleague.forumotion.com/

Back to top Go down

Solved Re: Replacing Chatbox With Xat Chat

Post by Ange Tuteur on Sat Mar 21, 2015 6:58 pm

You're welcome Wink

Topic archived

Ange Tuteur
Forumaster

Male Posts : 13028
Reputation : 2704
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