Naken ChatHow To Setup Naken Chat Chat Applet ClientI. Introduction This is one of the chat clients available for either Javachat or Naken Chat. This client was written for Java 1.0.2 and appears to work on Netscape 3.0, Netscape 4.0, Netscape 4.5, IE 3.0, IE 4.0, and IE 5.0. If you have any problems let me know. I've included two sample html screens for this. One of them was the original html file that set the user's name to default. The second one is an html file and php script so the user can pick background colors, the name they want to use, their default encoding (for non-american char sets), etc. II. Features
III. Installation Step 1: Copy the chatclient.class and DisplayArea.class files into your page. If you have a Canvas2.class you need to copy that also. Step 2: Copy the chatclient.html file onto your web page and edit the parameters (as shown below). OR copy the html/php files (called home.php and chat.php in this archive) onto your web page. Note: You do not NEED PHP to use this applet. The chat.php file is ONLY an example of how it CAN be used. As of version 1.53, the php pages will probably not work immediately on your webpage. The php script was written for older versions on PHP when register_globals was default. If you do not have register_globals turned on in your php.ini file you must either turn it on or edit the chat.php file to add _POST[$variable] around posted variables. This will be changed in newer versions of the chat applet. THAT'S IT! NOTE: The chat server and client MUST be on the same computer. This is due to a security feature in Netscape (this is a good thing, trust me.. if it wasn't there some jackass could send a java applet to your computer through his/her web page and cause your computer to spam someone elses with it being traced back to YOU). If you REALLY want to have the chat and the server on a different computer there is a way to do it by signing the applet or serving from a computer running SSL. This requires the user the grant priveliges. NOTE: DisplayArea.class is included as source code in this archive. Now for the parameters (If you forget a parameter the applet will pick a default). First we have the applet tag. You may set height and width to whatever you want and the applet will adjust itself properly (Note: starting with applet 1.10 if you use GIF/JPEG buttons this may not size properly)): <applet code="chatclient.class" height=400 width=600>Now we have the port which the server runs on. If you didn't change it on the server it should default to 6666 (the number of the beast multiplied by 10 plus 6): <param name="port" value="6666">Give the applet a default font, and default size. You can use the values: Helvetica, Courier, Times (or on 1.1 browsers: Sans, SansSerif, Monospace). <param name="font" value="Helvetica"><param name="fontsize" value="12"> The color parameter.. hmm.. I wonder if it still works if you set it to 0. If you set it to 0 it will create an ugly no color text box but people can cut and paste text from it. Color mode is the pretty version with colors for privates, yells, channel messages, and normal messages. <param name="color" value="1">YourName sets the name the user will have when they connect to the chat. <param name="YourName" value="">Turn allowanychannel off and users can only change to the channels listed in the drop down. <param name="allowanychannel" value="1">This will set the channel names listed in the channel menu. <param name="channel1" value="Masquerade"><param name="channel2" value="Linux Talk"> <param name="channel3" value="FreeBSD"> <param name="channel4" value="Windows Room"> If you want the user to be automatically put in a channel set the defaultchannel parameter. If not take the HTML code out: <param name="defaultchannel" value="Windows Room">Default encoding sets the encoding the applet users. If the chat is American don't set these two. International mode must be set set to 1 for the applet to accept the encoding AND the browser must be able to do Java 1.1. An example of an encoding to set would be Cp1252 (which would allow the applet to do Swedish A rings, A dots, O dots). If you don't know which encodings to try please look at this page: http://java.sun.com/products/jdk/1.1/docs/guide/intl/encoding.doc.html. <param name="defaultencoding" value="Cp1252"><param name="international" value="1"> If you set these to zero you can turn off parts of the applet. For example if you turn off rightbar, all the buttons on the right won't show up and there will be more room for the user to see chat messages. For Russian encodings I've found it good to take out the bottombar and run that through Javascript. <param name="bottombar" value="1"><param name="channelbox" value="1"> <param name="namebox" value="1"> <param name="rightbar" value="1"> The following will set (in order of appearance: channel messages color, private messages color, yell messages color, normal messages color, the text's background color, the panel's forground color, the panel's background color, and the scrollbar color. These values must be a hex value with a # first or the applet will probably not start. <param name="mscolor" value="#00ff00"><param name="privcolor" value="#0000ff"> <param name="yellcolor" value="#ff0000"> <param name="fgcolor" value="#ffffff"> <param name="bgcolor" value="#000000"> <param name="panelbackcolor" value="#999999"> <param name="panelforecolor" value="#000000"> <param name="scrollbarcolor" value="#999999"> If you want a background picture under the user's text, set this. It can be a gif or jpg I believe. Dunno if anything else works. <param name="backgroundlogo" value="nakenlogo.gif">I put the host parameter last for a reason. DO NOT USE IT. You probably do not need it. If you use it the applet will not work unless the applet is properly signed and priveleges must be granted. I left it in cause in small cases this could be useful, but to most people this is worthless.. <param name="host" value="your.server.com">The new 1.35 chat applet supports Hebrew and Arabic right alignment of text. I have Israeli and Arabic friends who say the encoding works so I added right alignment options :). <param name="hebrew" value="1"><param name="arabic" value="1"> </applet>
|