Mon cinéma
Last updated: novembre 24th, 2010
term_relationships tr, $wpdb->term_taxonomy tt , $wpdb->posts
LEFT JOIN $wpdb->postmeta pm1 ON (ID = pm1.post_id AND pm1.meta_key = ‘Rating’)
WHERE tr.object_id = ID
AND tr.term_taxonomy_id = tt.term_taxonomy_id
AND tt.term_id = 11
ORDER BY post_date DESC »;
$items = mysql_query($sql);
$count = mysql_num_rows($items);
define(‘MAX_COVERS_PER_ROW’, 5);
$covers = array();
while ($item = mysql_fetch_array($items)) {
$title = strip_tags($item[« title »]);
$rating = $item[« rating »] ? $item[« rating »] : 0 ;
$tableau = ‘
if (‘publish’ == $item[« status »]) {
$tableau .= ‘‘;
}
$tableau .= ‘‘;
if (‘publish’ == $item[« status »]) {
$tableau .= ‘‘;
}
$tableau .= ‘
‘;
$covers[] = $tableau;
}
if ($count % MAX_COVERS_PER_ROW) $covers = array_merge(array_fill(0, MAX_COVERS_PER_ROW – $count % MAX_COVERS_PER_ROW, ‘
‘), $covers);
$y = 0;
$table = ‘
‘;
echo $table;
?>