Function improvements and removal patch
Fully customizable web chat created using AJAX.
Brought to you by:
frug,
madblueimp
Function improvements and removal patch
How does one use this patch? I would like to use the part where people can auto-login but I have no idea how to implement this.
Any response appreciated.
Hello,
it seems, that my patch file doesn't work because "patch" complains about an error in the file. So I uploaded my complete patched version of Ajax Chat at:
http://sourceforge.net/projects/dodger-tools/files/ajax_chat/ajax_chat-0.8.3.tar.bz2/download
For the automatic login, the lines in lib/class/AJAXChat.php after "//Automatically login, if password and user name are given via GET" are needed. With these lines you can assign the username and password in the URL.
E.g.: http://myServer/ajax/index.php?user=myuser&pass=mypass
Have fun,
Hauke
Thanks Hauke,
Will certainly try to get that going on our site.
While I have your attention can I ask you if you can help me with 2 other things that I need to resolve for our chat.
1. So be able to login without the Online Users panel opening. Because I am using the chat in a narrow column it would help if that did not open then the full width is available for the chat and in a narrow format the panel confuses newcomers to our site.
2. The above I am trying to do because I cannot seem to get the shoutbox version of same chat to work. That would be lighter and easier to fit on different pages of my site. NOTE: I am wanting to put this directly on my webpage and not on phhBB or any forum site.
I have floated this question on this forum and you could find it by looking at my other posts.
Sorry for taking the liberty but just did not know who to ask.
Thanks
Mansoor
(Logged in here as vu2mhk)
Hello Mansoor,
I'm not sure if I can really help you.
I'm using the Ajax Chat in an iframe with a fixed height and a variable width:
<iframe src="https://httpuser:httppassword@myserver/chat/?user=chatuser&pass=chatPass" width="90%" height="450"></iframe>
The iframe scales (in x direction) up and down (to a minimum) well.
I don't use the shoutbox mode in my setup and don't know how to activate it, sorry.
Thanks Hauke,
I am able to directly login with the addition of link as you suggested. Great help!
BUT for message sending script when user logs in, I am not sure where you have made the changes. If you can guide that please.
For you information I was able to solve the code for starting the chat without the ONLINE USERS panel. Just in case you need it here is what you do....
Open \lib\template\loggedIn.html
FIND:
<div id="onlineListContainer">
<h3>[LANG]onlineUsers[/LANG]</h3>
<div id="onlineList"></div>
ADD THIS CODE AFTER IT:
<script type="text/javascript">
toggleContainer('onlineListContainer', new Array('settingsContainer','helpContainer'));
</script>
Thanks immensely for your help.
Mansoor
Ok I managed the Email part when someone logs online too.
It looks like this:
This is how I have done a simple version where it at least sends me an email that a user by the name $user has logged onto our chat room Open AjaxChat.php in /lib/class FIND: function addToOnlineList() { $sql = 'INSERT INTO '.$this->getDataBaseTable('online').'( userID, userName, userRole, channel, dateTime, ip ) VALUES ( '.$this->db->makeSafe($this->getUserID()).', '.$this->db->makeSafe($this->getUserName()).', '.$this->db->makeSafe($this->getUserRole()).', '.$this->db->makeSafe($this->getChannel()).', NOW(), '.$this->db->makeSafe($this->ipToStorageFormat($_SERVER['REMOTE_ADDR'])).' );'; // Create a new SQL query: $result = $this->db->sqlQuery($sql); AND AFTER THAT ADD THE CODE: // Send Email to Your NAME that a guest has logged into Chat Room: {$user = $this->getUserName();} $to = "youremailid"; $subject = "$user has just logged into our Chat Room. Yipee!"; $body = "$user has just logged into our Chat Room. Yipee!";
The message sending script is called in lib/class/CustomAJAXChat.php with the line:
exec('sudo -u ras /home/ras/sendMsg "Benutzer '.$userName.' hat sich angemeldet!"',$lines,$ret);
This calls a BASH script, that sends me a message via Jabber, so I get informed when an user log in and I don't have to check the Ajax Chat all the time. O course you can call any other script to keep you informed or remove the line.