<?php
require_once('framework/session.php');
require_once('framework/work/start.php');
require_once('framework/ready.php');
include_once('framework/functions/badwords.php');
if(isset($_POST['lastmsg'])) {
$id = (int)$_SESSION['id'];
$lastmsg = (int)$_POST['lastmsg'];
$lastmsg = mysql_real_escape_string($lastmsg);
$result = mysql_query("SELECT * FROM guestbook WHERE id<'$lastmsg' ORDER BY id DESC LIMIT 1");
while($row = mysql_fetch_assoc($result)) {
$message = strip_tags($row['post']);
$message = str_replace("\\r\\n","<br>", $message);
$id = (int)$row['id'];
echo '<table width="100%" cellpadding="5" cellspacing="0" class="guestbook">
<tr>
<td width="70%"><span class="blue"><u>' . htmlentities($row['name'], ENT_QUOTES) . '</u></span></td>
<td width="30%" align="right"><em>';
if($language == "de") {
echo date('d.m.Y - H:i', strtotime($row['date']));
}elseif($language == "en") {
echo date('Y-m-d - H:i', strtotime($row['date'])); }
echo ' ' . $lang['o_clock'] . '</em></td>
</tr>
<tr>
<td colspan="2"><div id="gb_line"> </div></td>
</tr>
<tr>
<td colspan="2">' . badwords(nl2br(stripslashes($message))) . '</td>
</tr>
<tr>
<td colspan="2"><div id="gb_line"> </div></td>
</tr>
<tr>
<td width="70%" height="22" valign="bottom" align="left"><a href="' . htmlentities($row['url'], ENT_QUOTES) . '" target="_blank"><img src="style/buttons/homepage.png" border="0" title="Homepage"></a><a href="mailto:' . htmlentities($row['email'], ENT_QUOTES) . '"><img src="style/buttons/mail.png" hspace="6" border="0" title="E-Mail"></a></td>
<td width="30%" height="22" valign="bottom" align="right"><a href="#top"><img src="style/buttons/top.png" border="0" title="Top"></a></td>
</tr>
</table>';
}
echo '<div id="more' . $id . '" class="morebox">
<a href="#" id="' . $id . '" class="more">' . $lang['more'] . '</a>
</div>';
}
?>