Hi Friends,
I want to display user pictures in "Who's New" instead of user names.How can I get this one.Missed the flow.help me.

Comments

casey’s picture

You have several options, some are:

1. Create a new block using php format. This is the easiest I think. something like:

if (user_access('access content')) {
  $result = db_query_range('SELECT uid, name FROM {users} WHERE status != 0 AND access != 0 ORDER BY created DESC', 0, variable_get('user_block_whois_new_count', 5));
  while ($account = db_fetch_object($result)) {
    echo theme_user_picture($account);
  }
}

2. Create a custom module to do this trick

3. override theme_user_list in your theme (for phptemplate themes put this function in template.php). something like:

function yourthemesname_user_list($users, $title = NULL) {
  if (!empty($users)) {
    foreach ($users as $user) {
      $items[] = theme_user_picture($account);
    }
  }
  return theme('item_list', $items, $title);
}
dlearner’s picture

thank u casey,
displayed pictures in who's new block.but here how can i fix the width of the picture.actually images are overlapped on one by one.how can I solve this one

drupallearner