<div class="content_box">
<div class="content_box_header">
<div class="title">Notes</div>
</div>
<!-- Available NOTES 
Page Submitted (Page Title)
Page Accepted
Page status changed
Page rank (Daily, Weekly, Monthly)
Custom page notes
-->

<?php 

/////////////// NEW NOTES

$userId = $_SESSION['id'];

if ($_SESSION['priv'] != 'Superadmin') {
	$addUserView = " WHERE n.Public = 1 OR n.Id IN (SELECT NoteId FROM user_note WHERE UserId = '$userId' ) ";
} else {
	$addUserView = ' ';
}

$res = mysql_query ("SELECT n.PageId, n.Date, n.Content, p.Title, n.Public, p.Verified FROM note AS n JOIN page AS p ON n.PageId=p.Id ".$addUserView." ORDER BY n.Date DESC LIMIT 0, 5 ");
$nr = mysql_num_rows ($res);
while ($nr>0) {
	$row = mysql_fetch_array ($res);
	extract ($row);
	?>
    <div class="content_box_custom">
    <div class="date"><?php echo formatDate($Date); ?></div>
    <div class="title">
	<?php if ($Verified == 1) { ?>
		<a href="?page=page&id=<?php echo $PageId; ?>#notes"><?php echo $Title; ?></a><?php } else { echo $Title; } ?>
    </div> 
	<div class="description"><?php echo $Content; ?></div>	
    </div>
	<?php
    $nr--;	
}
?>

<div class="content_box_footer">
<a href="?page=notes">View All</a>
</div>

</div>

