STYLETOOL
API

We have developed a StyleTool API, that makes it easy to implement in your website.

StyleTool Implementation

Simple implementation

To add the StyleTool to a public area of your website, you can use this code:

<object id="obj">
	<param id="par1" name="movie" value="http://robbienetworks.s3.amazonaws.com/avatarcreator.swf"></param>
	<param name="wmode" value="transparent"></param>
	<embed src = "http://robbienetworks.s3.amazonaws.com/avatarcreator.swf" type="application/x-shockwave-flash" wmode="transparent" width ="520" height="432">
	</embed>
</object>

This will add the StyleTool, which will request an email address to retrieve the users avatar. If the user allready has an avatar, the correct avatar will be retrieved when they enter their email address.

New users can try the StyleTool but when hitting SAVE they have to provide their email address to save the avatar. The email address is the key to identify the avatar.

Registering users

If you have a website that uses profiles or allows the user to login, you can supply the email address for the user to the StyleTool. This way the user does not have to enter his/her email address every time to retrieve their avatar. (Be aware that this is only for private pages, so public users can’t edit the avatar of other users.)

The first step to pass the email address is to register the email address in our database. This way, when the users email address is supplied to the StyleTool, that email address will be found in the database and the correct avatar is retrieved.

To register a new user, you can call the createUser function on our SOAP server. If you’re server does not have SOAP enabled, you can use our SOAP PHP class:

<?php require_once('http://www.whyrobbierocks.com/SimpleDB/soap.php'); ?>

Adding registered user email

Once you have registered the user in our database, you can pass the email address to the StyleTool.

To supply the email address for a user, you need to encode it first, using 3Des encryption. You can do this by including the encryption PHP class from our server:

<?php require_once('http://www.whyrobbierocks.com/SimpleDB/encryptEmail.php'); ?>

Then you create an instance of the encryption class:

<?php $Encrypt = new encryptEmail(); ?>

Then you can insert the users email address and encrypt it:

<?php $encryptedEmail = $Encrypt->encryptNET3DES('example@example.com'); ?>

When you have encrypted the email address, you can pass it to the StyleTool using FlashVars.

<object id="obj">
	<param id="par1" name="movie" value="http://robbienetworks.s3.amazonaws.com/avatarcreator.swf"></param>
	<param name="wmode" value="transparent"></param>
	<param name=FlashVars value="email=<?php echo $encryptedEmail; ?>">
	<embed src = "http://robbienetworks.s3.amazonaws.com/avatarcreator.swf" type="application/x-shockwave-flash" wmode="transparent" width ="520" height="432" FlashVars="email=<?php echo $encryptedEmail; ?>">
	</embed>
</object>

Have a look at our Facebook, iGoogle, Socializta or EEN StyleTools to get an idea. Below some screenshots.