Location: PHPKode > projects > php Strategy Game Engine X > phpsgex/core-pages/chat.php
<?php

/* --------------------------------------------------------------------------------------
                                      CHAT
   Credits         : phpSGEx by Aldrigo Raffaele
   Last modified by: Fhizban 09.06.2013
   Comments        : No changes
-------------------------------------------------------------------------------------- */

$head="<style>
	div.box{
		width:291px !important;width /**/:200px;
		height:190px !important;height /**/: 200px;
		overflow:auto;padding: 4px;
		border:1px solid #EEE;border-right:0 solid;
	} 

	div.box-inner{
		height: 200px;overflow:auto;
    	margin:25px 24px 0;padding-right:2px
	} 
</style>";
$head.="<script type='application/javascript' src='templates/js/chat-js.js'></script>";
$head.=" <script type='text/javascript' src='templates/js/nicEdit.js'></script> <script type='text/javascript'>
//<![CDATA[
bkLib.onDomLoaded(function() {
	new nicEditor({buttonList : ['fontSize','bold','italic','underline','strikeThrough','forecolor','html']}).panelInstance('msg');
});
//]]>
</script>";

$body="<p><div class='box'> <div class='box-inner' id='chatlog'>";
//chat
$result=mysql_query("SELECT * FROM ".TB_PREFIX."chat ORDER BY `id` DESC");
 if ($result) {
	$i=0;
	while($riga=mysql_fetch_array($result)) {
		$body.= "<a href='profile.php?usr=".$riga['usrid']."' target='_blank'>".$riga['username']."</a> : ".$riga['msg']."<br>";
	}
} 

$body.=" </div></div></p><p>&nbsp;</p>".$lang['msg_mp'].": <label><p id='msg' class=' ' contenteditable='true' style='border: 2px solid #000'></p> <div id='nik' style='display: none;'>".$me->user_info['username']."</div> </label><label>&nbsp;&nbsp; <input type='button' value='".$lang['msg_send']."' onclick=\"javascript: chat_sendm();\"></label>";

$blol="onload='javascript: chat_rel();'";

?>
Return current item: php Strategy Game Engine X