Advanced users and web developers may use code parameters to pass additional instructions to AddonChat chat clients.

Code Parameters

The following code parameters may be passed to the chat client launch script (chat.js) by configuring the addonchat_param variable as shown in the example below the table.

Parameter Name Type Description
autologin Boolean Automatic login
username String Default user name
password String Default user password
subroom String Default subroom
timestamp Boolean Enable/disable timestamp
audio Boolean Enable/disable audio
mycolor Color Default user color
myfont Font Default user font
url_exit_enable Boolean Enable exit URL
url_exit URL Specify exit URL
user_show_emoticons Boolean Enable/disable emoticons
user_show_enhanced Boolean Enable/disable markup
user_show_avatar Boolean Enable/disable avatars
user_ignore_im Boolean Ignore instant messages
username_prompt_readonly Boolean Make username prompt Read-Only
bgcolor Color Specify background color
password_prompt_readonly Boolean Make password prompt read-only
password_prompt_after_initial Boolean Show password prompt after failed login
login_prompt_after_autologin Boolean Prompt for username/password after failed auto-login
iconsize Integer Specify default icon size
(0:16x16, 1:24x24, 2:32x32)
panel_start String Specify applet start-up display panel
One of register, password, or verify.
subroom_single Boolean Only show current room in user list
(enterprise only)

Code parameters are added just before var addonchat in your link code, or they can be placed just after the addonchat JavaScript object.

Code parameters will override your control panel settings, and any user settings that may have been saved within browser cookies. Depending upon your control panel settings, some items can be changed by the user after they have logged in.

Some parameters are only available with Professional PLUS or Enterprise edition chat rooms. Additionally, some clients (e.g., the iPhone mobile client) may only use a subset of the full code parameter list.

The following parameter types are used in code parameters:

  • Boolean
    Boolean type entries (e.g., audio), should be specified as either true or false. Values of 1, "on", or "yes" may be used in place of true, and values of 0, "off", or "no" may be used in place of false.
  • String
    String values may contain any valid ASCII or UTF-8 character code sequence. String values must be placed within quotation marks.
  • Integer
    Positive or (if applicable) negative number. Integer values need not be placed within quotation marks.
  • Dimension
    Positive integer to indicate a dimension (height or width) in pixels, or a percentage ("1%" to "100%") value. Percentage dimensions values must be enclosed in quotation marks.
  • Color
    Color values should be in 6 digit RGB hexadecimal format; the same as used in the control panel. A leading hash (#) is required for the bgcolor and boxbgcolor parameters. Color values must be placed within quotation marks.
  • Font
    Font values should be of the form Name-Style-Size; where Name is any valid system font name; Style is one of PLAIN, BOLD, ITALIC or BOLD+ITALIC; and size is a positive integer no larger than 48. Font values must be placed within quotation marks.
  • URL
    URL values must be valid, fully qualified uniform resource locators. URL values typically contain world wide web site addresses. URL values must be placed within quotation marks.
Code Parameter Example #1
The following example will automatically log in a user with a user name of John using password 12345. The user's color will be set to black (#000000), and the user's display font will be set to a plain 13 pixel Verdana. A URL exit is enabled and set to launch www.addonchat.com.
  /* Code parameters are added just before (or after)
     "var addonchat" in your link code */

   var addonchat_param = {
      username: "John",
      password: "12345",
      autologin: true,
      mycolor: "#000000",
      myfont: "Verdana-PLAIN-13",
      url_exit_enable: true,
      url_exit: "http://www.addonchat.com"
   }
Code Parameter Example #2
To illustrate where the addonchat_param object may be placed, below is another example which contains a user's full link code. This example merely specifies that audio be disabled by default:
<script type="text/javascript">/*<![CDATA[*/
   var addonchat = {
      server:0, id:8847, width:"625", ssl:false,
      height:"380", language:"en", signed:true }

   /* Insert your custom code parameter(s) here: */

   var addonchat_param = {
      audio: false
   }

   /* ]]> */</script>
   <script type="text/javascript"
   src="http://client0.addonchat.com/chat.js"></script><noscript>
   To enter this chat room, please enable JavaScript in your web
   browser. This <a href="http://www.addonchat.com/">Chat
   Software</a> requires Java: <a href="http://www.java.com/">Get
   Java Now</a>
</noscript>

The subroom_single parameter may only be used with Enterprise edition accounts. When used in conjunction with the autologin, username, and password parameters, the subroom parameter can be used to automatically sign a user in and place him/her in a specific room.

Direct Link Parameters

If you choose to make use of the the popup link, simple link or direct link (no website) options, you may also make use of code parameters by passing slightly modified URL-encoded code parameters as URL parameters. It's easy, and we've provided examples below:

The popup Link, simple Link and direct Link options all call a script called chat.php (or sc.php, or sc.pl in legacy codes which now all redirect to chat.php).

Parameter names passed to the direct link are the exact same as the standard code parameters except that they must all be prefixed with param_, with the exception of the additional optional parameters listed below:

Parameter Name Type Description
lang_code String ISO-639-1 Language Code
(e.g., "en", "en_uk", "de", etc..)
s - Use Digitally Signed Java Applet
(when possible)
fs - Use full browser screen to display chat room
applet_height Dimension Chat Room Height (when applicable)
applet_width Dimension Chat Room Width (when applicable)
color_applet_foreground Color [Presently not used]
color_applet_background Color Page background color
text_applet_title String Page Title

If you are using the direct link (no website), we recommend that code parameters be kept to a minimum for clarity.

Direct Link Parameter Example #1
The following example sets the language to Dutch for the end-user, and displays the chat room such that it uses the entire browser window space. The code below that is not displayed in red will vary from account to account and should be disregarded.
http://client0.addonchat.com/chat.php?id=8847&lang_code=nl&fs
Direct Link Parameter Example #2
The following example parameter code will attempt to automatically log a user in with the name 'Lisa Lee'. In this example, we did not include your unique chat.php link:
&param_username=Lisa+Lee&param_autologin=true

When using direct links, be certain to observe the following rules:

  • Direct link code parameters should be prefixed with param_
    The only exception to this rule is when using one of the direct-link specific parameters listed above.
  • Direct link code parameter values are never be enclosed in quotation marks.
  • Direct link code parameters should be URL encoded.

Direct link code parameters may also be passed via the CGI POST method.


Close Window