Public feed
#889684
<?
mysql_connect("localhost", "copperle_admin", "family");
mysql_select_db("copperle_family");
$sql = "SELECT * FROM imagedata WHERE date > ".(time()-30*24*60*60)." ORDER BY date DESC";
$result = mysql_query($sql);
$array = array();
while($row = mysql_fetch_assoc($result))
$array[] = $row;
$ids = array();
for($i = 0; count($ids) < 4; $i++)
{
$entry = $array[rand(0, count($array)-1)];
if(!array_key_exists($entry['date'], $ids))
$ids[$entry['date']] = $entry;
}
foreach($ids as $value) {
echo "<img class="recentImageList" src="$value[thumb_path]" />";
}
?>