Difference between revisions of "Widget:Advanced iframe"

From Mibbit Wiki
Jump to: navigation, search
(if iframes are disabled...)
Line 1: Line 1:
 
here an example how to integrate a chat window into your site (stored as "myMibbit.php"):
 
here an example how to integrate a chat window into your site (stored as "myMibbit.php"):
  <html>
+
  <nowiki>
<head>
+
<?PHP
<style>
+
$uri = 'http://embed.mibbit.com/e/'
body{
+
. '?nick=emb' // must not start numeric
  font:1em Arial,sans-serif; padding:0; margin:0;
+
. mt_rand(100000, 999999) // avoid collisions
  background:#070707; color:#fff;
+
. '&chatOutputShowTimes=true' // type /dset for more settings
}
+
. '&channel=%23help'; // or %23yourChannel
iframe{
+
?><html>
  width:90%;
+
<head><title>my chat on mibbit.com</title>
  height:400px;
+
<style>
}
+
body{
</style>
+
  font:1em Arial,sans-serif;  
</head>
+
  background:#666; color:#fff;
<body><nowiki>
+
}
<iframe scrolling="no" frameborder=0
+
iframe{
  src="http://embed.mibbit.com/e/?nick=emb<?PHP echo date('His'); ?>&channel=%23yourChannel">
+
  width:96%;
 +
  height:400px;
 +
}
 +
</style>
 +
</head>
 +
<body><center>
 +
<h3>type /help to learn about available commands</h3>
 +
<iframe  src="<?PHP echo $uri; ?>" scrolling="no" frameborder="0">
 
  [Your user agent does not support frames or is currently configured
 
  [Your user agent does not support frames or is currently configured
  not to display frames. However, you may want to open the  
+
not to display frames. However, you may want to open the  
  <A href="http://embed.mibbit.com/e/?nick=emb<?PHP echo date('His'); ?>&channel=%23yourChannel"
+
<A href="<?PHP echo $uri; ?>"
  target="_blank">chat in a new window.</A>]
+
  target="_blank"> chat in a new browser window ...</A>]
</iframe><center>
+
</iframe>
<h3>type /help to learn about available commands</h3>
+
<h3>To change your nickname type: /nick YourNewNickNameHere</h3>
<h3>To change your nickname type: /nick YourNewNickNameHere</h3></nowiki>
+
</center></body></html>
</center></body></html>
+
</nowiki>
 
 
 
if you link/open this in a new window you avoid unintentional leaving the chat when hitting the back button/key:
 
if you link/open this in a new window you avoid unintentional leaving the chat when hitting the back button/key:
  
 
  <nowiki><a href="myMibbit.php" target="_blank">myMibbit</a></nowiki>
 
  <nowiki><a href="myMibbit.php" target="_blank">myMibbit</a></nowiki>
 
--[[User:HerculeP|HerculeP]] 12:44, 28 February 2008 (UTC)
 
--[[User:HerculeP|HerculeP]] 12:44, 28 February 2008 (UTC)

Revision as of 09:44, 29 February 2008

here an example how to integrate a chat window into your site (stored as "myMibbit.php"):

<?PHP
 $uri = 'http://embed.mibbit.com/e/' 
 . '?nick=emb' // must not start numeric 
 . mt_rand(100000, 999999) // avoid collisions 
 . '&chatOutputShowTimes=true' // type /dset for more settings
 . '&channel=%23help'; // or %23yourChannel 
?><html>
<head><title>my chat on mibbit.com</title>
<style>
body{
  font:1em Arial,sans-serif; 
  background:#666; color:#fff;
}
iframe{
  width:96%;
  height:400px;
}
</style>
</head>
<body><center>
<h3>type /help to learn about available commands</h3>
<iframe  src="<?PHP echo $uri; ?>" scrolling="no" frameborder="0">
 [Your user agent does not support frames or is currently configured
 not to display frames. However, you may want to open the 
 <A href="<?PHP echo $uri; ?>"
 target="_blank"> chat in a new browser window ...</A>]
</iframe>
<h3>To change your nickname type: /nick YourNewNickNameHere</h3>
</center></body></html>
 

if you link/open this in a new window you avoid unintentional leaving the chat when hitting the back button/key:

<a href="myMibbit.php" target="_blank">myMibbit</a>

--HerculeP 12:44, 28 February 2008 (UTC)