To embed the stickapps Instant Messenger into your community you simply need to put this javascript into your community.

You simple neet to put the script at the end of the BODY tag on each page if a user is logged in!

<script type="text/javascript"> 
  var TOKSTA_CONFIG = { 
  app_id: "your-application-id", 
  user_id: "the-user-id", 
  user_hash: "the-user-hash", 
  user_data: "the-user-data", 
  generated: "current-unix-timestamp", 
    chatbar: { 
     ... 
    }, 
    im: {
     ... 
    } 
  }; 
</script> 
<script src="http://embed.toksta.com/embed/toksta.js" type="text/javascript"></script>

Required Arguments

  • app_id - your application_id provided by stickapps
  • user_id - the id of the user within your community. This id has to be unique!
  • user_hash - this should be a md5-hash combined of the user_id and a predefined password string. This user_hash will be checked in the REST-API (auth-call) and authorize the user.
  • user_data - The data of the user formated like this example:
    name:Susanna Jones;age:27;gender:w;url:http://www.my-community.com/
    profiles/susanna.htm;pic:http://www.my-community.com/images/

    These values can be set in the user_data string:

    • name (string)
    • age (integer)
    • gender (string, either w or m)
    • profile (string) - the url of the user‘s profile
    • pic (string) - the url to the user picture/avatar. size must be 61x46px (width x height)
    • city (string)
    • country (string)
  • generated - The Unix Timestamp, when the implemtation script was created (Number of seconds since 1 January 1979)

Optional Arguments

  • own_url (string) - A URL which will be called in a defined interval → own_url_interval. (only lite & pro plans)
  • own_url_interval (integer) - The interval the call the own_url in seconds. (only lite & pro plans)
  • vhost (string) - Instead of opening the IM Window in http://embed.toksta.com, the IM will be opened it a given domain such as http://chat.your-community.com (this needs to be set up by stickapps first). (only pro plan)
  • show_banner (boolean) - If banner-ads shall be shown in the IM.
  • banner_code (string) - The banner ad code provided by the community. It will either be shown 50% of the time (if lite, while stickapps delivers the other 50%) or shown 100% (if pro)
  • im (object) - Containing all relavant settings for the Instant Messenger popup window
    • cssURL (string) - Url to a CSS - File to change the style of the IM - Client (only pro plan)
    • cssIe6URL (string) - Url to an additional CSS File for possible Internet Explorer 6 adjustments , (only pro plan)
    • design (object) - Here you can set the values of certain design elements (only lite & pro plans):
      • messengerBgColor (string, hex rgb code) the background of the main messenger
      • messengerBGImageURL (string) - the URL of the background image of the messenger
      • chatlogBgColor (string, hex rgb code) - the background color of the chatlog
      • chatlogFontColor (string, hex rgb code) the font color of the chatlog
      • logoImageURL (string) - the URL of your community logo (placed on the top right corner)
    • advancedSearch (array) - fields to search in advanced search (only lite & pro plans))
    • hide (array), Array containing Elements you dont want to be displayed in the chatbar.(only lite & pro plans) Values can be:
      • backButton
      • forwardButton
      • searchMenu
      • friends
      • toolsMenu
      • settings
      • setSound
      • setFocus
      • setDisturb
      • blacklist
      • testWebcam
      • searchName
      • advancedSearch
      • addFriend
      • addBlacklist
      • reportAbuse
      • sendWebcam
      • smileys
      • menuBar
      • toksta - the stickapps branding (only pro plan)
    • communityURL (string) - The URL where the community logo (bottomBar, left-side) will link to.
  • chatbar (object)- contains all settings for the stickapps chatbar (shown at the bottom of each page)
    • hideAll (boolean) - If you want to hide the Chatbar (only pro plan)
    • cssURL (string) - Url to a CSS - File to change the style of the chatbar (only pro plan)
    • cssIe6URL (string) - Url to an additional CSS File for possible Internet Explorer 6 adjustments (only pro plan)
    • listOnlineUsers (boolean, default=true) - If a list of online-users shall apear on click of the chat tab. (only lite & pro plans)
    • theme (string) - The name of the chatbar theme (currently: „default“, „blue“, „green“, „orange“, „purple“, „red“ (only lite & pro plans)
    • design (object) - Define the design of this elements (only lite & pro plans):
      • layerBgColor - the background color of the layer
      • controlsBgColor - the background color of the controls
      • borderColor - the color of the chatbar border
      • fontColor - the font-color of the chatbar
      • typeFace - the typeface of the chatbar
    • hide (array) - Array containing Elements you dont want to be displayed in the chatbar (only lite & pro plans). Values can be:
      • statusTab - the status tab & layer
      • friendsTab - the friends tab & layer
      • chatTab - the chat tab & layer
      • onlineUsersNumber - the number of online users
      • ageFilter - the age filter in the chat tab
      • genderFilter - the gender filter in the chat tab
    • showUserData (array) - containing the user_data value which you want to be shown in the chatbar(only lite & pro plans). Possible Values:
      • gender
      • age
      • city
      • country
    • on_invitation (function, passed parameters: from_user_id, from_user_data) - this function will be called when a new chat invitation arrives. use this parameter to show your own chat invitation. if used the invitation will not be shown in the stickapps chatbar (only pro plan)
    • on_invitation_cancel (function, passed parameters: from_user_id, from_user_data) - this function will be called when the user who sent the invitation canceled chat/invitation. if you use on_invitation you should hide the invitation (only pro plan).
    • on_accept (function, passed parameters: from_user_id, from_user_data) - this function will be called when user clicks on accept in the invitation in the chatbar (only pro plan)
    • on_deny (function, passed parameters: from_user_id, from_user_data) - this function will be called if the user denies as chatinvitation in the chatbar (only pro plan)
 
implemenation_script.txt · Last modified: 2009/09/29 14:03 by mg
 
Except where otherwise noted, content on this wiki is licensed under the following license:CC Attribution-Noncommercial-Share Alike 3.0 Unported
Recent changes RSS feed Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki