NamePros
Welcome, Guest! Ready to make a name for yourself in the domain business? We welcome both the hobbyist and professional domainer to join the discussion as part of the NamePros community.

Click here to create your profile to start earning reputation for posting, and trader ratings for buying & selling in our free e-marketplace. Build your trader rating with each successful sale. Our system has tracked over 100,000 sales and counting!
FAQ & TOS Register Search Today's Posts Mark Forums Read

Go Back   NamePros.com > Website Development Discussion Forums > Programming
Reload this Page Adding chatbox

Programming PHP, Perl, Ruby on Rails, AJAX, HTML, XHTML, CSS, JavaScript, MySQL and any other coding topics.

Advanced Search


Closed Thread
 
LinkBack Thread Tools
Old 07-06-2008, 12:26 AM THREAD STARTER               #1 (permalink)
New Member
Join Date: Jun 2008
Posts: 7
twizzlers is an unknown quantity at this point
 



Adding chatbox


Hi, I want to add a chatbox to my site:
http://www.cbox.ws/ ------> basically just generates a html code for you to put on your site.

Is this AJAX? Cuz I tried making a chat_box.php file and it turned out with all these weird symbols. If it's AJAX, can someone kinda point me in the direction of what I would have to do? (I've never done ajax..)

Thanks in advance
__________________
PM me for a banner.
Last edited by twizzlers; 07-21-2008 at 02:56 PM.
twizzlers is offline  
Old 07-06-2008, 07:45 AM   #2 (permalink)
Your face is regfee!
 
yilduz's Avatar
Join Date: May 2008
Location: Oregon
Posts: 1,075
yilduz is a splendid one to beholdyilduz is a splendid one to beholdyilduz is a splendid one to beholdyilduz is a splendid one to beholdyilduz is a splendid one to beholdyilduz is a splendid one to beholdyilduz is a splendid one to behold
 



Animal Rescue
It's using Ajax for those other things, so if you want to keep it like that, I guess you'll need Ajax. You could mimic what it's doing in php or javascript, but it wouldn't work exactly the same way. I can't help with ajax, though, I've never worked with it before.
__________________
Looking for fantasy hockey owners to begin the new season on ESPN. Deep league with lots of owners and a very high % of keepers (dynasty league). Looking for active owners because this league will continue year after year.
My homepage | I miss my dog - Athena
yilduz is offline  
Old 07-06-2008, 08:46 AM   #3 (permalink)
Danltn.com
 
Daniel's Avatar
Join Date: May 2007
Location: Danltn.com / Nottingham, UK
Posts: 1,201
Daniel has a reputation beyond reputeDaniel has a reputation beyond reputeDaniel has a reputation beyond reputeDaniel has a reputation beyond reputeDaniel has a reputation beyond reputeDaniel has a reputation beyond reputeDaniel has a reputation beyond reputeDaniel has a reputation beyond reputeDaniel has a reputation beyond reputeDaniel has a reputation beyond reputeDaniel has a reputation beyond repute
 


Ethan Allen Fund Ethan Allen Fund
Simplest method is probably just to include it from the start, but set it to display:none; so it's not visible. When someone clicks the "Chat!" button, you change the display setting on it so it's visible again.

Dan
Daniel is offline  
Old 07-06-2008, 08:54 AM   #4 (permalink)
Senior Member
 
nasaboy007's Avatar
Join Date: Jul 2005
Location: NJ
Posts: 1,219
nasaboy007 has much to be proud ofnasaboy007 has much to be proud ofnasaboy007 has much to be proud ofnasaboy007 has much to be proud ofnasaboy007 has much to be proud ofnasaboy007 has much to be proud ofnasaboy007 has much to be proud ofnasaboy007 has much to be proud ofnasaboy007 has much to be proud of
 



Daniel's method is probably the best way to do it without actually messing with AJAX, but it might be helpful to use javascript here.

????: NamePros.com http://www.namepros.com/programming/489684-adding-chatbox.html
try doing something like:

Code:
<html>
<head>
<script>
function show(x) {
document.getElementById('divelementname').style.visibility=visible;
}
</script>
</head>
<body>
<div id="chatbox" style="visibility:hidden;">
<?php include("chatbox.php"); ?>
</div>
<input type="button" value="Chat!" onSubmit="show('chatbox')">
</body>
</html>
Or something to that effect.
nasaboy007 is offline  
Old 07-06-2008, 03:48 PM THREAD STARTER               #5 (permalink)
New Member
Join Date: Jun 2008
Posts: 7
twizzlers is an unknown quantity at this point
 



So I put that in my layout.php file, but where do I put the code for the chatbox? In the layout place or do I make a separate chatbox.php file?

This is the chatbox code - it's just html right? Do I have to put these php things around it (<?php and ?>)
????: NamePros.com http://www.namepros.com/showthread.php?t=489684
Code:
<!-- BEGIN CBOX - www.cbox.ws -->
<div align="center" id="cboxdiv">
<iframe frameborder="0" width="300" height="100" src="http://www4.cbox.ws/box/?boxid=3522815&amp;boxtag=zacwjc&amp;sec=main" marginheight="2" marginwidth="2" scrolling="auto" allowtransparency="yes" name="cboxmain" style="border:#DBE2ED 1px solid;" id="cboxmain"></iframe><br/>
<iframe frameborder="0" width="300" height="75" src="http://www4.cbox.ws/box/?boxid=3522815&amp;boxtag=zacwjc&amp;sec=form" marginheight="2" marginwidth="2" scrolling="no" allowtransparency="yes" name="cboxform" style="border:#DBE2ED 1px solid;border-top:0px" id="cboxform"></iframe>
</div>
<!-- END CBOX -->
__________________
PM me for a banner.
twizzlers is offline  
Old 07-06-2008, 10:41 PM   #6 (permalink)
Your face is regfee!
 
yilduz's Avatar
Join Date: May 2008
Location: Oregon
Posts: 1,075
yilduz is a splendid one to beholdyilduz is a splendid one to beholdyilduz is a splendid one to beholdyilduz is a splendid one to beholdyilduz is a splendid one to beholdyilduz is a splendid one to beholdyilduz is a splendid one to behold
 



Animal Rescue
Originally Posted by twizzlers
So I put that in my layout.php file, but where do I put the code for the chatbox? In the layout place or do I make a separate chatbox.php file?

This is the chatbox code - it's just html right? Do I have to put these php things around it (<?php and ?>)
????: NamePros.com http://www.namepros.com/showthread.php?t=489684
Code:
<!-- BEGIN CBOX - www.cbox.ws -->
<div align="center" id="cboxdiv">
<iframe frameborder="0" width="300" height="100" src="http://www4.cbox.ws/box/?boxid=3522815&amp;boxtag=zacwjc&amp;sec=main" marginheight="2" marginwidth="2" scrolling="auto" allowtransparency="yes" name="cboxmain" style="border:#DBE2ED 1px solid;" id="cboxmain"></iframe><br/>
<iframe frameborder="0" width="300" height="75" src="http://www4.cbox.ws/box/?boxid=3522815&amp;boxtag=zacwjc&amp;sec=form" marginheight="2" marginwidth="2" scrolling="no" allowtransparency="yes" name="cboxform" style="border:#DBE2ED 1px solid;border-top:0px" id="cboxform"></iframe>
</div>
<!-- END CBOX -->
You can put it in the file or make a separate php file for it, either way, whichever is easier for you.

Yes, it's just an html code. You don't have to put the <?php and ?> around it.

My homepage does that same thing using javascript. I did it a while back just to see if I could.
__________________
Looking for fantasy hockey owners to begin the new season on ESPN. Deep league with lots of owners and a very high % of keepers (dynasty league). Looking for active owners because this league will continue year after year.
My homepage | I miss my dog - Athena
yilduz is offline  
Old 07-07-2008, 12:46 AM THREAD STARTER               #7 (permalink)
New Member
Join Date: Jun 2008
Posts: 7
twizzlers is an unknown quantity at this point
 



why isn't this working?? I put this in my layout.php
Code:
<script>
function show(x) {
document.getElementById('divelementname').style.vi  sibility=visible;
}
</script>
</head>

<body>

<?php include('includes/chat-box.html'); ?>
</div>
<input type="button" value="Chat!" onSubmit="show('chatbox')">
my chat-box.html has this
????: NamePros.com http://www.namepros.com/showthread.php?t=489684
Code:
<!-- BEGIN CBOX - www.cbox.ws -->
<div align="center" id="cboxdiv"><div class="chat-box">
<iframe frameborder="0" width="300" height="100" src="http://www4.cbox.ws/box/?boxid=3522815&amp;boxtag=zacwjc&amp;sec=main" marginheight="2" marginwidth="2" scrolling="auto" allowtransparency="yes" name="cboxmain" style="border:#DBE2ED 1px solid;" id="cboxmain"></iframe><br/>
<iframe frameborder="0" width="300" height="75" src="http://www4.cbox.ws/box/?boxid=3522815&amp;boxtag=zacwjc&amp;sec=form" marginheight="2" marginwidth="2" scrolling="no" allowtransparency="yes" name="cboxform" style="border:#DBE2ED 1px solid;border-top:0px" id="cboxform"></iframe>
</div>
<!-- END CBOX -->
But this is what happens:
Code:
ÿþ� �� �� �<�!�-�-� �B�E�G�I�N� �C�B�O�X� �-� �w�w�w�.�c�b�o�x�.�w�s� �-�-�>�� �<�d�i�v� �a�l�i�g�n�=�"�c�e�n�t�e�r�"�
The 'chat!' button shows up, but doesn't do anything when I click it.

So confused!!!
__________________
PM me for a banner.
twizzlers is offline  
Old 07-07-2008, 07:26 AM   #8 (permalink)
NamePros Member
Join Date: Sep 2006
Posts: 99
Bruce_KD will become famous soon enoughBruce_KD will become famous soon enough
 



Code:
<script type='text/javascript'>
function show(x) {
  var el = document.getElementById(x);
  if (!el) return;
  el.style.display='';
}
</script>
</head>

<body>
<?php include('includes/chat-box.html'); ?>
<input type="button" value="Chat!" onclick="show('cboxdiv')">
</body>
</html>
Code:
<div align="center" id="cboxdiv" style='display: none;'>
  <div class="chat-box">
<iframe frameborder="0" width="300" height="100" src="http://www4.cbox.ws/box/?boxid=3522815&amp;boxtag=zacwjc&amp;sec=main" marginheight="2" marginwidth="2" scrolling="auto" allowtransparency="yes" name="cboxmain" style="border:#DBE2ED 1px solid;" id="cboxmain"></iframe><br/>
<iframe frameborder="0" width="300" height="75" src="http://www4.cbox.ws/box/?boxid=3522815&amp;boxtag=zacwjc&amp;sec=form" marginheight="2" marginwidth="2" scrolling="no" allowtransparency="yes" name="cboxform" style="border:#DBE2ED 1px solid;border-top:0px" id="cboxform"></iframe>
  </div>
</div>
There were a few things that were wrong, and a few things I changed just by preference, but that should work.
????: NamePros.com http://www.namepros.com/showthread.php?t=489684


Bruce
Last edited by Bruce_KD; 07-07-2008 at 04:53 PM.
Bruce_KD is offline  
Old 07-07-2008, 03:08 PM THREAD STARTER               #9 (permalink)
New Member
Join Date: Jun 2008
Posts: 7
twizzlers is an unknown quantity at this point
 



Still just has a bunch of this
Code:
þ� �� �� �<�!�-�-� �B�E�G�I�N� �C�B�O�X� �-� �w�w�w�.�c�b�o�x�.�w�s� �-�-�>�� �<�d�i�v� �a�l�i�g�n�=�"�c�e�n�t�e�r�"�!�-�-� �B�E�G�I�N� �C�B�O�X� �-� �w�w�w�.�c�b�o�x�.�w�s� �-�-�>�� �<�d�i�v� �a�l�i�g�n�=�"�c�e�n�t�e�r�"�
What does ^ even mean?
__________________
PM me for a banner.
twizzlers is offline  
Closed Thread


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools


Liquid Web Smart Servers  
All times are GMT -7. The time now is 11:55 AM.

Managed Web Hosting by Liquid Web
Domain name forum recommended by Domaining.com Powered by: vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.6.0 Ad Management plugin by RedTyger