News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu

AjaxChat Integration (latest version 3.2.1)

Started by .HuNTeR., August 27, 2008, 12:59:06 AM

Previous topic - Next topic

ErnieB

Anyone know a way to change the refresh rate of the chat? Maybe make it so the user has to click to refresh?

My host continues to take the script down because its using too much resouces.

tripl3r

I get extra character come up when I type things in the chat... say when i type ' it will come up as \'
how can i fix this issue?

LC

Quote from: tripl3r on January 04, 2010, 09:05:37 PM
I get extra character come up when I type things in the chat... say when i type ' it will come up as \'
how can i fix this issue?
From the AjaxChat Wiki:

This bug appears to occur when PHP's magic_quotes_gpc is set to off in your server configuration.
You can fix this by changing the following line in AJAXChat.php:
Find:
if(get_magic_quotes_gpc()) {
Replace:
if(true) {

LC

Quote from: Oceander on January 04, 2010, 01:36:14 PM
Ok, so I've perused the thread, and gone to the Wiki, and generally searched on the error I'm getting and have found nothing other than one opaque reference to it.

I have SMF 1.1.11 with no relevant modifications.  I'm serving it out of Apache 2.2.14, running on WinXP Pro, SP3, with PHP 5.3.0 and MySQL 5.0.5

When I install AjaxChat everything seems to work just fine, until I try to actually "shout" something or "chat" something, at which point I get this error:
QuoteChatBot: Error: Connection status: 404

I've tried to see what, exactly, it's not finding when I'm hitting the "shout" button, but to no avail.  The error logs for my webserver have entries that appear to correspond to my hitting those buttons, and they each look more or less like this:
QuoteAttempt to serve directory: <server-root>/<my-forum>/shoutBox/, referer: http://<my-domain>/<my-forum>/index.php

Any elucidation on what I'm doing wrong, or what I'm missing, would be greatly appreciated!


EDIT:  Some more (hopefully) useful info:  If I just do a simple "GET" action to url: http://<my-domain>/<my-forum>/shoutBox/
I get the standard Apache index served back, and the server logs reflect a successful response, with nothing in the error logs.  I receive the same successful response if I do a simple "GET" action to url: http://<my-domain>/<my-forum>/shoutBox/?ajax=true&shoutbox=true
that is, I get the standard Apache index page served back at me.

So, is it possible that there is some missing/erroneous data going through when the POST method is used that could be causing a 404 status code error?
From the AjaxChat Support Forums by Frug:

http://sourceforge.net/projects/ajax-chat/forums/forum/774132/topic/3251680?message=7423805


LC

Quote from: ErnieB on January 04, 2010, 08:58:38 PM
Anyone know a way to change the refresh rate of the chat? Maybe make it so the user has to click to refresh?

My host continues to take the script down because its using too much resouces.
From AjaxChat Support Forums by Frug:
http://sourceforge.net/projects/ajax-chat/forums/forum/774132/topic/3060284?message=6601490

Also from Frug:
To make things clear: HTTP is not the ideal protocol for a Chat.
If you want to have a real chat server you should go for IRC or Jabber.
While not overcoming the limitations of a stateless protocol, the AJAX technology at least made it possible to implement a web chat that does not bring down the server.
This AJAX Chat is implemented to be as resource efficient as possible:
The operations the server has to do are not complex, the queries to the database held simple
Most of the work is done on client side: The language handling, the BBCode, Hyperlinks, Emoticons and Commands replacement is all done by JavaScript.
Only updated data is sent to the clients to keep the traffic low.

Source: http://sourceforge.net/apps/mediawiki/ajax-chat/index.php?title=Server_load

ErnieB

Thanks a TON LC. i searched and couldnt find anything.... Would you happen to know what this line of code does exactly if you change it to false.....

// If set to false the chat update is delayed until the event defined in ajaxChat.setStartChatHandler():
   startChatOnLoad: true,

tripl3r


tripl3r

OK sorry for the noob questions but how can I set the chat to view only one theme and default that theme so everyone uses only that theme... also where can i customise that theme?
Also is there a way to show only 2 rooms. I want public and private that is all... thanks in advance.

Chair

I have three questions:

1. How do I change the colour of the shoutbox?
2. Is there a way I can make it display underneath a portal block?
3. How can I make it display on certain pages only?


Oceander

Quote from: LC on January 04, 2010, 10:39:33 PM
Quote from: Oceander on January 04, 2010, 01:36:14 PM
Ok, so I've perused the thread, and gone to the Wiki, and generally searched on the error I'm getting and have found nothing other than one opaque reference to it.

I have SMF 1.1.11 with no relevant modifications.  I'm serving it out of Apache 2.2.14, running on WinXP Pro, SP3, with PHP 5.3.0 and MySQL 5.0.5

When I install AjaxChat everything seems to work just fine, until I try to actually "shout" something or "chat" something, at which point I get this error:
QuoteChatBot: Error: Connection status: 404

I've tried to see what, exactly, it's not finding when I'm hitting the "shout" button, but to no avail.  The error logs for my webserver have entries that appear to correspond to my hitting those buttons, and they each look more or less like this:
QuoteAttempt to serve directory: <server-root>/<my-forum>/shoutBox/, referer: http://<my-domain>/<my-forum>/index.php

Any elucidation on what I'm doing wrong, or what I'm missing, would be greatly appreciated!


EDIT:  Some more (hopefully) useful info:  If I just do a simple "GET" action to url: http://<my-domain>/<my-forum>/shoutBox/
I get the standard Apache index served back, and the server logs reflect a successful response, with nothing in the error logs.  I receive the same successful response if I do a simple "GET" action to url: http://<my-domain>/<my-forum>/shoutBox/?ajax=true&shoutbox=true
that is, I get the standard Apache index page served back at me.

So, is it possible that there is some missing/erroneous data going through when the POST method is used that could be causing a 404 status code error?
From the AjaxChat Support Forums by Frug:

http://sourceforge.net/projects/ajax-chat/forums/forum/774132/topic/3251680?message=7423805

As I am a novice, and quite thick-headed to boot, would you be so kind as to point out for me where the solution (or guidance) as to my problem lies in the text of the message you linked to, which I quote as follows:
QuoteI think looking for issues with your router is a red herring. The chat requests are handled on the same port using the same protocol as regular http traffic so if you can see the page, chat data (which is passed as xml) will be going through just fine.

I have it running on a server with a similar setup with no problems. And I reinstalled it recently from scratch.

Why do you need a .htaccess file with your setup?

"If I am not logged in it will request me to login, which I do, it authenticates me, then it gives me an index of the /chat directory. When I click on index.php chat I again have no one online in the online users area and get the 404 error."

There's definitely something wrong with your server setup then. I don't know why it's listing directory contents.

Also you can't get authenticated with the login page if you have an integrated version. You're supposed to log in via the forum, and only guest logins are possible from the chat login screen (the password field should not be there and I'll remove it one of these days probably).

Again, as I am quite the dunderhead, your elucidation would be most welcome.

Oceander

Regrettably, that cannot be the source of the problem, as this is on an insulated test server and I generally run with extremely liberal permissions on the relevant files (but, to be sure, I verified that all permissions are the same across all of the files, both old and new).

Quote from: ErnieB on January 04, 2010, 08:56:05 PM
Have you changed the permissions for the /chat/index.php and the /shoutbox/index.php to 755?


Quote from: Oceander on January 04, 2010, 01:36:14 PM
Ok, so I've perused the thread, and gone to the Wiki, and generally searched on the error I'm getting and have found nothing other than one opaque reference to it.

I have SMF 1.1.11 with no relevant modifications.  I'm serving it out of Apache 2.2.14, running on WinXP Pro, SP3, with PHP 5.3.0 and MySQL 5.0.5

When I install AjaxChat everything seems to work just fine, until I try to actually "shout" something or "chat" something, at which point I get this error:
QuoteChatBot: Error: Connection status: 404

I've tried to see what, exactly, it's not finding when I'm hitting the "shout" button, but to no avail.  The error logs for my webserver have entries that appear to correspond to my hitting those buttons, and they each look more or less like this:
QuoteAttempt to serve directory: <server-root>/<my-forum>/shoutBox/, referer: http://<my-domain>/<my-forum>/index.php

Any elucidation on what I'm doing wrong, or what I'm missing, would be greatly appreciated!


EDIT:  Some more (hopefully) useful info:  If I just do a simple "GET" action to url: http://<my-domain>/<my-forum>/shoutBox/
I get the standard Apache index served back, and the server logs reflect a successful response, with nothing in the error logs.  I receive the same successful response if I do a simple "GET" action to url: http://<my-domain>/<my-forum>/shoutBox/?ajax=true&shoutbox=true
that is, I get the standard Apache index page served back at me.

So, is it possible that there is some missing/erroneous data going through when the POST method is used that could be causing a 404 status code error?

Oceander

Quote from: ErnieB on January 04, 2010, 08:56:05 PM
Have you changed the permissions for the /chat/index.php and the /shoutbox/index.php to 755?


Quote from: LC on January 04, 2010, 10:39:33 PM

From the AjaxChat Support Forums by Frug:

http://sourceforge.net/projects/ajax-chat/forums/forum/774132/topic/3251680?message=7423805



My thanks to both of you for taking the time to consider my problem.  While reflecting on your kind answers, I went back and looked at the packet captures I had made and realized that my problem - and my answer - were literally staring me in the face.  As I have said before, I am quite the novice, so I apologize if this seems trivial or trite to anyone else.

My problem, in a nutshell, was forgetting that, when Apache (my server) is confronted with a naked directory request - that is, a url that does not specifically name the document file to be served up - it will "helpfully" serve up a listing of the directory requested, and further, if the DirectoryIndex directive is set, will serve up only the file named therein as the index file.

Why was that my problem?  Because, the DirectoryIndex directive is tucked into the default httpd.conf file and specifies that only files named "index.html" are to be served up as directory indexes.  That presents a problem because when the "Shout" button on the shoutbox is clicked, it sends an HTTP POST request with a url that ends as follows: "/shoutBox/?ajax=true&shoutbox=true" (or "/chat/?ajax=true&shoutbox=true" if chat is integrated with shout - apparently).

The clue here is that this url really represents two components (as all of you know, just please bear with me as I just lo-o-o-ve to hear the sound of my keyboard clicking  ;D ), the relative path of the document requested, and an attached query string that follows the "?".  Thus, in the case above, the effect of the HTTP POST request is to ask that the "document" /shoutBox/ be served up, and to provide a query string containing "ajax=true&shoutbox=true" which Apache will interpret as a request for the index of the /shoutBox/ directory (which may, or may not involve the query string).  In my case, because I had not changed the default httpd.conf DirectoryIndex directive, that meant that the poor old Apache server was vainly looking for this document: "/shoutBox/index.html" and, when it couldn't find it - logically enough - it sent back the 404 error.

The fix, as is probably blindingly obvious to the rest of you, was to simply specify that, for all of my forum-related directories, Apache should serve the document "index.php" in response to any requests for a directory index.  That I did, and I am now happily chatting/shouting away to myself on my little testbed forum.

So, to sum up for posterity, and to provide some grist for the search mill for future newbies with the same problem (and you know they will be here, sooner or later), I state for the record:

If you're getting a 404 Status Code from your webserver when you try to use the chat or shoutbox function, double-check to make sure that your webserver is set up to serve the document "index.php" in response to any directory index requests, which would include a GET or POST request for a url that ends with a directory only and does not specify any particular document file.

How's that sound?

Again, thank you for your patience and your willingness to entertain my questions.

Regards to all, particularly ErnieB and LC,

Oceander

Oceander

LC,

Thank you very much for this pointer; after I got my "big" problem solved, this one cropped up, but thanks to you, I got it solved in less than 5 minutes!

-Oceander

Quote from: LC on January 04, 2010, 10:32:49 PM
Quote from: tripl3r on January 04, 2010, 09:05:37 PM
I get extra character come up when I type things in the chat... say when i type ' it will come up as \'
how can i fix this issue?
From the AjaxChat Wiki:

This bug appears to occur when PHP's magic_quotes_gpc is set to off in your server configuration.
You can fix this by changing the following line in AJAXChat.php:
Find:
if(get_magic_quotes_gpc()) {
Replace:
if(true) {

Oceander

Quote from: ErnieB on January 04, 2010, 08:58:38 PM
Anyone know a way to change the refresh rate of the chat? Maybe make it so the user has to click to refresh?

My host continues to take the script down because its using too much resouces.

Have you tried changing the value of the variable TimerRate in the file config.js?

The 14th and 15th lines of text in that file should read as follows: // The time in ms between update calls to retrieve new chat messages:
timerRate: 2000,


which would appear to cause the chat (and the shoutbox as well) to refresh themselves every 2 seconds.  As a very simple quickie fix, you could try increasing that value, e.g., to 4000 (4 seconds), to see if that sufficiently reduces the load on your server without ruining the experience of your users.

Oceander

Quote from: ErnieB on January 05, 2010, 01:50:16 AM
Thanks a TON LC. i searched and couldnt find anything.... Would you happen to know what this line of code does exactly if you change it to false.....

// If set to false the chat update is delayed until the event defined in ajaxChat.setStartChatHandler():
   startChatOnLoad: true,

I just tried playing around with that value, and it didn't seem to reduce the amount of updating once chat was started.

mikeach

I just installed this mod on a Win2k Advanced server using SMF 1.1.11.  I had to uninstall the GoogleBot and Spiders mod first due to an error, but it tested/installed fine after that and I then reinstalled the GoogleBot mod.

When I click on the chat button I get a login page, after logging in I get a 405 error.  I've checked IIS and index.php is the default document, and when going to the forum it always comes up fine.  If I add in the index.php to the url the chat opens but then I get the Error: Connection status: 405 when trying to chat.  Guess I'm lost, I just don't understand why this would happen with index.php being the default document on the site, I even check the folder to make sure that it was the default there also.

Oceander

Quote from: mikeach on January 05, 2010, 05:30:07 PM
I just installed this mod on a Win2k Advanced server using SMF 1.1.11.  I had to uninstall the GoogleBot and Spiders mod first due to an error, but it tested/installed fine after that and I then reinstalled the GoogleBot mod.

When I click on the chat button I get a login page, after logging in I get a 405 error.  I've checked IIS and index.php is the default document, and when going to the forum it always comes up fine.  If I add in the index.php to the url the chat opens but then I get the Error: Connection status: 405 when trying to chat.  Guess I'm lost, I just don't understand why this would happen with index.php being the default document on the site, I even check the folder to make sure that it was the default there also.

Well, the first thing to note is that the error you're getting - 405 - is not the same as the error that arises when the server cannot find the document you requested (as in my problem).  A 405 status code means that the document you requested is there, but that your browser used the wrong HTTP method to ask for it.  For example, using the POST method is generally not allowed for a static html page.

In your case, since the initial "chat" request is sent using the POST method (because you clicked on a button to submit form data), it's a good bet that for some reason your server has decided that your index.php document is not a document that can be handled using the POST method.

First I would check to see if the php engine has the proper permissions to use the directories you have for the chat/shoutbox stuff - if the index.php document is not in one of the directories the php engine can access, then it's possible that the server just sees the document as a "static html document" and thus ineligible for the POST method.

Beyond that, I don't know your particular server, so I don't know if you can restrict the use of the various HTTP methods, but that would be another thing to check into.

Zirc

Okay i'm gonna post this here first and see if anybody has any ideas before looking elsewhere.
I have AjaxChat Integration 3.2.1, SMF 1.1.10 and SimplePortal 2.3.1 and am looking for some sort of custom code I guess.

What I would like to do is display in the Who's Online block of SimplePortal (chatting) next to a users name if they are in AjaxChat.  I think this should be fairly simple but since my php knowledge is limited I can't figure out the code.  I imagine all it needs to do is get the UserID for the person online and then query the ajaxchat_online table to see if they are the same then output the text (chatting) and if the UserID is not in ajaxchat_online it would not display anything.  Seems pretty straightforward but i'm not sure how to go about it.

Any help would be great! Thanks

LC

Quote from: Zirc on January 06, 2010, 12:50:09 PM
Okay i'm gonna post this here first and see if anybody has any ideas before looking elsewhere.
I have AjaxChat Integration 3.2.1, SMF 1.1.10 and SimplePortal 2.3.1 and am looking for some sort of custom code I guess.

What I would like to do is display in the Who's Online block of SimplePortal (chatting) next to a users name if they are in AjaxChat.  I think this should be fairly simple but since my php knowledge is limited I can't figure out the code.  I imagine all it needs to do is get the UserID for the person online and then query the ajaxchat_online table to see if they are the same then output the text (chatting) and if the UserID is not in ajaxchat_online it would not display anything.  Seems pretty straightforward but i'm not sure how to go about it.

Any help would be great! Thanks
You might get more help if you go here. http://simpleportal.net/index.php?board=39.0

Also you should look into upgrading your forum, as there were security bugs found in 1.1.10

C_Murder



How i can fix that it wont show the messages 2 times?

Advertisement: