[buddypress-dev] List of users with avatar

Martin martin at thrive-magazine.com
Tue Jul 15 19:18:42 GMT 2008


Something along the lines of:

<?php

$sql = $wpdb->prepare( "SELECT id FROM $wpdb->users ORDER BY user_registered
DESC LIMIT 0, %d", 5 );

$users = $wpdb->get_results( $sql );

 

// These lines generate our output. 

?>

<div class="widget"><h2 class="slat-title">New Users</h2>

<ul class="userlist">

<?php

foreach($users as $user) 

{

  $user_info = get_userdata($user->id);

  $blog = get_active_blog_for_user($user->id)

?>   

  <li class="users">

    <div class="thumb_user">

      <a href="<?php echo $blog->siteurl; ?>" title="<?php echo
$user_info->display_name ?>"><?php get_avatar($user->id); ?></a>

    </div>

    <div class="text">

      <a href="<?php echo $blog->siteurl; ?>"><?php echo
$user_info->display_name ?></a>

    </div>

    <div class="clear" />

  </li>    

<?php

}

?>

</ul>

 

 

Should work if you add it to your template.

 

Martin

 

 

 

From: buddypress-dev-bounces at lists.automattic.com
[mailto:buddypress-dev-bounces at lists.automattic.com] On Behalf Of Brian L.
Brey
Sent: Tuesday, July 15, 2008 11:31 AM
To: buddypress-dev at lists.automattic.com
Subject: [buddypress-dev] List of users with avatar 

 

Hey Martin, 

Any way I can bypass the Widget and use it directly within my template?

Thank you!
-- 

Brian 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://comox.textdrive.com/pipermail/buddypress-dev/attachments/20080715/68cc226e/attachment-0001.htm


More information about the buddypress-dev mailing list