function printcontent()
/* - output content in relation to of number page */
{
global $page, $allmess, $allpages, $content, $mess2page;
for($i=$mess2page*5*($page-1);$i<$mess2page*5*($page-1)+$mess2page*5;$i++)
{
print "$content[$i]";
}
}
$filename = "gb.inc";
if(!file_exists("gb.inc"))
{
$newfile = fopen("gb.inc","w");
fwrite ($newfile,"",0);
fclose($newfile);
}
$guestfile = fopen($filename,"r");
$guesttext = fread($guestfile, filesize ($filename));
fclose($guestfile);
if (!isset($page))
{
$page = 1;
}
$content = split(,$guesttext);
$sizearray = sizeof($content);
$allmess = ($sizearray-1)/5;
/* - quantity all messages */
$mess2page = $allmess;
/* quantity messages of one page */
$allpages = ceil($allmess/$mess2page);
/* - quantity all pages */
printcontent();
print " ";
?>
|