I run Australia’s biggest wushu website, auswushu.com, and a while back I decided it’d be cool if people could chat in real-time on my website. I found PhpMyChat, a multi-room chat PHP script with a backend database. The script is quite neat, users can log in and chat away as if they are connected to IRC.
PhpMyChat comes with a front page which shows how many users are logged on and in which rooms.
I run AusWushu on PHP-Nuke, so I wanted to integrate this information into my page. There was nothing available on the PhpMyChat page, so I came up with my own PHP-Nuke block by hacking the PhpMyChat front page. Since then I’ve had quite a few requests from people about how they can integrate PhpMyChat with their PHP-Nuke websites too, so I’ve decided to clean up the code and make it available for anyone to download.
- Download my PhpMyChat PHP-Nuke block: here
- Unzip the file and edit block-phpMyChat.php with your favourite text editor, changing the path to your phpMyChat installation as explained in the file
- Upload block-phpMyChat.php to your PHP-Nuke blocks directory
- Log in to your PHP-Nuke website as an administrator and go to the Blocks section
- Under “Add new block” select phpMyChat from the drop-down list, give the block a title and uncheck Activate (don’t worry about any of the other fields
- After you click Create Block you should see the new block in your block list. Click “show” to check that everything is ok (if you get errors you probably need to double-check the path to your phpMyChat installation)
- If everything is ok click Activate and you’re away!
If you want to add more content to your block, as I have on AusWushu, add more HTML to the $content variable. For more information see the PHP-Nuke Blocks documentation.