1) { // if an image has been assigned to the article $right_image="imagegallery/".$v[4]."-tn.jpg"; $image_id=$v[4]; } switch($v[0]) { case "preschool": $color="#F5801C"; break; case "elementary": $color="#35A039"; break; case "senior": $color="#C70B22"; break; default: $color="#0863AA"; break; } print "

$v[2]

$v[3]

"; } } else { print "

No article with that id

"; } } else { print "

Schoolwide

Pre-school

Elementary

Senior

"; $location=SelectQuery("articles","distinct location"); // get the location so that we can sort by this $alloweddate=mktime(0, 0, 0, date("m")-2, date("d"), date("Y")); // only display articles that are older than 2 months old //$alloweddate=date("F d Y",$alloweddate); // format this date to use in the query foreach($location as $x) { $values=SelectQuery("articles","location,date,title,summary,image,id","where location='$x[0]' and live=1 and date <= '$alloweddate'","order by idate desc"); //printarray($values); if(is_array($values)) { foreach($values as $v) { // format the posted date //$date=strtotime($v[1]); $posted_date=date("M d, Y",$v[1]); if(strlen($v[4]) > 1) { // if an image has been assigned to the article $right_image="imagegallery/".$v[4]."-tn.jpg"; $image_id=$v[4]; } switch($v[0]) { case "preschool": $color="#F5801C"; break; case "elementary": $color="#35A039"; break; case "senior": $color="#C70B22"; break; default: $color="#0863AA"; break; } print "

$v[2]

Posted: $posted_date
$v[3] read more...

"; } } else { print " No articles are available in the archive for ".ucfirst($x[0])."
"; } } } ?>