• I’m trying to create a page showing list of users. Unfortunately, the only data that’s showing is the url and the login. What am I doing wrong? Help!!

    <?php
    $order = ‘user_nicename’;
    $users = $wpdb->get_results(“SELECT * FROM $wpdb->users ORDER BY $order”); // query users
    foreach($users as $user) : // start users’ profile “loop”
    ?>
    <?php echo $user->user_url; ?>
    <?php echo $user->user_login; ?>
    <?php echo $user->user_firstname; ?>
    <?php echo $user->user_lastname; ?>
    <?php echo $user->user_nickname; ?>
    <?php echo $user->user_email; ?>
    <?php echo ” — “; ?>
    <?php echo $user->user_description; ?>
    <?php echo $user->user_icq; ?>
    <?php echo $user->user_aim; ?>
    <?php echo $user->user_msn; ?>
    <?php echo $user->user_yim; ?>
    <?php echo $user->user_nicename; ?>
    <?php echo “

    “; ?>
    <?php
    endforeach; // end of the users’ profile ‘loop’
    ?>

Viewing 6 replies - 1 through 6 (of 6 total)
  • Thread Starter realsole

    (@realsole)

    I think I’ve narrowed the problem down, but don’t know how to resolve it.

    The data that shows (user_login and user_url and user_email) are in the wpdb database titled user. (PS: In the previous post, I forgot to mention that user_email does show).

    All the other data that does not show is not in the user table of the data base and instead, is in the usermeta table of the data base.

    Being a total newbie at php and mysql, I have no clue how to resolve this. Please help!!

    Thread Starter realsole

    (@realsole)

    I tried el-aleph, but I simply cannot understand what he’s saying. There are no screenshots, no examples. It assumes I understand php (which I don’t). There is no straightforward explanation in plain English.

    Then, I tried cimy. That is even more advanced gobbledegook for me. I’m totally lost. I’ve never felt more stupid.

    Isn’t there anybody out there who will be kind enough to just look at the code above and help me with it … or walk me through what I need to do step by step, in plain English? Please?

    Give me a bit of time and i’ll install it, i’m sure it’s easy enough….

    If it’s straight-forward enough i’ll write a brief run down on what to do..

    I think you’re right, the documentation on how to actually use the plugin is very poor. Installation was easy peasy though…

    It’s installed, but it’s pretty useless since there is no clear indication on how to use it…

    The userlist comes up emtpy, and i created a few extra users to test.. stil empty….

    I copied the example template files into my theme, but again it gives no clear instructions on how you call these files.

    Shame the plugin isn’t as well documented as WordPress, or it’d be a great little plugin..

    I’m going to give up on it. It’s not that i can’t figure it out, it’s that i have no intention of wasting hours of time figuring out how to use a plugin that should be self-explanatory.

    I might want one for my site at some point though, so if i find something better i’ll post a link, but for now i can’t find much covering creating a simple members list…

    Hiya
    This maybe a bit late to help you but this is very similar to what you are doing and works fine even when pulling in data from the usermeta, it even gets data from the register plus plugin.

    I use the code below to pull in the users company name and city. the only problem with it is that it is supposed to order the user list by the company name in ASC alphabetical order but it dosent 🙁 its probably something really simple im missing (if anyone can help would be very happy), but if you need to use it it will order the list by user name or anything standard

    <?php $szSort = 'company_name';?>
    
    <?php $aUsersID = $wpdb->get_col( $wpdb->prepare("SELECT $wpdb->users.ID FROM $wpdb->users ORDER BY %s ASC", $szSort ));
    
    foreach ( $aUsersID as $iUserID ) :
    
    $user = get_userdata( $iUserID );
    
    ?>
    <?php if($user->wp_user_level == 2) { ?>
    
    <a href="<?php bloginfo('siteurl'); ?>/author/<?php echo ucwords( ( $user->user_login ) ); ?>"> <?php echo '<li>' . ucwords( ( $user->company_name ) ) . ' - '; ?></a> <?php echo '' . ucwords( ( $user->city ) ) . '</li>';
    }
    endforeach; // end the users loop.
    ?>
Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘showing user list’ is closed to new replies.