Location: PHPKode > projects > SiteX > guestbook.php
<?PHP
ob_start();
session_start();

include("includes/globals.php.inc");
include("includes/functions.php");
include("lang/English.php");
if(strtolower($sxSetup['Language']) != 'english') include("lang/".$sxSetup['Language'].".php");
include("themes/$THEME_FOLDER/config.php.inc");

protectComponentPage(3);

$sxTitleAddendum = getComponentName("3");
include("themes/$THEME_FOLDER/header.php");
?>
<div class="bodyWrapper">
  <h1><?PHP echo getComponentName("3"); ?></h1>
  <?PHP echoMessage($message); ?>
  <div style="text-align:right;font-weight:bold;"><a href="guestbook_sign.php"><?PHP echo $sxLang['GuestbookSign']; ?></a></div>
  <?PHP
	if($sxSetup['GuestbookApproval'] == 1) $appr = "WHERE approved='1'";
	$query = "SELECT * FROM $DB_Guestbook $appr ORDER BY timestamp DESC";
	$result = mysql_query($query, $Link) or queryError("10", mysql_error());
	while($ROW = mysql_fetch_object($result)){
		echo '<p><strong>';
		if($ROW->email) echo "<a href=\"mailto:$ROW->email\" rel=\"nofollow\">";
		echo $ROW->name;
		if($ROW->email) echo "</a>"."\n";
		echo '</strong>';
		if($ROW->website){
			echo ' <a href="';
			if((substr($ROW->website, 0, 7) == 'http://')OR(substr($ROW->website, 0, 8) == 'https://')) echo $ROW->website;
			else echo 'http://'.$ROW->website;
			echo '" rel="nofollow" target="_blank">(' . $sxLang['Website'] . ')</a>'."\n";
		}
		echo '<br /><strong><span class="shadowText">' . fetchDate($ROW->timestamp, 1, 1) . '</span></strong>'."\n";
		echo '<br />' . nl2br($ROW->message) . '</p><br />'."\n";
	}
	if(mysql_num_rows($result) == 0) echo '<em>' . $sxLang['NoEntries'] . '</em>'."\n";
  ?>
  </div>
<?PHP
include("themes/$THEME_FOLDER/footer.php");
ob_end_flush();
?>
Return current item: SiteX