See the other typing mod.

121 views
Skip to first unread message

Ingrid Sedé

unread,
Nov 29, 2014, 8:44:05 PM11/29/14
to
Hi there,

Did some working to get a mod that i had for my own situation suitable for the origanal standalone ajaxchat.

What it does is that it shows you a counter just like the messagelengthcounter near the BBcodecontainer. It shows when you click "Open Private Channel" under an username.
When the other does the same you can both see if the other is typing and what to expect. :-D

I have two files attached. One is a copy search and paste file and a php file.
Perhaps it's best to put the php file in a seperate dir under the root cause i had some trouble with permissions to the file when placing it in the class dir.
Be sure to change the path of the include to the configfile also!.
typingmod.txt
typemod.php

Chris D

unread,
Dec 2, 2014, 3:57:02 PM12/2/14
to
Thanks gonna try this one as for the life of me I can't get the other one to work, everything else is in place and SQL populates but no pop up or anything...

Will report back.


So Everything loads up however looking @ the console log I'm seeing this:

"TESTLOG charstyped NOT SEND" Whic is related to your error log in chat.js

This is in reference to ajax_chat_yourusername

Since I have no cookies that add that onto the ajax_chat cookie, should I remove the last part?

Ingrid Sedé

unread,
Dec 2, 2014, 9:00:02 PM12/2/14
to
Not sure if i understand you correctly.....
And it's not an error og but simply for me to check if it doesn't send post when not needed. I use it al the time when coding to be sure that things actually happen and i can see it in the logs.
What you see now is that a post is not send cause there's no value in the queryusername therefor a post is not needed an should not be send.
You can remove the console.log lines.

In the copy-paste file there's this piece of code for ajaxchat.php that has to do with setting a simple cookie for the username:

In AJAXChat.php look for:

		if(!$this->getRequestVar('ajax') && !headers_sent()) {
			// Set style cookie:
			$this->setStyle();
			// Set langCode cookie:
			$this->setLangCodeCookie();		
		}


and replace with this code:

		if(!$this->getRequestVar('ajax') && !headers_sent()) {
			// Set style cookie:
			$this->setStyle();
			// Set langCode cookie:
			$this->setLangCodeCookie();		
			$this->setUserNameCookie(); // ID:typeMod
		}


also in AJAXChat look for:

function setLangCodeCookie() {
		setcookie(
			$this->getConfig('sessionName').'_lang',
			$this->getLangCode(),
			time()+60*60*24*$this->getConfig('sessionCookieLifeTime'),
			$this->getConfig('sessionCookiePath'),
			$this->getConfig('sessionCookieDomain'),
			$this->getConfig('sessionCookieSecure')
		);
	}

and put this code directly underneath:

	//your userName written to cookie ID:typeMod
  function setUserNameCookie() {
		setcookie(
			$this->getConfig('sessionName').'_yourname',			
			$this->getRequestVar('userName'),
			time()+60*60*24*$this->getConfig('sessionCookieLifeTime'),
			$this->getConfig('sessionCookiePath'),
			$this->getConfig('sessionCookieDomain'),
			$this->getConfig('sessionCookieSecure')
		);
	}

Chris D

unread,
Dec 3, 2014, 3:43:12 PM12/3/14
to
In that case can you point me in a different direction of where I might look? I've loaded everything as you've stated, nothing is different. However nothing different happens when typing, unless I'm not supposed to be able to see it showing me typing? I can try with 2 accounts if so but other users haven't reported seeing anything so I'm stumped and console isn't throwing any other errors.


Looking for anything that appears and disappears via the elements bar.

Ingrid Sedé

unread,
Dec 5, 2014, 6:21:55 PM12/5/14
to ajax...@googlegroups.com
The way it should work is:

You click "Open private channel" underneath the username in the onlinelist.
If not allready there the counter should show nest to the BBcode container in the left-lower region.
If the other user is doing the same and starts typing it should be visible to you and vice versa.
The counter doesn't show you typing cause ypou can allready see that on the counter i'm taking the info off to submit to the online users DB.
Reply all
Reply to author
Forward
0 new messages