Changeset 463
- Timestamp:
- 10/30/2008 10:24:01 AM (18 years ago)
- Location:
- trunk
- Files:
-
- 11 edited
-
bp-blogs.php (modified) (3 diffs)
-
bp-core.php (modified) (1 diff)
-
bp-core/bp-core-ajax.php (modified) (1 diff)
-
bp-core/bp-core-classes.php (modified) (1 diff)
-
bp-core/bp-core-templatetags.php (modified) (1 diff)
-
bp-core/bp-core-widgets.php (modified) (1 diff)
-
bp-friends.php (modified) (1 diff)
-
bp-friends/bp-friends-templatetags.php (modified) (1 diff)
-
bp-groups.php (modified) (4 diffs)
-
bp-groups/bp-groups-ajax.php (modified) (1 diff)
-
bp-xprofile.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-blogs.php
r461 r463 201 201 return false; 202 202 203 return bp_core_get_userlink($blog->user_id) . ' ' . __('created a new blog:', 'buddypress') . ' <a href="' . get_blog_option( $blog->blog_id, 'siteurl' ) . '">' . get_blog_option( $blog->blog_id, 'blogname' ) . '</a><span class="time-since">%s</span>';203 return sprintf( __( '%s created a new blog: %s', 'buddypress' ), bp_core_get_userlink($blog->user_id), '<a href="' . get_blog_option( $blog->blog_id, 'siteurl' ) . '">' . get_blog_option( $blog->blog_id, 'blogname' ) . '</a>' ) . ' <span class="time-since">%s</span>'; 204 204 break; 205 205 case 'new_blog_post': … … 214 214 return false; 215 215 216 $content = bp_core_get_userlink($post->post_author) . ' ' . __('wrote a new blog post', 'buddypress') . ' <a href="' . bp_post_get_permalink( $post, $post->blog_id ) . '">' . $post->post_title . '</a><span class="time-since">%s</span>';216 $content = sprintf( __( '%s wrote a new blog post:', 'buddypress' ), bp_core_get_userlink($post->post_author), '<a href="' . bp_post_get_permalink( $post, $post->blog_id ) . '">' . $post->post_title . '</a>' ) . ' <span class="time-since">%s</span>'; 217 217 $content .= '<blockquote>' . bp_create_excerpt($post->post_content) . '</blockquote>'; 218 218 return $content; … … 229 229 230 230 $comment = BP_Blogs_Comment::fetch_comment_content($comment); 231 $content = bp_core_get_userlink($comment->user_id) . ' ' . __('commented on the blog post ', 'buddypress') . ' <a href="' . bp_post_get_permalink( $comment->post, $comment->blog_id ) . '#comment-' . $comment->comment_ID . '">' . $comment->post->post_title . '</a><span class="time-since">%s</span>';231 $content = sprintf( __( '%s commented on the blog post %s', 'buddypress' ), bp_core_get_userlink($comment->user_id), '<a href="' . bp_post_get_permalink( $comment->post, $comment->blog_id ) . '#comment-' . $comment->comment_ID . '">' . $comment->post->post_title . '</a>' ) . ' <span class="time-since">%s</span>'; 232 232 $content .= '<blockquote>' . bp_create_excerpt($comment->comment_content) . '</blockquote>'; 233 233 return $content; -
trunk/bp-core.php
r457 r463 841 841 * @uses bp_core_time_since() This function will return an English representation of the time elapsed. 842 842 */ 843 function bp_core_get_last_activity( $last_activity_date, $ before, $after) {843 function bp_core_get_last_activity( $last_activity_date, $string ) { 844 844 if ( !$last_activity_date || $last_activity_date == '' ) { 845 845 $last_active = __('not recently active', 'buddypress'); 846 846 } else { 847 $last_active = $before;848 849 847 if ( strstr( $last_activity_date, '-' ) ) { 850 $last_active .= bp_core_time_since( strtotime( $last_activity_date ) );848 $last_active = bp_core_time_since( strtotime( $last_activity_date ) ); 851 849 } else { 852 $last_active .= bp_core_time_since( $last_activity_date );850 $last_active = bp_core_time_since( $last_activity_date ); 853 851 } 854 852 855 $last_active .= $after;853 $last_active = sprintf( $string, $last_active ); 856 854 } 857 855 -
trunk/bp-core/bp-core-ajax.php
r436 r463 34 34 <?php 35 35 if ( $_POST['filter'] == 'newest-members') { 36 echo bp_core_get_last_activity( $user->user_registered, __( 'registered ', 'buddypress'), __(' ago', 'buddypress') );36 echo bp_core_get_last_activity( $user->user_registered, __( 'registered %s ago', 'buddypress' ) ); 37 37 } else if ( $_POST['filter'] == 'recently-active-members') { 38 echo bp_core_get_last_activity( get_usermeta( $user->user_id, 'last_activity' ), __( 'active ', 'buddypress'), __(' ago', 'buddypress') );38 echo bp_core_get_last_activity( get_usermeta( $user->user_id, 'last_activity' ), __( 'active %s ago', 'buddypress' ) ); 39 39 } else if ( $_POST['filter'] == 'popular-members') { 40 40 if ( get_usermeta( $user->user_id, 'total_friend_count' ) == 1 ) -
trunk/bp-core/bp-core-classes.php
r439 r463 65 65 $this->fullname = bp_core_get_userlink( $this->id, true ); 66 66 $this->email = bp_core_get_user_email( $this->id ); 67 $this->last_active = bp_core_get_last_activity( get_usermeta( $this->id, 'last_activity' ), __('active '), __('ago') );67 $this->last_active = bp_core_get_last_activity( get_usermeta( $this->id, 'last_activity' ), __('active %s ago') ); 68 68 69 69 if ( function_exists('xprofile_install') ) { -
trunk/bp-core/bp-core-templatetags.php
r446 r463 241 241 $user_id = $bp['current_userid']; 242 242 243 $last_activity = bp_core_get_last_activity( get_usermeta( $user_id, 'last_activity' ), __('active ', 'buddypress'), __('ago', 'buddypress') );243 $last_activity = bp_core_get_last_activity( get_usermeta( $user_id, 'last_activity' ), __('active %s ago', 'buddypress') ); 244 244 245 245 if ( $echo ) -
trunk/bp-core/bp-core-widgets.php
r436 r463 114 114 <div class="item"> 115 115 <div class="item-title"><?php echo bp_core_get_userlink( $user->user_id ) ?></div> 116 <div class="item-meta"><span class="activity"><?php echo bp_core_get_last_activity( $user->user_registered, __('registered ', 'buddypress'), __('ago', 'buddypress') ) ?></span></div>116 <div class="item-meta"><span class="activity"><?php echo bp_core_get_last_activity( $user->user_registered, __('registered %s ago', 'buddypress') ) ?></span></div> 117 117 </div> 118 118 </li> -
trunk/bp-friends.php
r462 r463 221 221 222 222 if ( $for_secondary_user ) { 223 return bp_core_get_userlink( $friendship->initiator_user_id ) . ' ' . __('and', 'buddypress') . ' ' . bp_core_get_userlink($friendship->friend_user_id, false, false, true) . ' ' . __('are now friends', 'buddypress') . '.<span class="time-since">%s</span>';223 return sprintf( __( '%s and %s are now friends', 'buddypress' ), bp_core_get_userlink( $friendship->initiator_user_id ), bp_core_get_userlink($friendship->friend_user_id, false, false, true) ) . ' <span class="time-since">%s</span>'; 224 224 } else { 225 return bp_core_get_userlink( $friendship->friend_user_id ) . ' ' . __('and', 'buddypress') . ' ' . bp_core_get_userlink($friendship->initiator_user_id) . ' ' . __('are now friends', 'buddypress') . '.<span class="time-since">%s</span>';225 return sprintf( __( '%s and %s are now friends', 'buddypress' ), bp_core_get_userlink( $friendship->friend_user_id ), bp_core_get_userlink($friendship->initiator_user_id) ) . ' <span class="time-since">%s</span>'; 226 226 } 227 227 -
trunk/bp-friends/bp-friends-templatetags.php
r436 r463 242 242 243 243 if ( $friends_template->friendship->date_created != "0000-00-00 00:00:00" ) { 244 echo __('requested', 'buddypress') . ' ' . bp_core_time_since( strtotime( $friends_template->friendship->date_created ) ) . ' ' . __('ago', 'buddypress');244 echo sprintf( __( 'requested %s ago', 'buddypress' ), bp_core_time_since( strtotime( $friends_template->friendship->date_created ) ) ); 245 245 } 246 246 } -
trunk/bp-groups.php
r453 r463 543 543 544 544 function groups_format_activity( $item_id, $action, $for_secondary_user = false ) { 545 global $bp ;545 global $bp, $current_user; 546 546 547 547 switch( $action ) { … … 552 552 return false; 553 553 554 return bp_core_get_userlink($bp['current_userid']) . ' ' . __('joined the group', 'buddypress') . ' ' . '<a href="' . $bp['current_domain'] . $bp['groups']['slug'] . '/' . $group->slug . '">' . $group->name . '</a>.<span class="time-since">%s</span>';554 return sprintf( __('%s joined the group %s', 'buddypress'), bp_core_get_userlink($current_user->id), '<a href="' . site_url() . $bp['groups']['slug'] . '/' . $group->slug . '">' . $group->name . '</a>' ) . ' <span class="time-since">%s</span>'; 555 555 break; 556 556 case 'created_group': … … 560 560 return false; 561 561 562 return bp_core_get_userlink($bp['current_userid']) . ' ' . __('created the group', 'buddypress') . ' ' . '<a href="' . $bp['current_domain'] . $bp['groups']['slug'] . '/' . $group->slug . '">' . $group->name . '</a>.<span class="time-since">%s</span>';562 return sprintf( __('%s created the group %s', 'buddypress'), bp_core_get_userlink($current_user->id), '<a href="' . site_url() . $bp['groups']['slug'] . '/' . $group->slug . '">' . $group->name . '</a>') . ' <span class="time-since">%s</span>'; 563 563 break; 564 564 case 'new_wire_post': … … 566 566 $group = new BP_Groups_Group( $wire_post->item_id ); 567 567 568 if ( !$group || !$wire_post )568 if ( !$group || !$wire_post || !$wire_post->content ) 569 569 return false; 570 570 571 $content = bp_core_get_userlink($bp['current_userid']) . ' ' . __('wrote on the wire of the group', 'buddypress') . ' ' . '<a href="' . $bp['current_domain'] . $bp['groups']['slug'] . '/' . $group->slug . '">' . $group->name . '</a>:<span class="time-since">%s</span>';571 $content = sprintf ( __('%s wrote on the wire of the group %s', 'buddypress'), bp_core_get_userlink($current_user->id), '<a href="' . site_url() . $bp['groups']['slug'] . '/' . $group->slug . '">' . $group->name . '</a>' ) . ' <span class="time-since">%s</span>'; 572 572 $content .= '<blockquote>' . bp_create_excerpt($wire_post->content) . '</blockquote>'; 573 573 return $content; -
trunk/bp-groups/bp-groups-ajax.php
r431 r463 179 179 <?php 180 180 if ( $_POST['filter'] == 'newest-groups') { 181 echo bp_core_get_last_activity( $group->date_created, __('created ', 'buddypress'), __('ago', 'buddypress') );181 echo bp_core_get_last_activity( $group->date_created, __('created %s ago', 'buddypress') ); 182 182 } else if ( $_POST['filter'] == 'recently-active-groups') { 183 echo bp_core_get_last_activity( groups_get_groupmeta( $group->id, 'last_activity' ), __('active ', 'buddypress'), __('ago', 'buddypress') );183 echo bp_core_get_last_activity( groups_get_groupmeta( $group->id, 'last_activity' ), __('active %s ago', 'buddypress') ); 184 184 } else if ( $_POST['filter'] == 'popular-groups') { 185 185 if ( $group->total_member_count == 1 ) -
trunk/bp-xprofile.php
r462 r463 266 266 267 267 function xprofile_format_activity( $item_id, $action, $for_secondary_user = false ) { 268 global $bp ;268 global $bp, $current_user; 269 269 270 270 switch( $action ) { … … 276 276 277 277 if ( ( $wire_post->item_id == $bp['loggedin_userid'] && $wire_post->user_id == $bp['loggedin_userid'] ) || ( $wire_post->item_id == $bp['current_userid'] && $wire_post->user_id == $bp['current_userid'] ) ) { 278 $content = bp_core_get_userlink($wire_post->user_id) . ' ' . __('wrote on their own wire', 'buddypress') . ': <span class="time-since">%s</span>';278 $content = sprintf( __('%s wrote on their own wire', 'buddypress'), bp_core_get_userlink($wire_post->user_id) ) . ': <span class="time-since">%s</span>'; 279 279 } else if ( ( $wire_post->item_id != $bp['loggedin_userid'] && $wire_post->user_id == $bp['loggedin_userid'] ) || ( $wire_post->item_id != $bp['current_userid'] && $wire_post->user_id == $bp['current_userid'] ) ) { 280 $content = bp_core_get_userlink($wire_post->user_id) . ' ' . __('wrote on ', 'buddypress') . bp_core_get_userlink( $wire_post->item_id, false, false, true, true ) . ' wire: <span class="time-since">%s</span>';280 $content = sprintf( __('%s wrote on %s wire', 'buddypress'), bp_core_get_userlink($wire_post->user_id), bp_core_get_userlink( $wire_post->item_id, false, false, true, true ) ) . ': <span class="time-since">%s</span>'; 281 281 } 282 282 … … 290 290 return false; 291 291 292 return bp_core_get_userlink($bp['current_userid']) . ' ' . __('updated the', 'buddypress') . ' "<a href="' . $bp['current_domain'] . $bp['profile']['slug'] . '">' . $profile_group->name . '</a>" ' . __('information on their profile', 'buddypress') . '.<span class="time-since">%s</span>';292 return sprintf( __('%s updated the "%s" information on their profile', 'buddypress'), bp_core_get_userlink($current_user->id), '<a href="' . $bp['current_domain'] . $bp['profile']['slug'] . '">' . $profile_group->name . '</a>' ) . ' <span class="time-since">%s</span>'; 293 293 break; 294 294 }
Note: See TracChangeset
for help on using the changeset viewer.