Difference between revisions of "Widget:Advanced iframe"

From Mibbit Wiki
Jump to: navigation, search
(DSET method deprecated, new &custom...)
Line 4: Line 4:
 
  // default: irc.mibbit.com  
 
  // default: irc.mibbit.com  
 
  $server = 'irc.freenode.net';  
 
  $server = 'irc.freenode.net';  
  $room  = 'test'; // w./o. # or %23 !
+
  $room  = 'MibChat'; // w./o. # or %23 !
 
  $uri    = 'http://embed.mibbit.com/'
 
  $uri    = 'http://embed.mibbit.com/'
 
  . '?forcePrompt=true&nick=prefix_' . mt_rand(10000, 99999)
 
  . '?forcePrompt=true&nick=prefix_' . mt_rand(10000, 99999)
  . '&needSendButton=true'      // some mobile phones need it
+
  . "&customprompt=Welcome%20to%20$server/$room"
  . '&tabFontFamily=verdana,sans-serif'
+
  . '&customloading=maybe%20you%20need%20to%20close%20other%20Mibbit%20windows%20first...'
  . '&chatOutputShowTimes=true'; // type /dset for more settings
+
  . '&settings=c76462e5055bace06e32d325963b39f2';  
 
  if (!empty($room))    {$uri .= '&channel=%23' . $room;}   
 
  if (!empty($room))    {$uri .= '&channel=%23' . $room;}   
 
  if (!empty($server )) {$uri .= '&server='    . $server;}   
 
  if (!empty($server )) {$uri .= '&server='    . $server;}   
Line 21: Line 21:
 
</head>
 
</head>
 
<body><center>
 
<body><center>
<h3>IRC server: <?php echo empty($server) ? 'irc.mibbit.com' : $server; ?></h3>
+
<h3>advanced embedded mibbit widget example</h3>
(start channel: <?php echo empty($room)  ? '#chat' : '#' . $room; ?>)
+
<iframe  src="<?PHP echo $uri; ?>" frameborder="0">
<iframe  src="<?PHP echo $uri; ?>" frameborder="0"></iframe>
 
 
  [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
Line 35: Line 34:
 
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]] March 2008
 

Revision as of 13:49, 10 May 2008

Here an example how to integrate the Mibbit widget into your site (stored as "myMibbit.php"):

<?PHP
 // default: irc.mibbit.com 
 $server = 'irc.freenode.net'; 
 $room   = 'MibChat'; // w./o. # or %23 !
 $uri    = 'http://embed.mibbit.com/'
 . '?forcePrompt=true&nick=prefix_' . mt_rand(10000, 99999)
 . "&customprompt=Welcome%20to%20$server/$room"
 . '&customloading=maybe%20you%20need%20to%20close%20other%20Mibbit%20windows%20first...'
 . '&settings=c76462e5055bace06e32d325963b39f2'; 
 if (!empty($room))    {$uri .= '&channel=%23' . $room;}  
 if (!empty($server )) {$uri .= '&server='     . $server;}  
?><html>
<head><title>my chat on <?php echo empty($server)  ? 'irc.mibbit.com' : $server; ?></title>
<meta http-equiv='Content-Type' content='text/html; charset=utf-8'/>
<style>
body{font:93% verdana,sans-serif;background:#999;color:#fff;}
iframe{width:96%;height:75% /* % doesn't work in strict mode*/;}
</style>
</head>
<body><center>
<h3>advanced embedded mibbit widget example</h3>
<iframe  src="<?PHP echo $uri; ?>" 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>
<br>(no spaces, interpunctuation or leading ciphers in your /nick name)
<h4>type /help to learn about available commands</h4>
</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>