<?php
/*
Template Name: All Members Template
*/
?>
<?php get_header(); ?>

<div id="main">

<div class="grids_box_sidebar"><div class="widget-title"><h1><?php _e('All members', 'Gameleon'); ?></h1></div></div>

<div class="block">
<div class="grid-category-page">

<?php

// Get the authors from the database ordered by user nicename
	global $wpdb;
	$query = "SELECT ID, user_nicename from $wpdb->users ORDER BY user_nicename";
	$author_ids = $wpdb->get_results($query);

// Loop through each author
	foreach($author_ids as $author) :

	// Get user data
		$curauth = get_userdata($author->ID);

 

		// Get link to author page
			$user_link = get_author_posts_url($curauth->ID);

		// Set default avatar (values = default, wavatar, identicon, monsterid)
			$avatar = 'wavatar';
?>

<!-- FULL PROFILE START -->
<div class="profile_fourth">

<a href="<?php echo $user_link; ?>" title="<?php echo $curauth->display_name; ?>">
<div class="profile-avatar">
<?php echo get_avatar($curauth->user_email, '96', $avatar); ?>
</div>
</a>
<p class="top-prof"><?php if ($curauth->first_name && $curauth->last_name): ?>
<?php echo $curauth->first_name; ?> <?php echo $curauth->last_name; ?>
 <?php else: ?>
<?php echo $curauth->nickname; ?>
<?php endif; ?></p>
<p><a href="<?php echo $user_link; ?>" title="<?php echo $curauth->display_name; ?>" rel="nofollow" ><?php _e('View Profile', 'Gameleon'); ?></a></p>

</div>
<!-- FULL PROFILE END -->

<?php endforeach; ?>
 
</div>
<?php kriesi_pagination($pages = '', $range = 2); ?>
</div>
</div>
<?php get_sidebar(); ?>
<?php get_footer(); ?>