Restrict IM for certain users

If you want to enable the Instant Messenger for certain users (e.g. paid/premium users) the following examples might be usefull for you.

Example 1: Only premium user are allowed to initiate a chat

If only premium users should be allowed to start a chat, then you can prevent non-premium users to start from chatting by hiding the chatbar (chatbar→hideAll:true) and hide the list of all online users in the instant messenger (im→hide[“searchMenu”]).

For NON-Premium (paid) users, use this implementation code:

<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", 
 
  //Example 1 adjustments
  chatbar: { 
   hideAll:true 
  }, 
  im: { 
   hide["searchMenu"] 
  } 
  //----
}; 
</script>

Example 2: Redirect free users when clicking a chat invitation

If you want your free users to sign up for a paying (premium) account in order to be able to chat with your premium users you can redirect them if they click on a chat invitation. This is a very good oportunity to generate new premium users and thus increase your revenues ;-)

We will hide the chatbar for all free users like we did in Example 1 and if a chat invitation will be accepted (chatbar→on_accept) the user will be redirected to the premium-upgrade page (in this example: http://www.your-domain.com/premium-signup.php).

You can also increase the conversion by passing the some data of the user who started the chat (on_accept→from_user_id, on_accept→from_user_data) and as a result show an individual sign up page.

Use this code for all free users:

<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", 
 
  //Example 2 adjustments
  chatbar: { 
   hideAll:true
   on_accept: function (from_user_id, from_user_data) {
     self.location.href = "http://www.your-domain.com/premium-signup.php";
   } 
  }, 
  im: { 
   hide["searchMenu"] 
  } 
  //----
}; 
</script>

Example 3: Only Premium users are allowed to chat

If only premium users should be allowed to chat to each other, simply only implement the stickapps.com implementation code for premium users.

 
restrict_the_instant_messenger_for_certain_users_e.g._paid_members.txt · Last modified: 2009/09/29 13:58 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