<?php
$id = (int)$_SESSION['id'];
$sql = "SELECT * FROM guestbook WHERE id2 = '" . $id . "' ORDER BY id DESC";
$result = mysql_query($sql) OR die(mysql_error());
if(intval(mysql_num_rows($result)) == 0) {
echo '<p class="false">' . $lang['no_gb_entries'] . '</p>';
}else{
while($row = mysql_fetch_assoc($result)) {
include_once('framework/filter.php');
include_once('framework/functions/badwords.php');
include_once('framework/functions/smileys.php');
echo '<table width="100%" cellpadding="5" cellspacing="0" class="guestbook">
<tr>
<td width="70%"><u>' . htmlentities($row['name'], ENT_QUOTES) . '</u></td>
<td width="30%" align="right"><small>';
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'] . '</small> <a href="management.php?site=delete&id=' . (int)$row['id'] . '&id2=' . $id . '"><img src="style/icons/delete.png" border="0" title="' . $lang['delete_gb_entry'] . '"></a></td>
</tr>
<tr>
<td colspan="2"><div id="gb_line"> </div></td>
</tr>
<tr>
<td colspan="2">' . mysql_filter(filter_html(badwords(smileys(stripslashes(nl2br($row['post'])))))) . '</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>';
}
}
?>