This is an old revision of the document!


Add Chat to Your Website

Overview

<digg> Our standard WebChat applet can easily be added to any web page on any web server or free host and only requires that your users have a Java-enabled browser, which more than 97% of users do. We do not add any banner ads or popup windows to your website or try to install any adware or spyware, so your users can rest assured that using our WebChat applet on your site is completely safe. Your visitors also have the option of using any IRC client by connecting to irc.afternet.org and joining your room.

By default, the login form our WebChat script generates is as simple as possible. This is to allow you to customize it to match the look and feel of the rest of your website, and you can read the information further below to learn how to modify many aspects of the script. The script also gives users the option to automatically login to their AfterNET account using Login-on-Connect.

Test Our Java WebChat Applet

<javachat2>

An AfterNET account allows you to permanently own your channel and also hides your IP address from other users on the network, but it is typically not required for visitors to your website to obtain an account with us to use our WebChat applet. We use DNS RBL blocking to prevent spam on our network, so a very small portion of your users may be required to use Login-on-Connect to connect.

How to Set It Up

The easiest way to set up and install our WebChat applet on your site is to simply copy and paste the following code and insert it into the HTML code of your web page where you'd like the WebChat applet to appear. You'll want to edit the nickname, channel, width, and height variables to customize the default nickname for your visitors, the name of your channel (or chat room), and the size of the Java applet. Be sure that the channel name begins with the # character. You can also choose whether to have the applet open in a new window or expand to fill the space occupied by the login form.

<!-- AfterNET WebChat: Start -->
<script
  src="http://www.afternet.org/chat/afterjavachat.js"
  type="text/javascript">
</script>
<script type="text/javascript">
after_nickname = 'Traveler';
after_channel  = '#afternet';
after_width    = '800';
after_height   = '600';
after_newwin   = 'true';
after_webchat();
</script>
<!-- AfterNET WebChat: End -->

Making Your Channel Your Own

On our network you have the ability to permanently own your channel (or chat room). This allows you to kick out or ban troublesome visitors and extend these rights to others you trust. Once you've found a channel on our network that is not in use by anyone else, you can make that channel your own by following some simple steps.

  • Join your new channel using the WebChat applet and verify that nobody else is in it.
  • Create an AuthServ account to use X3, our channel services bot. To do this, type the following command:
/authserv register <username> <password> <email>

You'll need to fill in your desired username, password, and email address above. Your email address is only used to prevent multiple registrations and if you forget your password. We never use it to send you spam or for any other purposes.

  • Check your email and type the command from the email to complete the account registration. It should look something like this:
/msg AuthServ@X3.AfterNET.Services COOKIE <username> a1b2c3d4e5
  • You should now be automatically logged in to your account. In the future, you can use the login-on-connect feature of the WebChat form to login when you connect or you can type the following command once connected:
/authserv auth <username> <password>
  • Now that you are in your channel and logged in, you can register your channel with this command:
/x3 register <channel>

Remember that the channel name in the above command must begin with the # character. Our channel service bot, X3, will then join your channel. Whenever you login with AuthServ and join your channel, X3 will automatically make you a channel operator. You can learn all about X3's functions on this help page or by typing .help in your channel.

  • If you have any questions, feel free to /join #afternet or /join #help and ask for assistance!

How to Make Detailed Modifications

Our WebChat script has many other variables that you can modify. Here is an expanded version of the simple code above that shows every setting you can change along with its default value.

<!-- AfterNET WebChat: Start -->

<script src="http://www.afternet.org/chat/afterjavachat.js" type="text/javascript">
</script>
<script type="text/javascript">

// Login form settings
var after_nickname    = '';                                              // nickname
var after_channel     = '';                                              // channel
var after_username    = '';                                              // login-on-connect username
var after_password    = '';                                              // login-on-connect password
var after_showchan    = 'true';                                          // show channel box in login form
var after_loccolor    = 'blue';                                          // login-on-connect link color
var after_loctext     = 'underline';                                     // login-on connect link style

// Java applet settings
var after_newwin      = 'false';                                         // open applet in new window
var after_width       = '800';                                           // applet width
var after_height      = '600';                                           // applet height
var after_name        = 'AfterNET WebChat';                              // full name
var after_userid      = 'webchat';                                       // userid in userid@host
var after_quitmessage = 'Goodbye!';                                      // quit message
var after_fontface    = 'Arial';                                         // chat font typeface
var after_fontsize    = '12';                                            // chat font size
var after_useinfo     = 'false';                                         // status or infos window
var after_smileys     = 'false';                                         // use graphical smileys
var after_bgimage     = 'false';                                         // use background image
var after_bgimageurl  = 'pjirc-logo6.gif';                               // background url (pjirc-logo6.gif)
var after_helppage    = 'http://www.afternet.org/help';                  // help button url

// Java applet colors
var after_color11     = 'ff0000';                                        // operator
var after_color12     = 'ff6600';                                        // halfoperator
var after_color10     = '009900';                                        // voice
var after_color0      = '';                                              // black
var after_color1      = '';                                              // white
var after_color2      = '';                                              // dark gray
var after_color3      = '';                                              // gray
var after_color4      = '';                                              // light gray
var after_color5      = '';                                              // foreground
var after_color6      = '';                                              // background
var after_color7      = '';                                              // selection
var after_color8      = '';                                              // event
var after_color9      = '';                                              // close

after_webchat();

</script>

<!-- AfterNET WebChat: End -->

Additionally, the entire WebChat script lives inside <div id=“afterwebchat”></div> tags, so you can use CSS to make further modifications to look and feel of the applet.

Enjoy chatting on AfterNET!