scene.org awards |
$sql = " SELECT *,prods.id as id, ".
" g1.name as groupn1,g1.acronym as groupacron1, ".
" g2.name as groupn2,g2.acronym as groupacron2, ".
" g3.name as groupn3,g3.acronym as groupacron3, ".
" prods.name as name, ".
" GROUP_CONCAT(platforms.name) as platform, sceneorgrecommended.type as sotype ".
" FROM sceneorgrecommended,prods ".
" JOIN prods_platforms JOIN platforms ".
" LEFT JOIN groups AS g1 ON prods.group1 = g1.id".
" LEFT JOIN groups AS g2 ON prods.group2 = g2.id".
" LEFT JOIN groups AS g3 ON prods.group3 = g3.id".
" WHERE sceneorgrecommended.prodid = prods.id ".
" AND sceneorgrecommended.type != 'viewingtip'".
" AND prods_platforms.prod=prods.id ".
" AND prods_platforms.platform=platforms.id ".
" GROUP BY sceneorgrecommended.id ".
" ORDER BY date_format(prods.date,'%Y') DESC,sceneorgrecommended.category,sceneorgrecommended.type";
flush();
$r = mysql_query($sql) or die(mysql_error());
$n = 0;
$y = date("Y")+1;
$c = "";
while($o = mysql_fetch_object($r)) {
$year = date("Y",strtotime($o->date));
if ($year < $y || $c != $o->category) {
if ($year < $y) {
?>
=$year?> |
}
$y = $year;
$c = $o->category;
?>
=$o->category?> |
}
?>
//$o->sotype=="awardwinner"?" style='font-weight:bold;'":""
$typ = explode(",", $o->type);
foreach($typ as $p) {
?>
}
?>
=$o->name?>
|
$a = array();
if ($o->group1) $a[] = sprintf("%s",$o->group1,$o->groupn1);
if ($o->group2) $a[] = sprintf("%s",$o->group2,$o->groupn2);
if ($o->group3) $a[] = sprintf("%s",$o->group3,$o->groupn3);
echo implode(" :: ",$a);
?>
|
$platforms = explode(",", $o->platform);
foreach($platforms as $p) {
?>
}
?>
|
}
?>
|
|