|
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.
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:
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:
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:
¶m_username=Lisa+Lee¶m_autologin=true
When using direct links, be certain to observe the following rules:
Direct link code parameters may also be passed via the CGI POST method. |