Ajax Chat Plugin
A basic Ajax chat plugin.
A .zip of the plugin is available at http://sandbox.siteamonth.com/demo/chat
1. Download Prototype (http://www.prototypejs.org/) and put it in /app/webroot/js/
2. Download and unzip the plugin to app/plugins. The plugin is called "chat", so make sure there is no conflict with any other controllers/plugins
3. Run this sql to create the chats table.
Download code
4. Include the helper in your controller
Download code
5. Include Prototype in your view if you don't already include it in your layout.
Download code
6. Then just add the chat to your view. You can have multiple chats on your site by changing the chat key - "chat1" in this example.
Download code
1. Download Prototype (http://www.prototypejs.org/) and put it in /app/webroot/js/
2. Download and unzip the plugin to app/plugins. The plugin is called "chat", so make sure there is no conflict with any other controllers/plugins
3. Run this sql to create the chats table.
Download code
CREATE TABLE `chats` (
`id` int(10) unsigned NOT NULL auto_increment,
`key` varchar(45) NOT NULL default '',
`handle` varchar(20) NOT NULL default '',
`text` text NOT NULL,
`ip_address` varchar(12) NOT NULL default '',
`created` datetime NOT NULL default '0000-00-00 00:00:00',
PRIMARY KEY (`id`),
KEY `KEY_IDX` (`key`)
);
4. Include the helper in your controller
Download code
var $helpers = array('Ajax', 'chat/AjaxChat');
5. Include Prototype in your view if you don't already include it in your layout.
Download code
echo $javascript->link('prototype');
6. Then just add the chat to your view. You can have multiple chats on your site by changing the chat key - "chat1" in this example.
Download code
echo $ajaxChat->generate('chat1');
Comments
Comment
1 Bravo
Comment
2 Awesome
Comment
3 Too Easy
Comment
4 Saweet
Comment
5 List of users
Bug
6 Download Link dead
The link is dead??
Comment
7 Download link mirror
http://sandbox2.pseudocoder.com/files/CakePHP-Ajax-Chat-v1.1.zip
Question
8 What goes where exactly...
I include the helper in the app_controller even:
class AppController extends Controller
{
var $helpers = array('Ajax', 'chat/AjaxChat');
}
?>
Also, does this work properly in Cake Version 1.2 or are modifications necessary?
Comment
9 RE: What goes where exactly...
var $helpers = array('Ajax', 'chat.AjaxChat');
I doubt this version will work in 1.2. The jQuery version should work though: http://bakery.cakephp.org/articles/view/ajax-chat-plugin-using-jquery
Bug
10 Missing Controller
Error: UpdateController could not be found.
can any one explain why this error occured?
i m using cakePHP 1.2.8284
Comment
11 chat + auth
Whenever chat loads, something must be going wrong w/ my user session, because I'm immediately logged out.
ideas?