<?
$basename=dirname(__FILE__);
if ($_POST[name] != '') include('post.php');
echo file_Get_contents("$basename/data/top.dat");
include $basename.'/includes/config.php';
$data=file("$basename/data/comments.dat");
#print_r($data);

foreach ($data as $post){
$post=stripslashes($post);
$information=explode('[]', $post);
$byte=$information[0];
$temp=explode($byte, $information[1]);
#print_r($temp);
unset($esub); unset($eend); unset($webbie); unset($htitle); unset($hwebbie);
if ($temp[3] != ''){ $htitle = '-'; }
$temp[5]=str_replace('[nl]', '<br>', $temp[5]);
if ($temp[4] == 'false'){ $esub="<a href=\"mailto:$temp[1]\">"; $eend='</a>'; }
$tstamp=date("j\<\s\u\p\>S\<\/\s\u\p\> F Y - g:ia", $temp[6]);
if ($temp[2] != ''){ if(substr($temp[2],0,4)!='http'){$temp[2]='http://'.$temp[2]; }  $hwebbie='-'; $webbie="<a href='$temp[2]' target='_blank'>Homepage</a>"; }
#echo "<br> Temp8: |$temp[8]| & PHP_SELF: |$_SERVER[PHP_SELF]| & INPURL: |$_POST[inpurl]| <br>";
if ((trim($temp[8]) == trim($_SERVER[PHP_SELF])) Or (trim($temp[8])==trim($_POST['inpurl']))){
$base=file_get_contents("$basename/data/body.dat");
$base=str_replace('[:title:]', $temp[3], $base);
$base=str_replace('[:ehb:]', $esub, $base);
$base=str_replace('[:name:]', $temp[0], $base);
$base=str_replace('[:ehe:]', $eend, $base);
$base=str_replace('[:homepage:]', $webbie, $base);
$base=str_replace('[:datetime:]', $tstamp, $base);
$base=str_replace('[:body:]', $temp[5], $base);
$base=str_replace('[:htitle:]', $htitle, $base);
$base=str_replace('[:hweb:]', $hwebbie, $base);

print $base;
/*
print <<<eof
 <div class="note"><font face=Tahoma size=2>
  <strong>{$temp[3]}<i>By {$esub}{$temp[0]}{$eend} </i> {$webbie}</strong><br />
  <small>{$tstamp}</small>
  <div class="text">
  {$temp[5]}
  </div>
</font></div>
eof;
*/
}
}
?></div>