NOTICE: Only tested with Joomla 1.5.10 ! May not work with joomla versions <1.5 ! For this versions, look at the mambo guide ->
http://mibew.org/forums/index.php?topic=137.0What this modification does: Including the webIM button into a joomla website, and giving the username and the emailadress to the webIM software
So i included openwebIM fast and dirty in joomla, and for those of you who want to do that too, here is how i did it.
However: This is not a joomla component or anything, i just include the button and give the username of the logged in joomla user to the chat.
First, i made a "chatinclude.php" in the webim/ directory including this code:
ATTENTION: Look at the red highlighted pice of code in here ("+'&name='+escape(username)+'&email='+escape(email)") this must be added to the button code you got from webIM! however, in this php file MY button code which i got from webIM is included, feel free to delete it (from "<!-- Botton Code" until the end). but make sure you add the red marked text afterwards!
Also note that i changed the width and height of the button in this example!
<?PHP
$user =& JFactory::getUser();
$username = $user->username;
$email = $user->email;
switch($username) {
case '':
$username = 'Guest';
break;
case ' ';
$username = 'Guest';
break;
}
?>
<script>
var username = "<?php echo $username; ?>"
var email = "<?php echo $email; ?>"
</script>
<!-- Button code. Attention!!! If you are editing the code, make sure to -->
<!-- webim button --><br><a href="/webim/client.php?locale=en" target="_blank" onclick="if(navigator.userAgent.toLowerCase().indexOf('opera') != -1 && window.event.preventDefault) window.event.preventDefault();this.newWindow = window.open('/webim/client.php?locale=en&&url='+escape(document.location.href)+'&referrer='+escape(document.referrer)+'&name='+escape(username)+'&email='+escape(email), 'webim', 'toolbar=0,scrollbars=0,location=0,status=1,menubar=0,width=640,height=480,resizable=1');this.newWindow.focus();this.newWindow.opener=window;return false;"><img src="/webim/button.php?image=webim&lang=en" border="0" width="102" height="34" alt=""/></a><!-- / webim button -->
This is the last part of the code (the Button code) so i can highlight the thing you need to add ;-)
<!-- webim button --><br><a href="/webim/client.php?locale=en" target="_blank" onclick="if(navigator.userAgent.toLowerCase().indexOf('opera') != -1 && window.event.preventDefault) window.event.preventDefault();this.newWindow = window.open('/webim/client.php?locale=en&&url='+escape(document.location.href)+'&referrer='+escape(document.referrer)
+'&name='+escape(username)+'&email='+escape(email), 'webim', 'toolbar=0,scrollbars=0,location=0,status=1,menubar=0,width=640,height=480,resizable=1');this.newWindow.focus();this.newWindow.opener=window;return false;"><img src="/webim/button.php?image=webim&lang=en" border="0" width="102" height="34" alt=""/></a><!-- / webim button -->
Safe this file as chatinclude.php and upload it to your /webim/ directory.
Then go to the joomla template index.php you use. open the index.php file and insert following at the position you want the button to appear:
<?php include_once(JPATH_ROOT.'/webim/chatinclude.php'); ?>
As i said, it's not the way you should add things to mambo. It's quick and dirty.