Wants to show website users online or offline programatically via api or some class

Last post 08-03-2010, 2:17 AM by Kenneth. 1 replies.
Sort Posts: Previous Next
  •  08-02-2010, 4:53 AM 62925

    Wants to show website users online or offline programatically via api or some class

    hi,
    I have integrated cute chat and ektron cms via cute chat integration Package.
    Now i want to show Website user online or offline . please help me out.
     
    And if user is online on click of image  of that user,another user  must be able to chat with that user(send message functionality must get implemented).
     
    please ,share knowledge as soon as possible
  •  08-03-2010, 2:17 AM 62993 in reply to 62925

    Re: Wants to show website users online or offline programatically via api or some class

    Hi Marium,
     
    1. How to know user is online or not
     
    Please try the code below
     
    1. protected override void OnLoad(EventArgs e)   
    2. {   
    3.     CuteChat.ChatPortal portal = CuteChat.AppSystem.Instance.GetCurrentPortal();   
    4.     lock (portal)   
    5.     {   
    6.         if (portal.IsMessengerStarted)   
    7.         {   
    8.             //get all users who already open cute messenger   
    9.             CuteChat.ChatPlaceUser[] users = portal.Messenger.GetAllUsers();   
    10.             foreach (CuteChat.ChatPlaceUser user in users)   
    11.             {   
    12.                 //if user!=null,it mean that user is online   
    13.                 if (user != null)   
    14.                 {   
    15.                     label1.Text += user.DisplayName;   
    16.                 }   
    17.             }   
    18.   
    19.         }   
    20.     }   
    21.     base.OnLoad(e);   
    22. }  

    2.  How to chat wiht someone directly (use some link or image)
     
     a. must add the code below in to the page
     
    <script src="CuteSoft_Client/CuteChat/IntegrationUtility.js.aspx?Chat_StartPartialMessenger=1"></script>
     
    b. The code below show you how to chat with the specified user. 'admin' is the name of the user who your want to chat.
     
     <a href="#" onclick="Chat_OpenContact('admin')">UniqueName='admin'</a>
     
    Regards,
     
    ken
View as RSS news feed in XML