<?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
// ------------------------------------------------------------------------- //
include_once("./header.php");
include_once(XOOPS_ROOT_PATH . "/modules/".$xoopsModule->dirname()."/cache/config.php");
global $_POST,$xoopsUser;
$action = $_POST['action'];
$thisUser = $_POST['nic'];
$thisPass = $_POST['pas'];
if (!$thisUser) $thisUser = _MA_XIRC_GUEST;
if ($thisPass)  $nickserv = '<param name="command2" value="/msg nickserv identify '.$thisPass.'">';
echo '<table align=center border="0" width=100%" cellpadding=0 cellspacing=0>
       <tr>
        <td align=center colspan=2>
	<br>
         <b>&nbsp;&nbsp;&nbsp;<font class=storytitle>'. _MI_XIRC_NAME.'</font></b><br>';
if ($action == 'connect') {
?>
	<table align=center border="0" width=100%" cellpadding=0 cellspacing=0>
             <tr>
              <td align=center>
              <applet style="z-index:-1;position:relative;" name="xirc" code=IRCApplet.class archive="irc.jar,pixx.jar" codebase="sources/java/" width="<?php echo $irc_cfg['width'];?>" height="<?php echo $irc_cfg['height'];?>">
              <param name="CABINETS" value="irc.cab,securedirc.cab,pixx.cab">
              <!-- Server List -->
              <param name="host" value="<?php echo $irc_cfg['host'];?>">
              <param name="alternateserver1" value="<?php echo $irc_cfg['alternateserver'];?> <?php echo $irc_cfg['port'];?>">
              <param name="port" value="<?php echo $irc_cfg['port'];?>">
              <param name="autoconnection" value="<?php echo $irc_cfg['autoconnection'];?>">
              <param name="command1" value="/join <?php echo $irc_cfg['channel'];?>">
              <? echo $nickserv; ?>
              <param name="gui" value="pixx">
              <!-- Name Settings -->
              <param name="nick" value="<?php echo $thisUser;?>">
              <param name="alternatenick" value="<? echo $thisUser."??"; ?> ">
              <param name="name" value="<?php echo $thisUser;?>">
              <param name="userid" value="<?php echo $thisUser ."@". XOOPS_URL;?>">
              <!-- Language List -->
              <param name="pixx:lngextension" value="txt">
              <param name="pixx:language" value="<?php echo $irc_cfg['deflang'];?>" >
              <!-- STYLE -->
              <param name="style:backgroundimage" value="<?php echo $irc_cfg['bgimage'];?>">
              <param name="style:backgroundimage1" value="all all 1 ../img/<?php echo $irc_cfg['bgimage1'];?>">
              <param name="pixx:styleselector" value="<?php echo $irc_cfg['styleselector'];?>">
              <param name="style:sourcefontrule1" value="all all <?php echo $irc_cfg['channelfont'];?>">
              <param name="style:floatingasl" value="true">
              <param name="pixx:showabout" value="<?php echo $irc_cfg['showabout'];?>">
              <param name="pixx:showhelp" value="<?php echo $irc_cfg['showhelp'];?>">
              <param name="pixx:helppage" value="<?php echo $irc_cfg['helppage'];?>">
              <param name="pixx:showconnect" value="<?php echo $irc_cfg['showconnect'];?>">
              <param name="pixx:showchanlist" value="<?php echo $irc_cfg['showchanlist'];?>">
              <param name="pixx:showstatus" value="<?php echo $irc_cfg['showstatus'];?>">
              <param name="pixx:showclose" value="<?php echo $irc_cfg['showclose'];?>">
              <param name="pixx:nicklistwidth" value="<?php echo $irc_cfg['nicklistwidth'];?>">
              <param name="pixx:color11" value="<?php echo $irc_cfg['color11'];?>">
              <param name="pixx:nickfield" value="<?php echo $irc_cfg['nickfield'];?>">
              <param name="highlight" value="<?php echo $irc_cfg['highlight'];?>">
              <param name="pixx:highlightnick" value="<?php echo $irc_cfg['highlightnick'];?>">
              <param name="pixx:timestamp" value="<?php echo $irc_cfg['timestamp'];?>">
              <!-- Images -->
              <param name="style:bitmapsmileys" value="<?php echo $irc_cfg['showsmileys'];?>">
              <param name="style:smiley1" value=":) ../img/sourire.gif">
              <param name="style:smiley2" value=":-) ../img/sourire.gif">
              <param name="style:smiley3" value=":-D ../img/content.gif">
              <param name="style:smiley4" value=":d ../img/content.gif">
              <param name="style:smiley5" value=":-O ../img/OH-2.gif">
              <param name="style:smiley6" value=":o ../img/OH-1.gif">
              <param name="style:smiley7" value=":-P ../img/langue.gif">
              <param name="style:smiley8" value=":p ../img/langue.gif">
              <param name="style:smiley9" value=";-) ../img/clin-oeuil.gif">
              <param name="style:smiley10" value=";) ../img/clin-oeuil.gif">
              <param name="style:smiley11" value=":-( ../img/triste.gif">
              <param name="style:smiley12" value=":( ../img/triste.gif">
              <param name="style:smiley13" value=":-| ../img/OH-3.gif">
              <param name="style:smiley14" value=":| ../img/OH-3.gif">
              <param name="style:smiley15" value=":'( ../img/pleure.gif">
              <param name="style:smiley16" value=":$ ../img/rouge.gif">
              <param name="style:smiley17" value=":-$ ../img/rouge.gif">
              <param name="style:smiley18" value="(H) ../img/cool.gif">
              <param name="style:smiley19" value="(h) ../img/cool.gif">
              <param name="style:smiley20" value=":-@ ../img/enerve1.gif">
              <param name="style:smiley21" value=":@ ../img/enerve2.gif">
              <param name="style:smiley22" value=":-S ../img/roll-eyes.gif">
              <param name="style:smiley23" value=":s ../img/roll-eyes.gif">
	       <param name="style:smiley24" value="(a) img/ange.gif">
		<param name="style:smiley25" value="()= img/arbre.gif">
		<param name="style:smiley26" value=":O img/argh.gif">
		<param name="style:smiley27" value="(O) img/ballon.gif">
		<param name="style:smiley28" value="(b) img/biere.gif">
		<param name="style:smiley29" value="(B) img/bombe.gif">
		<param name="style:smiley30" value="(p) img/bouche.gif">
		<param name="style:smiley31" value="||| img/bouqin.gif">
		<param name="style:smiley32" value="(r) img/cadeau.gif">
		<param name="style:smiley33" value="(g) img/chien.gif">
		<param name="style:smiley34" value="(c) img/coeur.gif">
		<param name="style:smiley35" value="(cX) img/coeur-brise.gif">
		<param name="style:smiley36" value="(X) img/comprends-pas.gif">
		<param name="style:smiley37" value="(d) img/diable.gif">
		<param name="style:smiley38" value="(F) img/femme.gif">
		<param name="style:smiley39" value="(i) img/fille.gif">
		<param name="style:smiley40" value="(f) img/fleur.gif">
		<param name="style:smiley41" value="(r) img/garcon.gif">
		<param name="style:smiley42" value="$| img/grognon.gif">
		<param name="style:smiley43" value="(@) img/lettre.gif">
		<param name="style:smiley44" value="(l) img/lit.gif">
		<param name="style:smiley45" value="(e) img/love.gif">
		<param name="style:smiley46" value="(L) img/lune.gif">
		<param name="style:smiley47" value=":/ img/mecontent.gif">
		<param name="style:smiley48" value="(w) img/newbie.gif">
		<param name="style:smiley49" value="(j) img/ordi.gif">
		<param name="style:smiley50" value="(p) img/poisson.gif">
		<param name="style:smiley51" value="(P) img/pomme.gif">
		<param name="style:smiley52" value="(o) img/portable.gif">
		<param name="style:smiley53" value="(n) img/pouce-non.gif">
		<param name="style:smiley54" value="(s) img/pouce-oui.gif">
		<param name="style:smiley55" value="(A) img/sapin.gif">
		<param name="style:smiley56" value="|) img/sleep.gif">
		<param name="style:smiley57" value="(S) img/soleil.gif">
		<param name="style:smiley58" value="(T) img/terre.gif">
		<param name="style:smiley59" value=">=| img/verre-eau.gif">
		<param name="style:smiley60" value=">==| img/verre-vin.gif">
		<param name="style:smiley61" value="(y) img/yinyang.gif">
              <!-- Extra -->
              <param name="pixx:soundbeep" value="../snd/<?php echo $irc_cfg['soundbeep'];?>">
              <param name="pixx:soundquery" value="../snd/<?php echo $irc_cfg['soundquery'];?>">
              <param name="pixx:messagefield" value="<?php echo $irc_cfg['messagefield'];?>">
              <param name="pixx:useinfo" value="<?php echo $irc_cfg['useinfo'];?>">
              <param name="pixx:useidentserver" value="<?php echo $irc_cfg['useidentserver'];?>">
              <param name="quitmessage" value="<?php echo $irc_cfg['quitmessage'];?>">
	       <param name="pixx:showchannelmodeapply" value="false">
		<param name="pixx:showchanneltopicmodes" value="false">
              <param name="pixx:automaticqueries" value="true">
              <param name="pixx:configurepopup" value="true">
              <param name="pixx:popupmenustring1" value="Whois">
              <param name="pixx:popupmenustring2" value="Kick + Ban">
              <param name="pixx:popupmenustring3" value="Privat Chat">
              <param name="pixx:popupmenucommand1_1" value="/whois %1">
              <param name="pixx:popupmenucommand2_1" value="/mode %2 -o %1">
              <param name="pixx:popupmenucommand2_2" value="/mode %2 +b %1">
              <param name="pixx:popupmenucommand2_3" value="/kick %2 %1">
              <param name="pixx:popupmenucommand3_1" value="/query %1">
              <b><?php echo _MA_XIRC_NEED_JAVA;?>.</b>
              </applet>
              </td>
             </tr>
            </table>
            <br />
			
<?php
			CloseTable();
} else  {
            $content = join('', file("./cache/footer.txt"));
            $content = $myts->sanitizeForDisplay($content,1,1,1);
            echo "<table width=100% cellpadding=0 cellspacing=0>";
            echo " <tr>";
			echo "  <td width=200 style=\"border-left:1px solid #efefef;\" valign=top>&nbsp;";
            echo "   <font class=storytitle>"._MA_XIRC_LOGIN."</font><br />\n";
            echo "   <center><form action='index.php' method='post'>\n";
            echo "   <input type='hidden' name='action' value='connect'><br />\n";
            echo _MA_XIRC_USER.":<br> <input type='text' class='text' name='nic' ";
			if ($xoopsUser) { echo "value='".$xoopsUser->uname()."'>";  } 
			else { echo "value=' '>"; } 
			echo "<br />\n";
            echo _MA_XIRC_PASS.":<br> <input type='password' class='text' name='pas' value=''><br />\n";
            echo "   <br><input type='submit' class='button' value='"._CONNECT."'>\n";
            if ($irc_cfg['popup'] == 'true')  echo "<INPUT TYPE=\"button\" class=\"button\" name=\"popup\" value=\""._MA_XIRC_POPUP."\" onClick=\"window.open('popup.php?action=connect&popup=true&nic='+this.form.nic.value+'&pas='+this.form.pas.value,'Chat','width=".$irc_cfg['width'].",height=".$irc_cfg['height'].",left=10,top=10');\">\n";
			echo "   </form></center>";
            echo "   <br /><font class=storytitle>Benutzer in: ".$irc_cfg['channel']."</font><br />\n";
			echo "</td>";
            echo "  <td>";
            echo "   <blockquote>";
            echo $content;
            echo "   </blockquote>";
            echo "  </td>";
			echo "</tr></table>";
            CloseTable();
}
include_once("../../footer.php");
?>
