Last updated 13 September 2006. Created on 13 September 2006.
Edited by greggles. Log in to edit this page.

Displays a list of (x) users who have recently updated their blog with most recent udpates at top. Could also be used to find users who have recently edited any kind of node.

$sql = "SELECT DISTINCT(n.uid), u.name FROM {node} n JOIN {users} u USING(uid) WHERE type = 'blog' ORDER BY n.changed DESC LIMIT 10";
$results = db_query($sql);
$items = array();
while ( $data = db_fetch_object($results) ) {
  $items[] = l($data->name, "blog/$data->uid");
}

if ( count($items) ) {
  print theme('item_list', $items);
}

PLEASE NOTE! The above snippet is user submitted. Use at your own risk! For users who have setup drupal using an alternate database to the default (MYSQL), please note that the snippets may contain some database queries specific to MYSQL.

NEVER just copy paste without looking at what it does, a user could potentially add a snippet that wipes your complete database!

Looking for support? Visit the Drupal.org forums, or join #drupal-support in IRC.