WordPress.org

Support

Support » Multisite » [Resolved] Multisite list users

[Resolved] Multisite list users

  • publicradio
    Member

    @publicradio

    Hello,

    I am looking for a way to have, on my main blog a directory of all users on the other blogs. It would go like this:

    USER DIRECTORY

    -Blog 1

    –Administrators
    —(list out admins)

    –Contributors
    —(list out contributors

    ———————————

    -Blog 2

    –Administrators
    —(list out admins)

    –Contributors
    —(list out contributors

    Could someone point me in the right direction on this? Thanks so much.

Viewing 3 replies - 1 through 3 (of 3 total)
  • http://wordpress.org/extend/plugins/members-list/ would be it for per-site users, I think.

    You’d have to extend that to all sites somehow.

    Custom. very very custom work. 🙂

    Go get blog 1 details, pull list of users. go get blog 2 details, pull list of users.

    Cache results so it’s not looping thru every blog on every load of this page.

    publicradio
    Member

    @publicradio

    Here’s a function I wrote that works

    function rolodex($blognumber,$content = null) {
    
          extract(shortcode_atts(array( "blognumber" => 'blognumber' ), $blognumber));
    
          $rolodex = '<a name="'.$content.'"></a><table class="full"><caption>'.$content.'</caption>
          <thead><th> </th>
          <th nowrap="nowrap">First Name</th>
          <th>Last Name</th>
          <th>Phone number</th>
          <th>eMail</th>
          <th>Emergency contact</th>
          <th>Emergency phone</th>
          </thead><tbody>';
        $blogusers = get_users('blog_id='.$blognumber.'&orderby=nicename&role=author');
        foreach ($blogusers as $user) {
          $rolodex .= '<tr>';
          $userdat = get_userdata($user->ID);
          $rolodex .= '<td>'.get_avatar($user->ID,52).'</td>';
          $rolodex .= '<td>'.$userdat->first_name .'</td>';
          $rolodex .= '<td>'.$userdat->last_name.'</td>';
          $rolodex .= '<td nowrap="nowrap">'.$userdat->phonenumber.'</td>';
          $rolodex .= '<td><a href="mailto:'.$user->user_email.'">'.$user->user_email.'</a></td>';
          $rolodex .= '<td>'.$userdat->{'911contact'}.'</td>';
          $rolodex .= '<td>'.$userdat->{'911phonenumber'}.'</td>';
          $rolodex .= '</tr>';
        }
          $rolodex .= '</tbody>';
          $rolodex .= '</table>';
          return $rolodex;
        }
      add_shortcode('rolodex', 'rolodex');

    With this you go into a page and add [rolodex blognumber=”2″]First Blog[/rolodex] and it spits out a directory.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘[Resolved] Multisite list users’ is closed to new replies.