Questions answered by this recipe
How to offer a modern and private chat to the authenticated users of my PmWiki ?
All sections are optional, you can remove those that do not apply to your recipe, and add new ones.
Provide recipe to use a jquery chat into pmwiki.
The jquery chat, by Anant Garg, is a robust system. A js "chat.js" telling messages and events to a chat.php which has to be in the root of the PmWiki. The stream of messages is in a sql table.
I have just wrote a very ugly system to list connected people... and offer a minimal markup
You can see a standalone online demo of this chat system:
Put these urls in three differents browsers: you can chat between them.
http://anantgarg.com/chat/samplea.php http://anantgarg.com/chat/sampleb.php http://anantgarg.com/chat/samplec.php
Intallation of jquerychat
- Download http://anantgarg.com/wp-content/uploads/2009/05/jquerychat.zip in the /pub directory of your PmWiki
- unzip it, you have now a 'chat' directory pub/chat
- copy the pub/chat/chat.php in the root of your PmWiki
cd pub [of your PmWiki] sudo wget http://anantgarg.com/wp-content/uploads/2009/05/jquerychat.zip unzip jquerychat.zip sudo cp chat/chat.php ..
Create a sql table for the communication stream
CREATE TABLE `chat` ( `id` INTEGER UNSIGNED NOT NULL AUTO_INCREMENT, `from` VARCHAR(255) NOT NULL DEFAULT '', `to` VARCHAR(255) NOT NULL DEFAULT '', `message` TEXT NOT NULL, `sent` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00', `recd` INTEGER UNSIGNED NOT NULL DEFAULT 0, PRIMARY KEY (`id`), INDEX `to` (`to`), INDEX `from` (`from`) ) ENGINE = InnoDB;
Create un loggedin directory
The recipe jquerychat.php uses a 'very ugly' system to know who is connected (if you have a better, tell me!).
You have to create pub/loggedin directory with right to PmWiki to write in it
Installation of jquerychat.php
Tell to PmWiki that you want to use the recipe
Add in your local/config.php the linge
$_SESSION['username']=$Author; include_once('cookbook/jquerychat.php'); include_once('chat.php');
Access to the sql table
You have to tell to chat.php' how to connect to the database to retreive the chat table.
The default nickname in the chat system is
$Author but maybe you can change it: jquerychat use $_SESSION['username']
The recipe provide a very simple markup
(:chats:) which provide links to chats with each other connected people.
Change log / Release notes
If the recipe has multiple releases, then release notes can be placed here. Note that it's often easier for people to work with "release dates" instead of "version numbers".