Drupal snippet php - Ultimi 3 link di una o più tassonomie

<?php
// comma separated lists of terms tid to display nodes
$terms = "13,17,18";

// the number of nodes to show
$count = 3;

$sql = "SELECT n.title, n.nid FROM {node} n INNER JOIN {term_node} tn ON n.nid = tn.nid WHERE tn.tid in ($terms) AND n.status=1 ORDER BY n.created DESC";
$result = db_query_range(db_rewrite_sql($sql), 0, $count);
if ($result) {
return node_title_list($result);
}
return t('No nodes available.');
?>