Changeset 360780
- Timestamp:
- 03/16/2011 03:23:56 PM (15 years ago)
- Location:
- author-avatars/trunk/lib
- Files:
-
- 2 edited
-
AuthorAvatarsForm.class.php (modified) (1 diff)
-
UserList.class.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
author-avatars/trunk/lib/AuthorAvatarsForm.class.php
r256994 r360780 328 328 'random' => __('Random', 'author-avatars'), 329 329 'user_id' => __('User Id', 'author-avatars'), 330 ); 331 if (AA_is_bp()) { 332 $order_options['recent_activity'] = __('Recent Activity', 'author-avatars'); 333 } 330 'recent_activity' => __('Recent Activity', 'author-avatars'), 331 ); 334 332 335 333 $attributes = array( -
author-avatars/trunk/lib/UserList.class.php
r343338 r360780 731 731 * Returns the time of last activity for a given user. 732 732 * 733 * This requires that BuddyPress is installed. 734 * If it's not available the function returns an empty string. 733 * If BuddyPress is available this function uses the `last_activity` meta 734 * data value maintained by BuddyPress. Otherwise it returns the date of 735 * the latest post or page published by the given user. 735 736 * 736 737 * @param int $user_id … … 741 742 return gmdate( 'Y-m-d H:i:s', (int)get_usermeta( $user_id, 'last_activity' ) ); 742 743 } 743 return ""; 744 else { 745 global $wpdb; 746 $query = 'SELECT `post_date` FROM `wp_posts` WHERE `post_status` = "publish" AND `post_author` = ' . $user_id . ' ORDER BY `post_date` DESC LIMIT 1'; 747 return $wpdb->get_var($query); 748 } 744 749 } 745 750
Note: See TracChangeset
for help on using the changeset viewer.