<div class="content_box">
<div class="content_box_header"><a href="?page=pages&orby=day_desc">Top 5 Daily</a></div>
<?php
$res = mysql_query ("SELECT p.Id, p.Link, p.Title, p.Image, p.Category, p.Public, r.Date, r.DailyFans, r.WeeklyFans, r.MonthlyFans, r.TotalFans, r.PageId FROM page AS p JOIN report AS r ON p.Id = r.PageId WHERE " . $viewPrivatePages . " r.TotalFans <> 0 AND p.Verified = 1 AND DATE(r.Date) = (SELECT MAX(DATE(Date)) FROM report) ORDER BY DailyFans DESC LIMIT 0, 5 ") or die ("error");
$nr = mysql_num_rows ($res);
while ($nr > 0) {
	$row = mysql_fetch_array ($res);
	extract ($row);
	?>
	<?php if ($Public != '1') { ?>
    <div class="private_content_box">
    <?php } ?>
    
    <div class="content_box_item">
    
	<div class="avatar"><a href="index.php?page=page&id=<?php echo $Id;?>"><img src="<?php echo $Image; ?>" alt="<?php echo $Title; ?>" width="50" height="50" /></a></div>
	<div class="description">
	<div class="title"><a href="index.php?page=page&id=<?php echo $Id;?>"><?php echo $Title; ?></a></div>
    <div class="category">- <?php echo $Category; ?></div>
	</div>
	<div class="fans">
	<?php if ($DailyFans < 0 ) { ?><div class="negative"><?php } else { ?><div class="positive">+<?php } ?>
	<?php echo number_format($DailyFans, 0, ',', '.'); ?></div>
	<div class="total"><?php echo number_format($TotalFans, 0, ',', '.'); ?></div>
    </div>
    </div>
    <?php if ($Public != 1) { ?>
    </div>
    <?php } ?>
    <?php
	$nr--;
}
	?>
<div class="content_box_footer"><a href="?page=pages&orby=day_desc">View all</a></div>    
</div>
