hi,
NOTICE: If you use Joomla 1.5 and above, see here ->
http://mibew.org/forums/index.php?topic=161.0So i included openwebIM fast and dirty in mambo, and for those of you who want to do that too, here is how i did it.
However: This is not a mambo/joomla component or anything, i just include the button and give the username of the logged in mambo 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)") 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
$username = $my->username;
switch($username) {
case '':
$username = 'Guest';
break;
case ' ';
$username = 'Guest';
break;
}
?>
<script>
var username = "<?php echo $username; ?>"
</script>
<!-- Button code. Attention!!! If you are editing the code, make sure to include "+'&name='+escape(username)" after "(document.referrer)"-->
<!-- 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), '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), '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 mambo template you use. open the index.php file and insert following at the position you want the button to appear:
<?php include_once( $GLOBALS['mosConfig_absolute_path'] . '/webim/chatinclude.php' ); ?>
As i said, it's not the way you should add things to mambo. It's quick and dirty.