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??