Chat module

Chat module

by Martin Dougiamas -
Number of replies: 25
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers
I'm starting a new discussion to bring all the other threads about a chat module together in one place. smile

Today I wasted an hour or so and did a very quick hack of phpopenchat 3 beta, which :

http://moodle.com/testchat

It's still very rough and simple. I'm not going to be working on it any more for a while, but I thought I'd put it up so you can play with it - test it on different browsers etc. If it breaks it's broken. wink
Average of ratings: -
In reply to Martin Dougiamas

Re: Chat module

by Charles Nulud -

Hi!

Can we download that hacked smile testchat of your so that, we can put it on our moodle for proper config and testing... ?


Thanks

In reply to Charles Nulud

Ray's Chatarea module

by Martin Dougiamas -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers
A much better hack is this module (attached) from Ray Kingdon, based on PhpMyChat. Excellent work, Ray! approve

I just tested it and it works well with 1.0.7 and MySQL ... just unzip it in your main Moodle folder - it will create a lang/en/chatarea.php file and a mod/chatarea folder (it contains a README). Then visit your admin page to install the new module.

I'm not including it in the main distribution just yet as it still needs a number of changes to be fully "moodle-ised", and as Ray says this module is "VERY experimental" but if you're keen to have a play with it - here you go!
In reply to Martin Dougiamas

Re: Ray's Chatarea module

by Jacob Romeyn -

The module seems to install Ok but when I try to "Chat"  the screen on top stays blank. Loggin i as an other user on an other computer shows the user is "online" but still no display of the "chatting"

 

When I clic on the place were it says Users(1)  I get:

 Database error: Link_ID == false, connect failed
MySQL error: 0 ()
Session halted.

 I have installed it on my main server and my test server with the same result on both

Any sugestions

In reply to Jacob Romeyn

Re: Ray's Chatarea module

by jean-marie baltimore -

Same thing happened to me ! I thought I had done something wrong but it might as well be a bug.

I also had to translate the language part in French in order to make a clean install . The only thing is the screen remains blank whatever you're trying to do. Otherwise, that's exactly what we need !

In reply to jean-marie baltimore

Re: Ray's Chatarea module

by Jacob Romeyn -
Yes it must be a bug. I installed it on a third server with exacly the same results
In reply to Jacob Romeyn

Re: Ray's Chatarea module

by Dr. Prin Singhanart -
I tried the chat module today and encountered exactly same problem

Warning: mysql_connect() [function.mysql-connect]: Access denied for user: 'www@localhost' (Using password: NO) in /home/www/xxxx/mod/chatarea/phpmychat/lib/database/mysql.lib.php on line 35
Database error: Link_ID == false, connect failed
MySQL error: 0 ()
Session halted.


did you manage to get it work?
In reply to Martin Dougiamas

Re: Chat module

by Barry Bell -
Good idea for the chat even though, I use my own hack at www.chess4us.dynu.com
In reply to Barry Bell

Re: Chat module

by Luciana Terceiro -

Hi, Barry

You own hack chat allow one chat room per course? I'm looking for a chat system that allows it, and that's the only thing I miss in Moodle!

thanks,

Lucy

In reply to Luciana Terceiro

Re: Chat module

by Barry Bell -
Yes your right I used to use vflash chat but now I use a chat system right off the main menu.
In reply to Barry Bell

Re: Chat module

by Jai cheswick -
Are you prepared to let others use your hack for a chat module ?

Cheers Jai
In reply to Martin Dougiamas

Re: Chat module

by Martin Dougiamas -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers
The chat I'm now interested in modifying is ARSC: http://manuel.kiessling.net/arsc/

It's fairly clean, fast and smooth, and supports every browser known.
In reply to Martin Dougiamas

Re: Chat module

by Jacob Romeyn -

Looks and works great. I installed and downloaded it. It seems to be very stable.

Are you going to intergrate this in to Moodle?

In reply to Jacob Romeyn

Re: Chat module

by Martin Dougiamas -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers
At some point, yes. I wish I could say tomorrow, but... I can say it'll be the next new module I'll work on.
In reply to Martin Dougiamas

Re: Chat module

by Fernando Jaruche Nunes -

Hi!

I would like to help you with the chat module with arsc.

I'm thinking that is a good idea to add MathML to make chats about mathematics easier.

What you think that?

In reply to Fernando Jaruche Nunes

Re: Chat module

by Martin Dougiamas -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers
MathML would be nice, but let's start with basic text first smile

If you want to help, a good first step would be to go through the code and replace all the MySQL-specific code in ARSC with equivalent calls using Moodle's database functions (lib/datalib.php). Also note that the returned variables will change from arrays to objects.

eg

$result = mysql_query("SELECT room, level from arsc_users WHERE user = '$userpassive'");
$a = mysql_fetch_array($result);
if ($a['room'] == $x) ..... etc
becomes (in the ancient Moodlish tongue)
$a = get_record("arsc_users", "user", $userpassive);
if ($a->room == $x) ..... etc
or to get multiple records:
$aa = get_records("arsc_users");
foreach ($aa as $a) { ...etc

Of course you'd also have to include moodle's "config.php" at the top of each file, just like all Moodle code.

If someone did that and sent me a modified copy of ARSC that works when stored as moodle/arsc, then it would be much easier for me to whip it into shape as a proper Moodle module.

In reply to Martin Dougiamas

Re: Chat module

by Przemyslaw Stencel -
I'm not a web programmer, but have heard that php chats are more demanding than java chats as far as server workload is concerned. Is this true?
In reply to Przemyslaw Stencel

Re: Chat module

by Martin Dougiamas -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers
The client-side is really separate from the server-side.

It's true that many simple chat programs do not scale well, because a process is run on the server for each user.

One of the main reasons I want to use ARSC is that it not only supports this simple method (which is great for smaller sites, and can be made to work out of the box without any special setup), but it also supports a non-forking daemon process (a single process that can support all the clients at once). This daemon process is good for larger sites - it will require a little more setup for the admin but will be vastly more efficient. This is all invisible to the teachers/students, as the client interface for both methods remains the same.

http://manuel.kiessling.net/projects/software/arsc/#what
In reply to Martin Dougiamas

Re: Chat module

by James Miller -
Is this in CVS? I got:

Fatal error: Cannot redeclare unixdate() in /home/httpd/moodle/testchat/include/adodb/adodb.inc.php on line 1387
In reply to Martin Dougiamas

Re: Chat module

by Esteban Moro -
Hi all.
I desperately need to put a chat module in my e-course with moodle. I have tried Ray's module but I keep on getting the annoying "could not get a new instance of chatarea". When loading the mysql.sql file by hand and changing the names of the tables to "mdl_*" I could create the chatarea, but then I got a blank page when I try to chat. Any help?

I am even considering to use an external (non-moodle module) chat software. In this regard, do you know a easy-to-use-and-install chat software and sever that I could install in my course. I am currently running moodle using mysql and Linux.

Any help would be appreciated.
In reply to Esteban Moro

Re: Chat module

by Martin Dougiamas -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers
Ray's module has not been ported to Moodle 1.0.8 - it works with Moodle 1.0.7 only.

Several people have offered to help with a new module based on ARSC but I've not heard back from them.

As for an external chat, you could try ARSC or phpMychat (see www.hotscripts.com).
In reply to Martin Dougiamas

Re: Chat module

by Martin Dougiamas -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers
I'm still quite keen on using ARSC as the base for the new chat module, which will definitely be in Moodle 1.1.

I've set up an example of plain ARSC in this course so we can have a play with it and get a feel for it (and perhaps find some problems before too much development time is wasted).

http://moodle.org/mod/resource/view.php?id=430

See you in there!
In reply to Martin Dougiamas

Re: Chat module

by John Gone -
Very cool! Right on Martin! Thanks
In reply to John Gone

Re: Chat module

by Art Lader -
It works great and it was a cinch to install. But on this site, it does not ask for a password, just a nickname. On my site, I can't seem to get it to stop asking for a password. I must be doing something wrong, I guess.
In reply to Art Lader

Re: Chat module

by Martin Dougiamas -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers
Hack the source, Luke! wink

Just edit that .php file and mess with the html. Passwords are optional - they can be left empty.
In reply to Martin Dougiamas

Re: Chat module

by Art Lader -
Then I guess I can just delete the row in the login form that contains the password field. Thanks, Martin. smile