Community Documentation

Add Mibbit AJAX IRC client with nickname auto-completion

Last updated July 13, 2008. Created by Travis on July 13, 2008.
Log in to edit this page.

This snippet is a quick way to add real-time chat to your drupal using the Mibbit AJAX IRC client from http://mibbit.com/widget.html

It has been tested on 5.7, but should work on any drupal version that stores user information in $user and sets $user-uid > 0 for logged-in users.

<?php
global $user;

// If the user is logged in, set IRC nickname to their username, else an anonymous one.

if($user->uid > 0) {
   
$nickname = check_plain($user->name);
} else {
   
$nickname = 'Agent%3F%3F%3F';
}

?>


<iframe width=695 height=500 scrolling=no style="border:0" src="http://embed.mibbit.com/?server=[your server spec]&channel=%23[your channel]&nick=<?php print "$nickname"; ?>"></iframe>

About this page

Drupal version
Drupal 4.5.x or older, Drupal 4.6.x, Drupal 4.7.x, Drupal 5.x

Reference

Drupal’s online documentation is © 2000-2012 by the individual contributors and can be used in accordance with the Creative Commons License, Attribution-ShareAlike 2.0. PHP code is distributed under the GNU General Public License.
nobody click here