E-mail: Password: Forgot Password?
en |
 
Instant MessengerFeaturesImplementationFAQ  

Demo implementation of the toksta* IM

Please note that the toksta* IM can only function correctly, if you have embedded it as described in this document. If you remove the code temporarily or if you would like to embed it at a later point in time, you can access the complete script at any time in the customer area of toksta.com. If you have questions about this process, we are available at any time at support@toksta.info.

Step 1: Integration into the <BODY> area



With the following script, the user is initialized and authorized by toksta* in one initial step. For this, the user's name and ID are transferred as well as further optional information such as his age or zip code, for example. Please note: The more information we receive from you, the more targeted our advertising can be. Thus, your earnings from the Revenue Share program will increase accordingly. The next step is to embed a JavaScript file. This is necessary in order to inform the user immediately, when he gets a chat invitation (the so-called "Chat Watcher"). In addition, a JavaScript file is embedded to enable the start of a new chat.

Attention:
The following script must be placed on each page of your community, if the user is logged in. The user can only be informed about new chat invitations, if the following script is embedded. This script must be inserted into the end of the <BODY> area of your source code:

<?PHP
//script for the <BODY> area of your source code, transferring necessary user data
//place this script on every page if the user is logged in !!!


$tk_name = "THE_USERNAME"; //<-- please set the username here
$tk_user_id = "THE_USER_ID"; //<-- please set the user ID here
$tk_gender = ""; //<-- optional (the gender of the user can be female or 'male')
$tk_age = ""; //<-- optional (the age of the user e.g. '23')
$tk_single = ""; //<-- optional (is the user single? 'Yes', 'no', '0' = no information)
$tk_profile_url = ""; //<-- optional (url to the users profile)
$tk_pic = ""; //<-- optional (url of the users picture)
$tk_city = ""; //<-- optional (city where the user is located, e.g. 'Berlin')
$tk_zip = ""; //<-- optional (users zip code, e.g. '92553')
$tk_country = ""; //<-- optional (country where the user is located, e.g. 'Germany')

//DO NOT EDIT THE FOLLOWING CODE!
$tk_user_data="name:".$tk_name. ";gender:".$tk_gender. ";age:".$tk_age. ";single:".$tk_single. ";url:".$tk_profile_url. ";pic:".$tk_pic. ";city:".$tk_city. ";tk_zip:".$tk_zip. ";country:".$tk_country;


//implements the js needed by the chatWatcher and to start a chat

$tk_hash = md5($tk_user_id.$tk_user_data."[[password]]");
$tk_js = "<script type='text/javascript' src='http://www.toksta.com/js/w/?tk_hash=" . $tk_hash . "&app_id=[[application_id]]&app_user_id=".$tk_user_id."&tk_user_data=".rawurlencode($tk_user_data)."'></script>" . "<script type='text/javascript' src='http://www.toksta.com/js/tokstaIm/?tk_hash=" . $tk_hash . "&app_id=[[application_id]]&app_user_id=".$tk_user_id."&tk_user_data=".rawurlencode($tk_user_data)."'></script>";
echo $tk_js;
?>


2. step: Implementation of the "Start the chat" link in the <BODY> area

In order to send a chat invtation to a user, you have to open the JavaScript function of the toksta* chat (along with the ID of the user you want to chat with).
The tokstaChat function was already intitialized in the area <BODY> (s. step 1). The link should be inserted into each place, from which it should be possible to start a chat from. (e.g. into the user profile or into the friends list).


<?php
$tk_chat_to_user_id = "PROFILE_USER_ID"; //Replace with user ID
$tk_link = "<a href=\"javascript:tokstaChat('" . $tk_chat_to_user_id . "')\">Chatten</a>";
echo $tk_link;
?>


Congratulations! Your toksta* messenger is now ready to use!