Besides the “normal” implementation code of toksta there are some ways to customize our product even more to your needs.
By default you can embed pictures in toksta by setting the variable $tk_profile_url in the implementation script. When doing this, we will scale the picture to the needed size and show it in the Instant Messenger. Due to the fact that there would be thousands of pictures waiting to be scaled at our servers we will only scale pictures of active users and the scaling is done with some delay.
To prevent this behaviour and embed the pictures directly from your server you can modify your implementation script like this:
Very important: The image size must be 61 x 46px (width x height).
1. Look for this line in your implementation script:
[...]
$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.";
[...]
2. Now add this to the end of the line containing the url of the user
";direct_pic:http://www.the-url-to-your-picture/pic.jpg";
The final Script should look like this:
<?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.";direct_pic:http://www.the-url-to-your-picture/pic.jpg";
//implements the js needed by the chatWatcher and to start a chat
$tk_hash = md5($tk_user_id.$tk_user_data."[[your password]]");
$tk_js = "<script type=’text/javascript’ src=’http://www.toksta.com/js/w/?tk_hash=" . $tk_hash . "&app_id=8&app_user_id=".$tk_user_id."&tk_user_data=".rawurlencode($tk_user_data)."’></script>";
echo $tk_js;
?>
Thats’s it already!
PS: DO NOT USE THE SCRIPT ABOVE - THIS IS ONLY A DUMMY!
Tags: new features, new release