Changeset 3153
- Timestamp:
- 08/01/2010 10:48:30 AM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/1.2/bp-blogs.php
r3143 r3153 440 440 * @global object $wpdb 441 441 * @global $bp $bp 442 * @param <type>$comment_id443 * @param <type>$is_approved444 * @return <type>442 * @param int $comment_id 443 * @param bool $is_approved 444 * @return mixed 445 445 */ 446 446 447 function bp_blogs_record_comment( $comment_id, $is_approved = true ) { 447 448 global $wpdb, $bp; … … 451 452 452 453 // Don't record activity if the comment hasn't been approved 453 if ( !$is_approved || true !=$recorded_comment->comment_approved )454 if ( !$is_approved || !$recorded_comment->comment_approved ) 454 455 return false; 455 456 … … 463 464 464 465 // If there's no registered user id, don't record activity 465 if ( !$user_id)466 if ( empty( $user_id ) ) 466 467 return false; 467 468 … … 474 475 475 476 // Get activity related links 476 $post_permalink 477 $comment_link 477 $post_permalink = get_permalink( $recorded_comment->comment_post_ID ); 478 $comment_link = htmlspecialchars( get_comment_link( $recorded_comment->comment_ID ) ); 478 479 479 480 // Prepare to record in activity streams 480 $activity_action = sprintf( __( '%s commented on the blog post %s', 'buddypress' ), bp_core_get_userlink( $user_id ), '<a href="' . $post_permalink . '">' . $recorded_comment->post->post_title. '</a>' );481 $activity_action = sprintf( __( '%s commented on the blog post %s', 'buddypress' ), bp_core_get_userlink( $user_id ), '<a href="' . $post_permalink . '">' . apply_filters( 'the_title', $recorded_comment->post->post_title ) . '</a>' ); 481 482 $activity_content = $recorded_comment->comment_content; 482 483 483 484 // Record in activity streams 484 485 bp_blogs_record_activity( array( 485 'user_id' 486 'action' 487 'content' 488 'primary_link' 489 'type' 490 'item_id' 491 'secondary_item_id' 492 'recorded_time' 486 'user_id' => $user_id, 487 'action' => apply_filters( 'bp_blogs_activity_new_comment_action', $activity_action, &$recorded_comment, $comment_link ), 488 'content' => apply_filters( 'bp_blogs_activity_new_comment_content', $activity_content, &$recorded_comment, $comment_link ), 489 'primary_link' => apply_filters( 'bp_blogs_activity_new_comment_primary_link', $comment_link, &$recorded_comment ), 490 'type' => 'new_blog_comment', 491 'item_id' => $blog_id, 492 'secondary_item_id' => $comment_id, 493 'recorded_time' => $recorded_comment->comment_date_gmt 493 494 ) ); 494 495
Note: See TracChangeset
for help on using the changeset viewer.