Integration of lightIRC with your website/message board/blog¶
Passing random parameters from the query string¶
Rename your index.html to index.php and keep everything else intact. Use this snippet in your index file instead of the original JavaScript block to parse custom parameters from the query string (like index.php?nick=test) but to use all other parameters from your config.js:
1<script type="text/javascript"> 2 <?php 3 foreach($_GET as $key => $value) { 4 echo "params.".htmlentities($key)." = \"".htmlentities($value)."\";\n"; 5 } 6 ?> 7 swfobject.embedSWF("lightIRC.swf", "lightIRC", "100%", "100%", "10.0.0", "expressInstall.swf", params); 8</script>
Passing the nickname from phpBB 3¶
Rename your config.js to config.php and use the following code snippet. Remember to adjust the path to your config in the index.html file. Be also sure to copy your other parameters inside.
1<?php 2 3define('IN_PHPBB', true); 4$phpbb_root_path = '../'; 5$phpEx = substr(strrchr(__FILE__, '.'), 1); 6include($phpbb_root_path . 'common.' . $phpEx); 7include($phpbb_root_path . 'includes/functions_display.' . $phpEx); 8 9$user->session_begin(); 10$auth->acl($user->data); 11header('Content-type: text/javascript'); 12 13?> 14 15params.nick = "<?=$user->data['username']?>"; 16 17... other parameters
Passing the nickname from myBB¶
Rename your config.js to config.php and use the following code snippet. Remember to adjust the path to your config in the index.html file. Be also sure to copy your other parameters inside.
You have to adjust the path to global.php inside the myBB folder.
1<?php 2 3define("IN_MYBB", 1); 4include("path/to/your/global.php"); 5header('Content-type: text/javascript'); 6 7?> 8 9params.nick = "<?=(($mybb->user['uid'] > 0) ? $mybb->user['username'] : "Guest_%")?>"; 10 11... other parameters