Members Only
15th Feb 2007Posted in: Members Only 0
Roster (for members only)

/*
Set the $order variable to whatever you want to sort the authors'
list on. You can use any users table column name; examples are:
'ID', 'user_nicename', 'user_login', 'user_url', 'display_name',
and 'dateYMDhour' (registration date).
*/
?>
global $wpdb, $table_prefix; // set global WP vars needed for script

$order = 'user_nicename'; // set order for users table query
$user_ids = $wpdb->get_col(“SELECT ID FROM $wpdb->users ORDER BY $order”); // query users

foreach($user_ids as $user_id) : // start authors’ profile “loop”

$user = get_userdata($user_id); // retrieve author (i.e. user) details
$level = $table_prefix . ‘user_level’; // set ‘user_level’ usermeta meta_key record
$user->user_level = $user->$level; // assign ‘user_level’ property to $users
$role = $table_prefix . ‘capabilities’; // set ‘role’ usermeta table meta_key record
$user->role = array_keys($user->$role); // assign ‘role’ property to $user
$user->role = $user->role[0]; // make sure $user->role is not an array
?>
/*
This is the authors' profile 'loop'. It displays info from the
profile for every author, along with a few bits of other author-
related data. Feel free to add, subtract, change layout; whatever
you'd like.

These 'tags' will display "publically accessable" user info; what
is displayed by each is hopefully self-explanatory:

aim; ?>
description; ?>
display_name; ?>
first_name; ?>
jabber; ?>
icq; ?>
ID; ?>
last_name; ?>
msn; ?>
nickname; ?>
role; ?>
user_email; ?>
user_level; ?>
user_login; ?>
user_nicename; ?>
user_registered; ?>
user_url; ?>
yim; ?>
*/
?>
/*
if(('admin' != $user->user_login) && ($user->wp_user_level > 0)) :
Tests for accounts that are not ‘admin’ or above ‘subscriber’ role.

To display the admin account, comment out or remove the first ‘if’
line and uncomment the one right after it.

The additional variations for the if statement listed below can be
used if you want to check whether the user is assigned the role of
‘author’, or author/contributor.

Default roles you can work with here are:

subscriber
contributor
author
editor
administrator

If you’re using a plugin that lets you create custom roles, these
should work with it as well.

Finally, if you want to display absolutely every user on your blog,
use something like:

if( $user->user_login ) :

*/
?>
// if( ('admin' != $user->user_login) && ($user->user_level > 0) ) :
// if( $user->user_level > 0 ) : // show all users above the role of ‘subscriber’
// if( $user->role == ‘author’ ) : // show only users with a role of ‘author’
if( $user->role == ‘editor’ ) : // show only users with a role of ‘subscriber’
// if( ($user->role == ‘subscriber’) || ($user->role == ‘editor’) ) : // show users with role of ‘author’ or ‘subscriber’
// if( ($user->role == ‘author’) || ($user->role == ‘contributor’) ) : // show users with role of ‘author’ or ‘contributor’
?>

biz_description; ?>

/*
if($user->description)
Tests for and displays user description (i.e. Profile).
*/
?>
/*
if($user->user_email)
Tests for and displays email; uses WP’s antispambot() function
to encode the address so it’s displayed in browser but not read
by emailbots.
*/
?>
user_email) : ?>user_url; ?>”>user_url; ?>

contact_address) : ?>contact_address; ?>

contact_city) : ?>contact_city; ?>contact_state) : ?> contact_state; ?> contact_zip) : ?>contact_zip; ?>
contact_phone_o) : ?>
O: contact_phone_o; ?>
contact_phone_c) : ?>
C: contact_phone_c; ?>
contact_phone_f) : ?>
F: contact_phone_f; ?>
contact_phone_h) : ?>
Home: contact_phone_h; ?>

bni_trigger_1) : ?>

What are some “trigger” questions or statements that we can listen for to help bring you business?

bni_power_team) : ?>BNI Power Team: bni_power_team; ?>
bni_member_since) : ?>BNI Member Since: bni_member_since; ?>

endif; // end of admin and user_level test
endforeach; // end of authors' profile 'loop'
?>

Leave a Reply