GitHub Sale: sign up for any paid plan this week and pay nothing until January 1, 2009!  [ hide ]

public
Description: Shows a directory of authors and their personal info
Homepage: http://wordpress.org/extend/plugins/warp-user-profile-extension/
Clone URL: git://github.com/koke/warp-userprofile.git
Click here to lend your support to: warp-userprofile and make a donation at www.pledgie.com !
Implemented local image display


git-svn-id: 
http://svn.wp-plugins.org/warp-user-profile-extension/trunk@47893 
b8457f37-d9ea-0310-8a92-e5e31aec5664
koke (author)
Mon May 26 09:49:10 -0700 2008
commit  6b9f817ab72bd4f9efdfa873707c63b7297455b3
tree    4d944c48090ce115ffeb7547a3d477ba72612cee
parent  e70a94207f7d058b72877fd7e1686dbe8d5b3c28
...
4
5
6
7
 
8
9
10
11
12
13
 
14
15
16
...
4
5
6
 
7
8
9
10
11
12
 
13
14
15
16
0
@@ -4,13 +4,13 @@
0
   <h2><?php echo get_the_title(get_option('warp_userprofile_page')); ?></h2>
0
   <?php
0
     echo get_query_var('person');
0
- $users = get_users_of_blog();
0
+ $users = Warp_Userprofile::get_users_of_blog();
0
     foreach ($users as $user) {      
0
       if (get_usermeta($user->user_id, 'warp_up_public') == 1):
0
       // var_dump($user);
0
       ?>
0
       <div class="profile">
0
- <div class="avatar"><?php echo get_avatar($user->user_email, 48); ?></div>
0
+ <div class="avatar"><?php echo Warp_Userprofile::avatar_for($user); ?></div>
0
         <h3 class='name'><a href="<?php echo Warp_Userprofile::permalink() . $user->user_login; ?>"><?php echo $user->display_name; ?></a></h3>
0
         <h4 class='title'><?php echo get_usermeta($user->user_id, 'warp_up_title'); ?></h4>
0
       </div>
...
12
13
14
15
 
16
17
18
...
12
13
14
 
15
16
17
18
0
@@ -12,7 +12,7 @@
0
       <?php endif; ?>
0
     </div>
0
     <div class="profile">
0
- <div class="avatar"><?php echo get_avatar($user->user_email, 48); ?></div>
0
+ <div class="avatar"><?php echo Warp_Userprofile::avatar_for($user); ?></div>
0
       <h2 class='name'><?php echo $user->display_name; ?></h2>
0
       <h3 class='title'><?php echo get_usermeta($user->ID, 'warp_up_title'); ?></h3>
0
       <div class="bio">
...
219
220
221
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
222
223
224
225
...
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
0
@@ -219,6 +219,31 @@ class Warp_UserProfile
0
     return $out;
0
   }
0
   
0
+ function avatar_for($user)
0
+ {
0
+ if ( $image = glob(ABSPATH . 'wp-content/authors/' . $user->user_login . '-*.jpg') )
0
+ {
0
+ $image = current($image);
0
+ $site_url = trailingslashit(get_option('siteurl'));
0
+ return '<img src="'
0
+ . str_replace(ABSPATH, $site_url, $image)
0
+ . '"'
0
+ . ' alt="" class="avatar avatar-48" height="48" width="48"'
0
+ . ' />';
0
+ }
0
+ else
0
+ {
0
+ return get_avatar($user->user_email, 48);
0
+ }
0
+ }
0
+
0
+ function get_users_of_blog( $id = '' ) {
0
+ global $wpdb, $blog_id;
0
+ if ( empty($id) )
0
+ $id = (int) $blog_id;
0
+ $users = $wpdb->get_results( "SELECT user_id, user_login, display_name, user_email, meta_value FROM $wpdb->users, $wpdb->usermeta WHERE " . $wpdb->users . ".ID = " . $wpdb->usermeta . ".user_id AND meta_key = '" . $wpdb->prefix . "capabilities' ORDER BY {$wpdb->users}.display_name" );
0
+ return $users;
0
+ }
0
 }
0
 
0
 Warp_UserProfile::init();
0
\ No newline at end of file

Comments

    No one has commented yet.