Location: PHPKode > projects > SiteX > admin/comment_preview.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");
if((!userEditor())AND(!userAdmin()))  loginError($sxLang['LoginRequired']);
if((userEditor())AND(!$sxSetup['EditorRightsCommentsManager']))  loginError($sxLang['LoginRequired']);

if(!$entryid)
{
	header("Location: comments_manager.php");
	die();
}

$query = "SELECT * FROM $DB_Comments WHERE id='$entryid'";
$result = mysql_query($query, $Link) or queryError("10", mysql_error());
$ROW = mysql_fetch_object($result);

$sxTitleAddendum = $sxLang['AdminHeading'];
include("../themes/$THEME_FOLDER/header.php");
?>
<script language="JavaScript" type="text/JavaScript">
<!--
function confirmDelete(theID,theName){
	if(confirm("<?PHP echo $sxLang['GeneralJSDeleteEntry1']; ?> '"+theName+"' <?PHP echo $sxLang['GeneralJSDeleteEntry2']; ?>")){
		window.location='<?PHP print "comments_manager.php?delete="; ?>'+theID;
	}
}
//-->
</script>     
<div class="bodyWrapper">
   <h1 class="sxAdminHeading"><?PHP echo $sxLang['CommentsPreviewHeading']; ?></h1>
   <div class="sxAdminBreadcrumbs"><?PHP if(userAdmin()) { ?><a href="index.php"><?PHP echo $sxLang['AdminBreadcrumb']; ?><?PHP }?><?PHP if(userEditor()) { ?><a href="editor_index.php"><?PHP echo $sxLang['EditorBreadcrumb']; ?><?PHP }?></a> > <a href="comments_manager.php"><?PHP echo $sxLang['CommentsManageHeading']; ?></a> > <?PHP echo $sxLang['CommentsPreviewHeading']; ?></div>
   <?PHP echoMessage($message); ?>
   <?PHP
   
   echo '<p>' . $sxLang['CommentsManageTableOptions'] . ': ';
   
	if($ROW->approved == 1)
	{
		echo '<a href="comments_manager.php?unapprove=' . $ROW->id . '">'."\n";
		echo '<img alt="' . $sxLang['CommentsManageApproved'] . '" src="../images/check.gif" style="border: 0;" /></a>'."\n";
	}
	else
	{
		echo '<a href="comments_manager.php?approve=' . $ROW->id . '">'."\n";
		echo '<img alt="' . $sxLang['CommentsManageUnapproved'] . '" src="../images/x.gif" style="border: 0;" /></a>'."\n";
	}
			echo '         <a href="';
		
	switch($ROW->sectionid)
	{
		// Journal
		case 1 :
			
			$count = 0; $pageNew = 1;
			
			$query3 = "SELECT * FROM $DB_Journal ORDER BY timestamp DESC";
			$result3 = mysql_query($query3, $Link) or queryError("406", mysql_error());
			while($ROW3 = mysql_fetch_object($result3))
			{
				$count = $count + 1;
				if($ROW3->id == $ROW->rowid)
					$jCount = $count;
			}
			
			// Find page
			while($jCount > $sxSetup['JournalsPerPage'])
			{
				$jCount = $jCount - $sxSetup['JournalsPerPage'];
				$pageNew = $pageNew + 1;
			}
			
			echo '../journal.php?page=' . $pageNew . '&comments=' . $ROW->rowid . '#' . $ROW->rowid;
			break;
			
		case 2 :
			echo '../photo.php?photoid=' . $ROW->rowid . '&comments=' . $ROW->rowid . '#comments';
			break;
	}
	
	echo '" title="' . $sxLang['ButtonGoTo'] . '"><img src="../images/admin_goto.gif" alt="' . $sxLang['ButtonGoTo'] . '" style="border: 0;" /></a> ';
	echo '           <a href="#" title="' . $sxLang['ButtonDelete'] . '"><img src="../images/admin_delete.gif" alt="' . $sxLang['ButtonDelete'] . '" onclick="confirmDelete(' . $ROW->id . ',\'' . addslashes( htmlspecialchars($ROW->name)) . '\')" style="border: 0;" /></a></p>';

	echo '<p><strong>';
	
	if($ROW->email)
		echo "<a href=\"mailto:$ROW->email\" rel=\"nofollow\">";
		
	echo $ROW->name;
	
	if($ROW->email)
		echo "</a>";
	
	echo '</strong>';
	echo '<br /><strong><span class="shadowText">' . fetchDate($ROW->timestamp, 1, 1) . '</span></strong>';
	echo '<br />' . nl2br($ROW->comments) . '</p><br />';	
  ?>
  </div>
<?PHP
include("../themes/$THEME_FOLDER/footer.php");
ob_end_flush();
?>
Return current item: SiteX