<?php
//v1.0.4 www.bcoos.net 2006/10 GPL
//v1.11 www.exoops.info 2006/06
//v1.1 www.exoops.info 2006/03
// ------------------------------------------------------------------------- //
//               E-Xoops: Content Management for the Masses                  //
//                       < http://www.e-xoops.com >                          //
// ------------------------------------------------------------------------- //
// Original Author: Half-Dead
// Author Website : http://www.e-xoops.com
// Licence Type   : GPL
// ------------------------------------------------------------------------- //
function irc_chat() {
global $bcoosConfig, $xoopsUser, $onIRC,$_POST;
if (@file_exists(XOOPS_ROOT_PATH . '/modules/xpjirc/language/'.$bcoosConfig['language'].'/language.php')) {
	include_once(XOOPS_ROOT_PATH . '/modules/xpjirc/language/'.$bcoosConfig['language'].'/language.php');
	} else {
		include_once(XOOPS_ROOT_PATH . '/modules/xpjirc/language/english/language.php');
	}
$thisUser = $_POST['nic'];
$thisPass = $_POST['pas'];
	if (!$thisUser) $thisUser = _MA_XIRC_GUEST;
include_once(XOOPS_ROOT_PATH . "/modules/xpjirc/cache/config.php");
	$block['title']    = "IRC Chat";
        $block['content']  = "<table width=100% cellpadding=0 cellspacing=0>";
        if ($onIRC != "1") {
        $block['content'] .= " <tr>";
        $block['content'] .= "  <td align=center>";
        $block['content'] .= "   <form action='".XOOPS_URL."/modules/xpjirc/index.php' method='post'>\n";
        $block['content'] .= "   <input type='hidden' name='action' value='connect'><br />\n";
        $block['content'] .=  _MA_XIRC_USER.":<br> <input type='text' class='text' name='nic' ";
		if ($xoopsUser) { $block['content'] .= "value='".$xoopsUser->uname()."'>";  } 
		else { $block['content'] .= "value=' '>"; } 
		$block['content'] .= "<br />\n";
        $block['content'] .=  _MA_XIRC_PASS.":<br> <input type='password' class='text' name='pas' value=''><br />\n";
        $block['content'] .= "   <br><input type='submit' class=\"button\" value='"._CONNECT."'>\n";
        if ($irc_cfg['popup'] == 'true')  $block['content'] .= "<INPUT TYPE=\"button\" clas=\"button\" name=\"popup\" value=\""._MA_XIRC_POPUP."\" onClick=\"window.open('".XOOPS_URL."/modules/xpjirc/popup.php?action=connect&popup=true&nic='+this.form.nic.value+'&pas='+this.form.pas.value,'Chat','width=640,height=480,left=10,top=10');\">\n";
	$block['content'] .= "   </form>";
        $block['content'] .= "   <br />";
        $block['content'] .= "  </td>";
        $block['content'] .= " </tr>";
        }
        $block['content'] .= " <tr>";
        $block['content'] .= "  <td align='center' valign='middle'>";
        $block['content'] .= "<a href='".XOOPS_URL."/modules/xpjirc/'><img src='".XOOPS_URL."/modules/xpjirc/images/irc-chat.gif' border='0'></a></div>";
        $block['content'] .= "  </td>";
        $block['content'] .= " </tr>";
        $block['content'] .= "</table>";
	return $block;
}
?>
