Location: PHPKode > projects > Oocommon php engine > ooim/pub/ooim_main.php
<?php
include ("oocommon.php");
$s = new session;
$p = new html4page;
$t = new sched;
$p->stylesheet="style.css";
$p->writeln("<h1>ooIm 0.1B</h1><hr />");
if ($s->sess[sid] =="") { die ("Session Error"); }
$mess = $s->getmessagelist();
		$p->writeln("<script>
		function newWindow(mypage,myname,w,h,features) {
  		  if(screen.width){
  			var winl = (screen.width-w)/2;
  			var wint = (screen.height-h)/2;
  			}else{winl = 0;wint =0;}
  			if (winl < 0) winl = 0;
  			if (wint < 0) wint = 0;
  			var settings = 'height=' + h + ',';
  			settings += 'width=' + w + ',';
  			settings += 'top=' + wint + ',';
  			settings += 'left=' + winl + ',';
  			settings += features;
  			win = window.open(mypage,myname,settings);
  			win.window.focus();
		}</script>
		");

$p->writeln("
<table width=\"100%\">
    <tr style=\"background:rgb(0,100,255);\">
	<td colspan=\"2\"> Hola <b>".$s->user[username]."</b>! tienes ".count($mess)." mensajes </td>
    </tr>
    <tr><td valign=\"top\">");
$p->writeln("<center><br /><table><tr style=\"background:rgb(0,0,200);\"><td colspan=\"3\">Buddies</td></tr>");
$ba = $s->getbuddies();

foreach ($ba as $k=>$name)
{		$p->writeln("<tr><td>".$name."</td><td>");
		if ($s->isonline($name)) { $p->writeln("<a href=\"Javascript:newWindow('ooim_im.php?username=".$name."','IM',300,400,'popup')\">[(_Send IM!_)]</a> "); } else { $p->writeln("Offline");}
		$p->writeln("</td><td><a href=\"ooim_sndmsg.php?username=".$name."\">[Send]</a><a href=\"ooim_delbud.php?username=".$name."\">[Del]</a></td></tr>");
}
$p->writeln("</table>");
$p->addlink("ooim_addbud.php","[Add Buddies]");
$p->addlink("ooim_logout.php","[Logout]");

$p->writeln("<br />
	</td><td valign=\"top\">
	<br />
	<table width=\"100%\">
		<tr style=\"background:rgb(0,0,200);\">
			<td >De</td>
			<td>Cuando</td>
			<td> Mensaje </td>
			<td>Accion</td>
		</tr>");
		for ($i=0;$i<count($mess);++$i)
		{
			if ($mess[$i][id]!="")
			{
				$t->now = $mess[$i][when];
				$p->writeln("<tr><td>".$mess[$i][from]."</td><td>".$t->getsdate()."</td><td>".$mess[$i][body]."</td><td><a href=\"ooim_delmsg.php?id=".$mess[$i][id]."\">[Delete]</a></td></tr>");
			}
		}
$p->writeln("
	</table>
	");
$p->addlink("ooim_sndmsg.php","[Send Message]");
$p->writeln("<br /><br />
	</td>
   </tr>
</table>");
$p->writeln("<meta http-equiv=\"refresh\" content=\"10; url=ooim_main.php\">");
	$ims = explode (",",$s->GetUserParam("IM"));
	for ($i=0;$i<count($ims);$i++)
	{
	if ($s->CheckIM($ims[$i]))
		{
		$p->writeln("<a href=\"Javascript:newWindow('ooim_im.php?id=".$ims[$i]."','IM',300,400,'popup')\">".$s->getIMusers($ims[$i])." Wants IM with You!</a><br /><br />");
		}
	}
$p->output();
Return current item: Oocommon php engine