[advanced search]
 

Go Back   NamePros.com > Discussion > Web Design & Development > Programming

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


Closed Thread
 
LinkBack Thread Tools
Old 07-05-2008, 11:26 PM   #1 (permalink)
New Member
 
Join Date: Jun 2008
Posts: 7
0.00 NP$ (Donate)

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 01:56 PM.
twizzlers is offline  
Old 07-06-2008, 06:45 AM   #2 (permalink)
Your face is regfee!
 
yilduz's Avatar
 
Join Date: May 2008
Location: Oregon
Posts: 864
908.03 NP$ (Donate)

yilduz is a glorious beacon of lightyilduz is a glorious beacon of lightyilduz is a glorious beacon of lightyilduz is a glorious beacon of lightyilduz is a glorious beacon of light

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.
__________________
I miss my dog - Athena
Yilduz Network | Gaming Gears | Affpros.com
CodeBoards
yilduz is offline  
Old 07-06-2008, 07:46 AM   #3 (permalink)
Danltn.com
 
Daniel's Avatar
 
Join Date: May 2007
Location: Danltn.com / Nottingham, UK
Posts: 1,201
13.51 NP$ (Donate)

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, 07:54 AM   #4 (permalink)
Senior Member
 
nasaboy007's Avatar
 
Join Date: Jul 2005
Location: NJ
Posts: 1,112
1,454.30 NP$ (Donate)

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 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.

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, 02:48 PM   #5 (permalink)
New Member
 
Join Date: Jun 2008
Posts: 7
0.00 NP$ (Donate)

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 ?>)
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, 09:41 PM   #6 (permalink)
Your face is regfee!
 
yilduz's Avatar
 
Join Date: May 2008
Location: Oregon
Posts: 864
908.03 NP$ (Donate)

yilduz is a glorious beacon of lightyilduz is a glorious beacon of lightyilduz is a glorious beacon of lightyilduz is a glorious beacon of lightyilduz is a glorious beacon of light

Animal Rescue
Quote:
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 ?>)
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.
__________________
I miss my dog - Athena
Yilduz Network | Gaming Gears | Affpros.com
CodeBoards
yilduz is offline  
Old 07-06-2008, 11:46 PM   #7 (permalink)
New Member
 
Join Date: Jun 2008
Posts: 7
0.00 NP$ (Donate)

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
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, 06:26 AM   #8 (permalink)
NamePros Member
 
Join Date: Sep 2006
Posts: 87
100.00 NP$ (Donate)

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.


Bruce

Last edited by Bruce_KD; 07-07-2008 at 03:53 PM.
Bruce_KD is offline  
Old 07-07-2008, 02:08 PM   #9 (permalink)
New Member
 
Join Date: Jun 2008
Posts: 7
0.00 NP$ (Donate)

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

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Site Sponsors
Advertise your business at NamePros

All times are GMT -7. The time now is 03:05 PM.


Powered by: vBulletin® Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0
Template-Modifications by TMS
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85