Re: Who is in Chat

  •  10-06-2006, 10:42 PM

    Re: Who is in Chat

    Nick,
     
    Please follow the steps below:
     
    1. Open Skin-WhoIsOnline.ascx file and copy/paste the following code at the top section:
     
    <%@ Import Namespace="CuteSoft.Chat" %>
     
    2. Copy/Paste the following code into Skin-WhoIsOnline.ascx.
     

    <script runat="server">

     

    private void Page_Load(object sender, System.EventArgs e)

    {

       if (! this.IsPostBack)

       {

          String sOnlineChater = "";

          int len=0;

          foreach(CuteChatLobby lobby in ChatApi.GetLobbyArray())

          {

             if(lobby.IsHidden)

                continue;

             foreach(CuteChatClient chater in ChatApi.GetLobbyClientArray(lobby.LobbyId))

             {

                if(chater.ActiveTime > DateTime.Now-TimeSpan.FromSeconds(30) )

                {

                   sOnlineChater += chater.DisplayName + " ";

                   len++;

                }

             }

          }

          lblOnlineCount.Text = len.ToString();

          if(len>0)

             lblOnlineChater.Text = " (" + sOnlineChater + ")";

       }

    }

    </script>

    3. Copy/paste the following code after UsersOnline Repeater:
     
     <br /><br />
       There are <asp:Label ID="lblOnlineCount" Runat="server"></asp:Label> users chatting<asp:Label ID="lblOnlineChater" Runat="server"></asp:Label>.


     

    asp.net Chat http://cutesoft.net/ASP.NET+Chat/default.aspx
    Web Messenger: http://cutesoft.net/Web-Messenger/default.aspx
    asp.net wysiwyg editor: http://cutesoft.net/ASP.NET+WYSIWYG+Editor/default.aspx
    asp wysiwyg html editor: http://cutesoft.net/ASP
    asp.net Image Gallery: http://cutesoft.net/ASP.NET+Image+Gallery/default.aspx
    Live Support: http://cutesoft.net/live-support/default.aspx

View Complete Thread