Post by Ensui on Mar 2, 2005 3:52:41 GMT
After 3 days of coding it is finally complete....
Proboards Chatroom v1.0.0
Now for the code:
Place this in all headers:
Now for the php section:
Upload this file to your host after editing.
Just change http://my board.proboards??.com/index.cgi to the url of your proboards with the /index.cgi at the end.Do not remove the question mark or what is after the question mark.
Upload that to your host. Then create a blank file and save it as chat.txt and upload it to your host.
Now for the rest of the javascript:
Place this in mian footer after editing.
Simply change CHAT TXT FILE URL to the url of the blank txt file you uploaded and change CHAT PHP FILE URL to the url of the php file you uploaded.
And that is it.
Enjoy your new chatroom
Live Preview: projectjello.proboards37.com/index.cgi?area=chat
Proboards Chatroom v1.0.0
Now for the code:
Place this in all headers:
<script type="text/javascript">
var TD=document.getElementsByTagName('TD');
//Place chatroom menu image here,if none leave default
var image = "http://img32.exs.cx/img32/4786/chatroom2pg.gif"
TD[5].innerHTML+='<a href="/index.cgi?area=chat"><img src="'+image+'" border=0></a>'
</script>
Now for the php section:
Upload this file to your host after editing.
<?php
/*
PB Chat v1.0.0[PHP Section]
Created by Infection X
http://gzoneforums.proboards38.com/index.cgi
*/
ob_start();
$name = stripslashes($_POST["name"]);
$message = stripslashes($_POST["message"]);
$chat = "\r\n[$name] $message";
$chatfile = "chat.txt";
$handle = fopen($chatfile, "a");
fwrite($handle, $chat);
fclose($handle);
header("Location: http://my board.proboards??.com/index.cgi?area=messagesent");
ob_flush();
?>
Just change http://my board.proboards??.com/index.cgi to the url of your proboards with the /index.cgi at the end.Do not remove the question mark or what is after the question mark.
Upload that to your host. Then create a blank file and save it as chat.txt and upload it to your host.
Now for the rest of the javascript:
Place this in mian footer after editing.
<script type="text/javascript">
/*
PB Chat v1.0.0
Created by Infection X
http://gzoneforums.proboards38.com/index.cgi
*/
var TD=document.getElementsByTagName("TD")
if(location.href.indexOf('area=chat')!=-1){
var iTable = document.getElementsByTagName("TABLE");
for(i=4;i<iTable.length;i++){iTable[i].style.display="none"}
document.write('<br/><table width="700px" height="300px" class="bordercolor" border="0" align="center" cellpadding="1" cellspacing="1"><tr><td class="titlebg" align="center" height="15px">Chatroom</td></tr><tr><td class="windowbg" height="270px"><iframe src="CHAT TXT FILE URL" width="690" height="290px" align="center" frameborder=0 scrolling=auto></iframe></td></tr><tr><td class="windowbg2" height="15px"><form action="CHAT PHP FILE URL" name="form" method="POST"><font size=2>Name:<input type=text name="name" size=20 tabindex="1"></font><br/><font size=2>Message:<input type=text name="message" value="" size=20 tabindex="1"></font> <input type=submit value="Chat" tabindex="6" accesskey="l"></form>[<a href="/index.cgi?area=chat" >Refresh</a>](Refresh often to view new messages)</td></tr></table><br /><table width="700px" class="bordercolor" border="0" align="center" cellpadding="1" cellspacing="1"><tr><td class="windowbg">Powered by PB Chat v1.0.0 created by <a href="http://gzoneforums.proboards38.com/index.cgi" target="_blank">Infection X</a></td></tr></table>')
}
if(location.href.indexOf('area=messagesent')!=-1){
var iTab = document.getElementsByTagName("TABLE");
for(i=4;i<iTab.length;i++){iTab[i].style.display="none"}
document.write('<br/><table width="700px" class="bordercolor" border="0" align="center" cellpadding="1" cellspacing="1"><tr><td class="windowbg">Message Sent.<br/>[<a href="/index.cgi?area=chat" >Redirect</a>]</td></tr></table>')
}
</script>
Simply change CHAT TXT FILE URL to the url of the blank txt file you uploaded and change CHAT PHP FILE URL to the url of the php file you uploaded.
And that is it.
Enjoy your new chatroom
Live Preview: projectjello.proboards37.com/index.cgi?area=chat