Chat Control

This is a forum to suggest new features for mojoPortal. 

This thread is closed to new posts. You must sign in to post in the forums.
1/18/2009 5:54:51 PM
Gravatar
Total Posts 118

Chat Control

I am just putting together a site for a Girl Guide group and a chat control would be really nice

 

Neil

1/19/2009 5:26:39 AM
Gravatar
Total Posts 18439

Re: Chat Control

I've had my eye on possibly integrating meebo at some point, but my guess is someone could easily use it from within an html module using source view in the editor to put in any markuup or javascript needed. It might also require adding some javascript into layout.master. I really haven't read up on it yet but documentation is here. It looks easier than anything else I know of other than perhaps commercial products.

Also woopra is possibly worth looking at. Its primarily a traffic analytics tool but it has a click to chat feature as well. I've never used it, its free to sign up but then its a waiting list until the approve you. I signed up several weeks ago and still no approval for me. Probably their chat is more customer service oriented. For your scenario the meebo rooms seems like what you would want.

Best,

Joe

1/19/2009 6:11:34 AM
Gravatar
Total Posts 118

Re: Chat Control

I was thinking of something a little simpler and limited to people currently loged into the website - something such as

http://steveorr.net/articles/WebChat.aspx

Neil

1/19/2009 6:28:33 AM
Gravatar
Total Posts 18439

Re: Chat Control

Thats pretty interesting. You may be able to get that to work by putting the dll in the /bin folder and creating a simple module and put the webchat control inside it. Probably would need to add this at the top

<%@ Register Assembly="ChatControl" Namespace="ChatControl" TagPrefix="cc1" %>

and then this in the body of the control

<cc1:WebChat ID="WebChat2" runat="server" CallBackInterval="4" ChatTopic="Cooking" HistoryCapacity="20" Height="245px" Width="490px" />

obviously with your own topic.

Probably would want something like this in page load:

if(Request.IsAuthenticated)
{
WebChat2.UserName = User.Identity.Name;
}
else
{
WebChat1.Visible = false;
}

The only thing I don't like about this control is it stores the messages in memory on the server via application variables. This means the chats are not persisted permanently anywhere and it may use more memory than I would like. Possibly at some point I can extend this to use a database.

Best,

Joe

1/19/2009 6:41:18 AM
Gravatar
Total Posts 118

Re: Chat Control

i will have a play - interestingly this is the control ( but re-written ) thats used as the chat module for DNN

 

Neil

1/19/2009 6:44:49 AM
Gravatar
Total Posts 18439

Re: Chat Control

Wonder what re-written means, did they just wrap it in a module or did they implement a database layer for it?

In any case it looks like a good start for a chat feature, thanks for sharing the link.

Best,

Joe

1/19/2009 7:04:03 AM
Gravatar
Total Posts 118

Re: Chat Control

1/19/2009 8:32:21 AM
Gravatar
Total Posts 118

Re: Chat Control

that almost works - I get

CS0103: The name 'User' does not exist in the current context

on the line

WebChat2.UserName = User.Identity.Name;

presumably I need to do something so User.Identity.Name is available from within the module ?

 

Neil

 

1/19/2009 8:36:14 AM
Gravatar
Total Posts 18439

Re: Chat Control

Try HttpContext.Current.User.Identity.Name

Hope it helps,

Joe

1/19/2009 9:23:50 AM
Gravatar
Total Posts 118

Re: Chat Control

Works a treat - thanks Joe

10/8/2010 2:29:45 PM
Gravatar
Total Posts 76

Re: Chat Control

Hello Joe / Neilc,

So how is the module written?

I have this. When i put the control on my website nothing is shown? Any help?

 

<%@ Control Language="C#" ClassName="ChatControl.ascx" %>

<%@ Register Assembly="ChatControl" Namespace="ChatControl" TagPrefix="cc1" %>


<script runat="server">

protected void Page_Load(object sender, EventArgs e)
{

if (Request.IsAuthenticated)
{
WebChat2.UserName = HttpContext.Current.User.Identity.Name;
}
else
{
WebChat2.Visible = false;
}

}

</script>


<cc1:WebChat ID="WebChat2" runat="server" CallBackInterval="4" ChatTopic="Cooking" HistoryCapacity="20" Height="245px" Width="490px" />

 

 

THNX..........
 

10/8/2010 3:02:11 PM
Gravatar
Total Posts 76

Re: Chat Control

Hello,

Solved it. Removed the line "WebChat2.Visible = false;"

Is it possible to make it that only people who are logged in are able to chat?
 

9/9/2011 4:39:03 AM
Gravatar
Total Posts 76

Re: Chat Control

Hello,

I put this code in my custom feature:

protected void Page_Load(object sender, EventArgs e)
        {
           
            if (!IsPostBack)
            {
                ChatcontrolZien.Visible = true;

                if (Request.IsAuthenticated)
                {
                    WebChat2.UserName = HttpContext.Current.User.Identity.Name;
                }
                else
                {
                    WebChat2.Visible = false;
                }
            }

            LoadSettings();
            PopulateLabels();
            PopulateControls();

        }

This code worked fine in a custom module but i now implemented it as a custom feature.

The problem now is that when i login everything goes well except that when i type text the text doesn't display, only when i leave the page and re-enter the page than i can type text and it gets shown.

Don't know where to look for the solution, tried refreshing page, no luck.

Any help?! Thnx

9/9/2011 9:27:06 AM
Gravatar
Total Posts 18439

Re: Chat Control

Hi Hanzie,

If your chat control does postback then you probably need to move this code:

if (Request.IsAuthenticated)
                {
                    WebChat2.UserName = HttpContext.Current.User.Identity.Name;
                }
                else
                {
                    WebChat2.Visible = false;
                }

so that it is not inside a check for IsPostback because it needs to set that also on postbacks

I don't know what you mean by it works for custom module but not for custom feature, those are the same thing to me.

The best thing to do is to set breakpoints in your code and step through it to find out if things are happening as you expect them or not.

Hope that helps,

Joe

9/15/2011 11:57:02 AM
Gravatar
Total Posts 76

Re: Chat Control

Hello Joe,

I see now there is no problem! When i upload the feature everything works fine.


 

THNX

You must sign in to post in the forums. This thread is closed to new posts.