Drupal Block Snippet: Zuletzt aktualisierte Buchseiten

Tagged:  •    •    •    •    •    •  

Mit diesem Code wird eine Liste der 5 zuletzt aktualisierten Buchseiten erzeugt, die z.B. in einem Block angezeigt werden kann.

<?php
$sql = "SELECT n.nid, n.title FROM {node} n INNER JOIN {node_revisions} nr ON nr.nid = n.nid WHERE n.status = 1 AND n.type ='book' ORDER BY nr.timestamp DESC";
$result = db_query_range(db_rewrite_sql($sql, 'n'), 0, 5);
if (db_num_rows($result)) {
  return node_title_list($result);
} 
?>

Post new comment

The content of this field is kept private and will not be shown publicly.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd> <p> <br>

More information about formatting options