Location: PHPKode > projects > WMForum > wmforum/index.php
<?php
@header ("Expires: Mon, 30 Jul 2001 05:00:00 GMT");
$gt1 = getdate();
$gt2 = getdate(filemtime(basename($PHP_SELF)));
@header("Last-Modified: ".gmdate ("D, M d Y H:i:s", gmmktime ($gt2["hours"]+1,$gt2["minutes"],$gt2["seconds"],$gt1["mon"],$gt1["mday"],$gt1["year"]))." GMT");
@header ("Cache-Control: no-cache, must-revalidate");
@header ("Pragma: no-cache");
include('./global.inc');
?>
<div align="center">
| <A HREF="add.php"><img height="15px" width="15px" src="image/msg.gif" border="0">&nbsp;<FONT SIZE="-1">New message</FONT></A> |
</div>
<br>
<blockquote>
<HR color="black">

<?php
$patchs="./data/";
$kolpage=10;
$page=$HTTP_GET_VARS["page"];
$indexfname=$patchs."indx.txt";
$fp=@fopen($indexfname,'r');
$indx=fread($fp,filesize ($indexfname));
fclose($fp);
$kolstr=ceil($indx/$kolpage);
if (!$page): $page=$kolstr; endif;


if ($indx<$kolpage) : $kolpage=$indx; endif;
$min=($kolpage*($page-1))+$kolpage;
if ($min>$indx):$min=$indx;endif;

for ( $i=1; $i<=$kolpage; $i++)
	{

	$indexfname=$patchs.$min.".txt";
	$content = file($indexfname);
	$SenderData=str_replace("\n","",$content[0]);
	$SenderNik=str_replace("\n","",$content[1]);
	$SenderMail=str_replace("\n","",$content[2]);
	$SenderUrl=str_replace("\n","",$content[4]);
	$SenderText=str_replace("\n","",$content[5]);
	$SenderEmozi = str_replace("\n","",$content[6]);
	$SenderSubj = str_replace("\n","",$content[3]);
	if (strlen($SenderSubj)>60) :$SenderSubj=substr($SenderSubj,0,60); endif;
?>		
<br>
<img width="15px" height="15px" title="<?php echo($SenderText); ?>" src="image/<?php echo("msg".$SenderEmozi.".gif"); ?>" border="0">
&nbsp;
<FONT face=Arial  size="-2">
<I>|&nbsp;<?php echo($SenderData); ?>&nbsp;|</I>
&nbsp;
<A title="Author e-mail" HREF="mailto:<?php echo($SenderMail); ?>"><?php echo($SenderNik); ?></A>
</FONT>
&nbsp;
<FONT SIZE="-1"><a title="Message" class="page" href="<?php echo("add.php?top=".$topic.$min); ?>" ><?php echo($SenderSubj); ?></a></FONT>
&nbsp;
<?php	



	$ik=0;
	$indexfname=$patchs.$min.".rel";
	$fp=@fopen($indexfname,'r');
        $indx=fread($fp,filesize($indexfname));		
	fclose($fp);

	for ($j=1;$j<=$indx;$j++)
	{

	$indexfname=$patchs.$min."s".$j.".txt";
	$fp=@fopen($indexfname,'r');
	if ($fp <> 0) :
        fclose($fp);	
	$content = file($indexfname);
	$SenderSubj = str_replace("\n","",$content[3]);
	$SenderEmozi = str_replace("\n","",$content[6]);
if ($ik==0):$ik=1;echo("|&nbsp;");endif;
?>
<A  href="<?php echo("small.php?top=".$min."s".$j); ?>" ><img height="15px" width="15px" src="image/<?php echo("msg".$SenderEmozi.".gif"); ?>" title="<?php echo($SenderSubj); ?>" border="0" ></A>
<?php
endif;
	}; // end for j

	$min--;	
	// if ($min=0):break;endif;
	}; //end for i

?>
</blockquote>

<blockquote>

<p>
<HR color="black">
<font face="Arial Cyr" size="2">Pages:
<?php



for ($i=$kolstr;$i>=1;$i--)
{
if ($i==$page) : echo("<b>".$i."</b>&nbsp;");
else :echo('<A class="page" href="index.php?page='.$i.'">'.$i.'</A>&nbsp;');endif;

};
?>

<HR color="black">
</p>
</font>
</blockquote>
<?php
include('./footer.inc');
?>
Return current item: WMForum