[#] Blok - Ostatnio modyfikowane (Drupal)

( Ostatnio zmieniony pon., 16/06/2008 - 10:59 )
 
<?php
  /* CONF */

    $limit = variable_get('last_modified_limit', 5);

  /* END CONF */

  // use db_rewrite_sql for api compliance
  $sql = db_rewrite_sql('
    SELECT n.nid, n.title, n.changed , n.created FROM {node} n
    WHERE n.status = 1 AND n.created <> n.changed
    ORDER BY n.changed DESC
  ');
  $sql = db_query_range($sql, 0, $limit);
  $items = array();
  while ($node = db_fetch_object($sql)) {
    $items[] = l($node->title, 'node/'.$node->nid) .' '. theme('mark', node_mark($node->nid, $node->changed));
  }
  // use proper theme function
  if (!empty($items)) {
    return theme('item_list', $items);
  }
?>
5
Twoja ocena: Brak Średnio: 5 (1 vote)