Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
+19 votes
5.5k views
in Plugins by
edited by

I've actually been using this on my site for a long time, but yerbol's post reminded me so I'm announcing it here. I took out the site-specific stuff and put it on Github here: https://github.com/svivian/q2a-chat-room

It's a pretty simple system - posted messages are stored in the database and the chat page shows the latest 80 messages. It polls for new messages automatically every 8 seconds.

Known issues

  • There is no customisation yet for things like polling frequency, number of messages displayed, nor idle time.
  • Messages are not deleted automtically. This means if you don't manually delete them from the database, the table will eventually get quite large (will take a while to get there, though).
  • Users must be registered and have their email confirmed to post (see the user_perms_post() fuinction to change this).
  • There is no spam control yet (besides banning users from the site entirely).

I am going to add options for all of the above, though.

Anyway, let me know what you think!

by
That is great, thanks scott
by
May be I missed this conversation but Million thanks..! you saved my time and effort :) I was about to start to built it. Just yesterday I have planed :)..I will sure have a look it.
by
Installed the plugin but on adding a link to it by going to Admin > Pages after I setting up database tables, its showing this error and link isn't getting added  ---->

Question2Answer query failed:

INSERT INTO qa_pages (title, nav, flags, permit, tags, heading, content, position) VALUES ('Chat Room', '', 1, 40, 'chat', NULL, NULL, 7)

Error 1062: Duplicate entry 'chat' for key 'tags'

What is this problem ? How can I rectify it ?
by
problem solved.. i had zoho chat enabled whose url name was the same as this chat plugin.. Thats why it was showing this error..
by
Many many thanks Scott. Definitely I am going to add this. This is exactly what I was looking for. Also, looking forward, if anyone could integrate Opentok video chat via their API. PLEASE :)
by
Thanks - added to the 'Add-Ons' page. If you made anything else that's not listed, please let me know!
by
Thanks Gideon. It looks like you don't have my Edit History plugin listed. I just fixed up a few issues with it so it's pretty stable now: https://github.com/svivian/q2a-edit-history
by
Added that one as well - thanks.
by
Can I create two chat rooms on single q2a site using this plugin. If can pls tell me the procedure.
by
@rgd no, not easily anyway.
You could duplicate the plugin to a different folder, but then you need to change a lot of variables like the table the messages are stored in.
by
Thank you very much. I will adjust existing chat room according to my requirements.
by
edited by
I installed is successfully but when I added a link of it on my q2a website and when it is clicked it says 403 access denied.
What to do ?
by
i am trying to use this plugin with 1.6 but whenever i submit a text to chat, a new page opens up with json data. Am i missing something. Thanks
by
@jaipster sounds like an issue with the javascript. What browser are you using? Do you see any errors in the javascript/devtools console?
by
I think the issue is here on the REQUIRE here https://github.com/svivian/q2a-chat-room/commit/bccb7988de92cc3adec618887aa83ccdfbf3af52

I haven't made my mind whether checking for the q2a version, in order to decide what path to require, is overkill or not. So far I'm using the old school way.
by
@pupi1985 Wouldn't the require prevent the chat page from loading at all?
by
The requiere is fine. The path is the issue. I mean, that commit is breaking backwards compatibility with Q2A < 1.7 and @jaipster said "i am trying to use this plugin with 1.6 ". That's why I mentioned I'm not sure whether checking for the Q2A version (dynamically) to decide which path to include is the right way or not. It is the best in terms of compatibility, though.
by
If a file doesn't exist then require_once causes a fatal error. But from jaipster's description the initial chat page is loading...

As for compatibility, you can use the old path for now until most users have upgraded to 1.7. Or set the min q2a version to 1.7 for the latest version (and link to the old version for 1.6).

@jaipster if you are still having issues please try the 1.6 version from here: https://github.com/svivian/q2a-chat-room/releases
by
Hi,
I installed this plugin as you said
posted messages are stored in the database and the chat page shows the latest 80 messages.
Msgs are stoted in db but chat page is not shown at all i can not see chat list
Can anyone help what can be reason?
by
hy ..do you want update this plugin? i like to have edit post in chat, option to remove chat messags, or a specific post id, and pagination for history chat post, or infinite scroll ... and smilies :D
by
how can disable email confirmation for chat?

4 Answers

0 votes
by
Thank you! This plugin really works! I'll look forward to updates!
+2 votes
by
edited by

to make it more visual:

screenshot

 

Even if I am not a fan of online chats (because of abuse), thanks Scott!

PS: Would be nice to get some more arguments why to use a chat :)

 

by
Thanks for posting the screenshot. However, I would prefer that people don't register for my site just to spam the chat room.
by
true :) good you removed that.
+1 vote
by

I am using latest version of q&a ( 1.5.3)

but receiving the same 'there was a server error'...

yes, this because of the same code error:

' "Fatal error:  Call to undefined function  qa_block_words_replace() in /home/backlogs/question/qa-plugin/chat/qa-chat.php on line 332".'

now how could i solve it?

by
OK I just made a change that should fix this: https://github.com/svivian/q2a-chat-room

Or you can simply add this line before the call to qa_block_words_replace:
require_once QA_INCLUDE_DIR.'qa-util-string.php';
by
Excellent! problem solved!
0 votes
by
I installed the plugin. It is working fine (1.6.3). Great work. Thank You.
by
Totally agree, the chat plugin and the edit history plugin, both are Scott's best q2a plugins!
by
My theme makes Widget Every Where not to work and now I have no Advert placement for the Chat Room page. I need help with adding the ad code directly to the plugin files if possible. It will be a responsive Adsense ad. I have done thing on the question page but have no success modifying the plugin's files. Thanks
...