Changeset 2055
- Timestamp:
- 10/26/2009 05:31:43 PM (15 years ago)
- Location:
- trunk
- Files:
-
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-activity/bp-activity-filters.php
r1925 r2055 3 3 /* Apply WordPress defined filters */ 4 4 add_filter( 'bp_get_activity_content', 'bp_activity_filter_kses', 1 ); 5 add_filter( 'bp_get_activity_content', 'bp_activity_filter_kses', 1 ); 6 5 7 add_filter( 'bp_get_activity_content', 'force_balance_tags' ); 6 8 add_filter( 'bp_get_activity_content', 'wptexturize' ); -
trunk/bp-activity/bp-activity-templatetags.php
r1980 r2055 352 352 else 353 353 unset($selected); 354 355 $component_name = attribute_escape( $component_name ); 354 356 355 357 switch ( $style ) { … … 379 381 $translatable_component_names = array( __( 'profile', 'buddypress'), __( 'friends', 'buddypress' ), __( 'groups', 'buddypress' ), __( 'status', 'buddypress' ), __( 'blogs', 'buddypress' ) ); 380 382 381 $component_links[] = $before . '<a href="' . $link. '">' . ucwords( __( $component_name, 'buddypress' ) ) . '</a>' . $after;383 $component_links[] = $before . '<a href="' . attribute_escape( $link ) . '">' . ucwords( __( $component_name, 'buddypress' ) ) . '</a>' . $after; 382 384 } 383 385 … … 385 387 386 388 if ( isset( $_GET['afilter'] ) ) 387 $component_links[] = '<' . $tag . ' id="afilter-clear"><a href="' . $link. '"">' . __( 'Clear Filter', 'buddypress' ) . '</a></' . $tag . '>';389 $component_links[] = '<' . $tag . ' id="afilter-clear"><a href="' . attribute_escape( $link ) . '"">' . __( 'Clear Filter', 'buddypress' ) . '</a></' . $tag . '>'; 388 390 389 391 return apply_filters( 'bp_get_activity_filter_links', implode( "\n", $component_links ) ); -
trunk/bp-blogs.php
r1995 r2055 309 309 } 310 310 311 function bp_blogs_record_blog( $blog_id, $user_id, $no_activity = false ) {311 function bp_blogs_record_blog( $blog_id, $user_id, $no_activity = true ) { 312 312 global $bp; 313 313 … … 329 329 330 330 /* Only record this activity if the blog is public */ 331 if ( (int)$_POST['blog_public'] && !$no_activity ) {331 if ( (int)$_POST['blog_public'] || !$no_activity ) { 332 332 /* Record this in activity streams */ 333 333 bp_blogs_record_activity( array( … … 352 352 if ( !$user_id ) 353 353 $user_id = (int)$post->post_author; 354 355 354 356 355 /* This is to stop infinate loops with Donncha's sitewide tags plugin */ 357 if ( (int)get_site_option( 'tags_blog_id') == (int)$blog_id )356 if ( (int)get_site_option( 'tags_blog_id' ) == (int)$blog_id ) 358 357 return false; 359 358 … … 375 374 bp_blogs_update_blogmeta( $recorded_post->blog_id, 'last_activity', time() ); 376 375 377 $post_permalink = bp_post_get_permalink( $post, $blog_id ); 378 379 $activity_content = sprintf( __( '%s wrote a new blog post: %s', 'buddypress' ), bp_core_get_userlink( (int)$post->post_author ), '<a href="' . $post_permalink . '">' . $post->post_title . '</a>' ); 380 $activity_content .= "<blockquote>" . bp_create_excerpt( $post->post_content ) . "</blockquote>"; 376 if ( (int)get_blog_option( $blog_id, 'blog_public' ) ) { 377 /* Record this in activity streams */ 378 $post_permalink = bp_post_get_permalink( $post, $blog_id ); 379 380 $activity_content = sprintf( __( '%s wrote a new blog post: %s', 'buddypress' ), bp_core_get_userlink( (int)$post->post_author ), '<a href="' . $post_permalink . '">' . $post->post_title . '</a>' ); 381 $activity_content .= "<blockquote>" . bp_create_excerpt( $post->post_content ) . "</blockquote>"; 381 382 382 /* Record this in activity streams */383 bp_blogs_record_activity( array(384 'user_id' => (int)$post->post_author,385 'content' => apply_filters( 'bp_blogs_activity_new_post', $activity_content, &$post, $post_permalink ),386 'primary_link' => apply_filters( 'bp_blogs_activity_new_post_primary_link', $post_permalink, $post_id ),387 'component_action' => 'new_blog_post',388 'item_id' => $recorded_post_id,389 'recorded_time' => strtotime( $post->post_date )390 ) );383 bp_blogs_record_activity( array( 384 'user_id' => (int)$post->post_author, 385 'content' => apply_filters( 'bp_blogs_activity_new_post', $activity_content, &$post, $post_permalink ), 386 'primary_link' => apply_filters( 'bp_blogs_activity_new_post_primary_link', $post_permalink, $post_id ), 387 'component_action' => 'new_blog_post', 388 'item_id' => $recorded_post_id, 389 'recorded_time' => strtotime( $post->post_date ) 390 )); 391 } 391 392 } 392 393 } else { … … 408 409 bp_blogs_record_post( $post_id ); 409 410 } 410 411 /* Now re-record the post in the activity streams */ 412 $post_permalink = bp_post_get_permalink( $post, $blog_id ); 413 414 415 $activity_content = sprintf( __( '%s wrote a new blog post: %s', 'buddypress' ), bp_core_get_userlink( (int)$post->post_author ), '<a href="' . $post_permalink . '">' . $post->post_title . '</a>' ); 416 $activity_content .= "<blockquote>" . bp_create_excerpt( $post->post_content ) . "</blockquote>"; 417 418 /* Record this in activity streams */ 419 bp_blogs_record_activity( array( 420 'user_id' => (int)$post->post_author, 421 'content' => apply_filters( 'bp_blogs_activity_new_post', $activity_content, &$post, $post_permalink ), 422 'primary_link' => apply_filters( 'bp_blogs_activity_new_post_primary_link', $post_permalink, $post_id ), 423 'component_action' => 'new_blog_post', 424 'item_id' => $existing_post->id, 425 'recorded_time' => strtotime( $post->post_date ) 426 ) ); 411 412 if ( (int)get_blog_option( $blog_id, 'blog_public' ) ) { 413 /* Now re-record the post in the activity streams */ 414 $post_permalink = bp_post_get_permalink( $post, $blog_id ); 415 416 $activity_content = sprintf( __( '%s wrote a new blog post: %s', 'buddypress' ), bp_core_get_userlink( (int)$post->post_author ), '<a href="' . $post_permalink . '">' . $post->post_title . '</a>' ); 417 $activity_content .= "<blockquote>" . bp_create_excerpt( $post->post_content ) . "</blockquote>"; 418 419 /* Record this in activity streams */ 420 bp_blogs_record_activity( array( 421 'user_id' => (int)$post->post_author, 422 'content' => apply_filters( 'bp_blogs_activity_new_post', $activity_content, &$post, $post_permalink ), 423 'primary_link' => apply_filters( 'bp_blogs_activity_new_post_primary_link', $post_permalink, $post_id ), 424 'component_action' => 'new_blog_post', 425 'item_id' => $existing_post->id, 426 'recorded_time' => strtotime( $post->post_date ) 427 ) ); 428 } 427 429 } 428 430 … … 458 460 bp_blogs_update_blogmeta( $recorded_comment->blog_id, 'last_activity', time() ); 459 461 460 $comment_link = bp_post_get_permalink( $comment->post, $recorded_comment->blog_id ); 461 $activity_content = sprintf( __( '%s commented on the blog post %s', 'buddypress' ), bp_core_get_userlink( $user_id ), '<a href="' . $comment_link . '#comment-' . $comment->comment_ID . '">' . $comment->post->post_title . '</a>' ); 462 $activity_content .= '<blockquote>' . bp_create_excerpt( $comment->comment_content ) . '</blockquote>'; 463 464 /* Record this in activity streams */ 465 bp_blogs_record_activity( array( 466 'user_id' => $recorded_comment->user_id, 467 'content' => apply_filters( 'bp_blogs_activity_new_comment', $activity_content, &$comment, &$recorded_comment, $comment_link ), 468 'primary_link' => apply_filters( 'bp_blogs_activity_new_comment_primary_link', $comment_link, &$comment, &$recorded_comment ), 469 'component_action' => 'new_blog_comment', 470 'item_id' => $comment_id, 471 'secondary_item_id' => $recorded_comment->blog_id, 472 'recorded_time' => $recorded_comment->date_created 473 ) ); 474 462 if ( (int)get_blog_option( $recorded_comment->blog_id, 'blog_public' ) ) { 463 /* Record in activity streams */ 464 $comment_link = bp_post_get_permalink( $comment->post, $recorded_comment->blog_id ); 465 $activity_content = sprintf( __( '%s commented on the blog post %s', 'buddypress' ), bp_core_get_userlink( $user_id ), '<a href="' . $comment_link . '#comment-' . $comment->comment_ID . '">' . $comment->post->post_title . '</a>' ); 466 $activity_content .= '<blockquote>' . bp_create_excerpt( $comment->comment_content ) . '</blockquote>'; 467 468 /* Record this in activity streams */ 469 bp_blogs_record_activity( array( 470 'user_id' => $recorded_comment->user_id, 471 'content' => apply_filters( 'bp_blogs_activity_new_comment', $activity_content, &$comment, &$recorded_comment, $comment_link ), 472 'primary_link' => apply_filters( 'bp_blogs_activity_new_comment_primary_link', $comment_link, &$comment, &$recorded_comment ), 473 'component_action' => 'new_blog_comment', 474 'item_id' => $comment_id, 475 'secondary_item_id' => $recorded_comment->blog_id, 476 'recorded_time' => $recorded_comment->date_created 477 ) ); 478 } 479 475 480 return $recorded_comment; 476 481 } … … 489 494 bp_blogs_delete_activity( array( 'item_id' => $comment_id, 'secondary_item_id' => $recorded_comment->blog_id, 'component_name' => $bp->blogs->slug, 'component_action' => 'new_blog_comment' ) ); 490 495 491 $comment_link = bp_post_get_permalink( $comment->post, $recorded_comment->blog_id ); 492 $activity_content = sprintf( __( '%s commented on the blog post %s', 'buddypress' ), bp_core_get_userlink( $recorded_comment->user_id ), '<a href="' . $comment_link . '#comment-' . $comment->comment_ID . '">' . $comment->post->post_title . '</a>' ); 493 $activity_content .= '<blockquote>' . bp_create_excerpt( $comment->comment_content ) . '</blockquote>'; 494 495 /* Record this in activity streams */ 496 bp_blogs_record_activity( array( 497 'user_id' => $recorded_comment->user_id, 498 'content' => apply_filters( 'bp_blogs_activity_new_comment', $activity_content, &$comment, &$recorded_comment, $comment_link ), 499 'primary_link' => apply_filters( 'bp_blogs_activity_new_comment_primary_link', $comment_link, &$comment, &$recorded_comment ), 500 'component_action' => 'new_blog_comment', 501 'item_id' => $comment_id, 502 'secondary_item_id' => $recorded_comment->blog_id, 503 'recorded_time' => $recorded_comment->date_created 504 ) ); 496 if ( (int)get_blog_option( $recorded_comment->blog_id, 'blog_public' ) ) { 497 /* Record in activity streams */ 498 $comment_link = bp_post_get_permalink( $comment->post, $recorded_comment->blog_id ); 499 $activity_content = sprintf( __( '%s commented on the blog post %s', 'buddypress' ), bp_core_get_userlink( $recorded_comment->user_id ), '<a href="' . $comment_link . '#comment-' . $comment->comment_ID . '">' . $comment->post->post_title . '</a>' ); 500 $activity_content .= '<blockquote>' . bp_create_excerpt( $comment->comment_content ) . '</blockquote>'; 501 502 /* Record this in activity streams */ 503 bp_blogs_record_activity( array( 504 'user_id' => $recorded_comment->user_id, 505 'content' => apply_filters( 'bp_blogs_activity_new_comment', $activity_content, &$comment, &$recorded_comment, $comment_link ), 506 'primary_link' => apply_filters( 'bp_blogs_activity_new_comment_primary_link', $comment_link, &$comment, &$recorded_comment ), 507 'component_action' => 'new_blog_comment', 508 'item_id' => $comment_id, 509 'secondary_item_id' => $recorded_comment->blog_id, 510 'recorded_time' => $recorded_comment->date_created 511 ) ); 512 } 505 513 } 506 514 add_action( 'wp_set_comment_status', 'bp_blogs_approve_comment', 10, 2 ); … … 514 522 function bp_blogs_add_user_to_blog( $user_id, $role, $blog_id ) { 515 523 if ( $role != 'subscriber' ) { 516 bp_blogs_record_blog( $blog_id, $user_id , $no_activity = true);524 bp_blogs_record_blog( $blog_id, $user_id ); 517 525 } 518 526 } -
trunk/bp-blogs/bp-blogs-classes.php
r1905 r2055 181 181 bp_blogs_setup_globals(); 182 182 183 like_escape($letter);183 $letter = like_escape( $wpdb->escape( $letter ) ); 184 184 185 185 if ( $limit && $page ) { … … 199 199 bp_blogs_setup_globals(); 200 200 201 like_escape($filter);201 $filter = like_escape( $wpdb->escape( $filter ) ); 202 202 203 203 if ( $limit && $page ) { -
trunk/bp-core.php
r2035 r2055 66 66 if ( !defined( 'BP_HOME_BLOG_SLUG' ) ) 67 67 define( 'BP_HOME_BLOG_SLUG', 'blog' ); 68 69 /* Register BuddyPress themes contained within the theme folder */ 70 if ( function_exists( 'register_theme_folder' ) ) 71 register_theme_folder( 'buddypress/bp-themes' ); 68 72 69 73 … … 626 630 ); 627 631 632 /*** 633 * If this nav item is hidden for the displayed user, and 634 * the logged in user is not the displayed user 635 * looking at their own profile, don't create the nav item. 636 */ 637 if ( !$show_for_displayed_user && !bp_is_home() ) 638 return false; 639 628 640 /*** 629 * If we are not viewing a user, and this is a root component, don't attach the630 * default subnav function so we can display a directory or something else.631 */641 * If we are not viewing a user, and this is a root component, don't attach the 642 * default subnav function so we can display a directory or something else. 643 */ 632 644 if ( bp_core_is_root_component( $slug ) && !$bp->displayed_user->id ) 633 645 return; -
trunk/bp-core/bp-core-classes.php
r2005 r2055 220 220 return false; 221 221 222 like_escape($letter);222 $letter = like_escape( $wpdb->escape( $letter ) ); 223 223 224 224 $total_users_sql = apply_filters( 'bp_core_users_by_letter_count_sql', $wpdb->prepare( "SELECT DISTINCT count(u.ID) FROM " . CUSTOM_USER_TABLE . " u LEFT JOIN {$bp->profile->table_name_data} pd ON u.ID = pd.user_id LEFT JOIN {$bp->profile->table_name_fields} pf ON pd.field_id = pf.id WHERE u.spam = 0 AND u.deleted = 0 AND u.user_status = 0 AND pf.name = %s AND pd.value LIKE '$letter%%' ORDER BY pd.value ASC", BP_XPROFILE_FULLNAME_FIELD_NAME ), $letter ); … … 240 240 $pag_sql = $wpdb->prepare( " LIMIT %d, %d", intval( ( $page - 1 ) * $limit), intval( $limit ) ); 241 241 242 like_escape($search_terms);242 $search_terms = like_escape( $wpdb->escape( $search_terms ) ); 243 243 244 244 $total_users_sql = apply_filters( 'bp_core_search_users_count_sql', "SELECT DISTINCT count(u.ID) as user_id FROM " . CUSTOM_USER_TABLE . " u LEFT JOIN {$bp->profile->table_name_data} pd ON u.ID = pd.user_id WHERE u.spam = 0 AND u.deleted = 0 AND u.user_status = 0 AND pd.value LIKE '%%$search_terms%%' ORDER BY pd.value ASC", $search_terms ); -
trunk/bp-friends/bp-friends-classes.php
r1905 r2055 150 150 $user_id = $bp->loggedin_user->id; 151 151 152 like_escape($filter);152 $filter = like_escape( $wpdb->escape( $filter ) ); 153 153 154 154 if ( $limit && $page ) … … 222 222 global $wpdb, $bp; 223 223 224 like_escape($filter);224 $filter = like_escape( $wpdb->escape( $filter ) ); 225 225 $usermeta_table = $wpdb->base_prefix . 'usermeta'; 226 226 $users_table = $wpdb->base_prefix . 'users'; … … 247 247 global $wpdb, $bp; 248 248 249 like_escape($filter);249 $filter = like_escape( $wpdb->escape( $filter ) ); 250 250 $usermeta_table = $wpdb->prefix . 'usermeta'; 251 251 $users_table = $wpdb->base_prefix . 'users'; -
trunk/bp-groups/bp-groups-classes.php
r1929 r2055 247 247 $user_id = $bp->displayed_user->id; 248 248 249 like_escape($filter);249 $filter = like_escape( $wpdb->escape( $filter ) ); 250 250 251 251 if ( $limit && $page ) … … 269 269 global $wpdb, $bp; 270 270 271 like_escape($filter);271 $filter = like_escape( $wpdb->escape( $filter ) ); 272 272 273 273 if ( $limit && $page ) … … 463 463 $hidden_sql = $wpdb->prepare( " AND status != 'hidden'"); 464 464 465 like_escape($letter);466 465 $letter = like_escape( $wpdb->escape( $letter ) ); 466 467 467 if ( $limit && $page ) { 468 468 $pag_sql = $wpdb->prepare( " LIMIT %d, %d", intval( ( $page - 1 ) * $limit), intval( $limit ) ); … … 699 699 700 700 if ( $filter ) { 701 like_escape($filter);701 $filter = like_escape( $wpdb->escape( $filter ) ); 702 702 $filter_sql = " AND ( g.name LIKE '{$filter}%%' OR g.description LIKE '{$filter}%%' )"; 703 703 } … … 719 719 720 720 if ( $filter ) { 721 like_escape( $filter);721 like_escape( $wpdb->escape( $filter ) ); 722 722 $filter_sql = " AND ( g.name LIKE '{$filter}%%' OR g.description LIKE '{$filter}%%' )"; 723 723 } … … 739 739 740 740 if ( $filter ) { 741 like_escape($filter);741 $filter = like_escape( $wpdb->escape( $filter ) ); 742 742 $filter_sql = " AND ( g.name LIKE '{$filter}%%' OR g.description LIKE '{$filter}%%' )"; 743 743 } … … 759 759 760 760 if ( $filter ) { 761 like_escape($filter);761 $filter = like_escape( $wpdb->escape( $filter ) ); 762 762 $filter_sql = " AND ( g.name LIKE '{$filter}%%' OR g.description LIKE '{$filter}%%' )"; 763 763 } … … 779 779 780 780 if ( $filter ) { 781 like_escape($filter);781 $filter = like_escape( $wpdb->escape( $filter ) ); 782 782 $filter_sql = " AND ( g.name LIKE '{$filter}%%' OR g.description LIKE '{$filter}%%' )"; 783 783 } … … 799 799 800 800 if ( $filter ) { 801 like_escape($filter);801 $filter = like_escape( $wpdb->escape( $filter ) ); 802 802 $filter_sql = " AND ( g.name LIKE '{$filter}%%' OR g.description LIKE '{$filter}%%' )"; 803 803 } -
trunk/bp-groups/bp-groups-templatetags.php
r2032 r2055 1650 1650 function bp_get_new_group_description() { 1651 1651 global $bp; 1652 return apply_filters( 'bp_get_new_group_description', $bp->groups->current_group-> name);1652 return apply_filters( 'bp_get_new_group_description', $bp->groups->current_group->description ); 1653 1653 } 1654 1654 … … 1658 1658 function bp_get_new_group_news() { 1659 1659 global $bp; 1660 return apply_filters( 'bp_get_new_group_news', $bp->groups->current_group->n ame);1660 return apply_filters( 'bp_get_new_group_news', $bp->groups->current_group->news ); 1661 1661 } 1662 1662 -
trunk/bp-themes/bp-sn-parent/_inc/js/ajax.js
r2031 r2055 79 79 page = page.split('upage='); 80 80 81 if ( !j("input#selected_letter").val() )81 if ( undefined === j("input#selected_letter").val() ) 82 82 var letter = ''; 83 83 else 84 84 var letter = j("input#selected_letter").val(); 85 85 86 if ( !j("input#search_terms").val() )86 if ( undefined === j("input#search_terms").val() ) 87 87 var search_terms = ''; 88 88 else … … 333 333 page = page.split('gpage='); 334 334 335 if ( !j("input#selected_letter").val() )335 if ( undefined === j("input#selected_letter").val() ) 336 336 var letter = ''; 337 337 else 338 338 var letter = j("input#selected_letter").val(); 339 339 340 if ( !j("input#search_terms").val() )340 if ( undefined === j("input#search_terms").val() ) 341 341 var search_terms = ''; 342 342 else … … 973 973 ); 974 974 975 j("form#status-update-form").livequery('submit',976 function() {977 j.post( ajaxurl, {978 action: 'status_new_status',979 'cookie': encodeURIComponent(document.cookie),980 '_wpnonce': j('input#_wpnonce_add_status').val(),981 'status-update-input': j('#status-update-input').val()982 },983 function(response) {984 if ( response == "1" ) {985 j("div#user-status").slideUp(400,986 function() {987 j.post( ajaxurl, {988 action: 'status_show_status',989 'cookie': encodeURIComponent(document.cookie)990 },991 function(response) {992 j("div#user-status").html(response);993 j("div#user-status").slideDown(400);994 j(window).unbind('click');995 });996 }997 );998 }999 });1000 1001 return false;1002 }1003 );1004 1005 975 j("a#status-clear-status").livequery('click', 1006 976 function() { … … 1094 1064 page = page.split('bpage='); 1095 1065 1096 if ( !j("input#selected_letter").val() )1066 if ( undefined === j("input#selected_letter").val() ) 1097 1067 var letter = ''; 1098 1068 else 1099 1069 var letter = j("input#selected_letter").val(); 1100 1070 1101 if ( !j("input#search_terms").val() )1071 if ( undefined === j("input#search_terms").val() ) 1102 1072 var search_terms = ''; 1103 1073 else -
trunk/bp-themes/bp-sn-parent/wire/post-form.php
r1905 r2055 38 38 39 39 <input type="submit" name="wire-post-submit" id="wire-post-submit" value="<?php _e( 'Post »', 'buddypress' ) ?>" /> 40 <input type="hidden" name="bp_wire_item_id" id="bp_wire_item_id" value="<?php echo bp_get_wire_item_id() ?>" />41 40 42 41 <?php wp_nonce_field( 'bp_wire_post' ) ?> -
trunk/bp-themes/bp-sn-parent/wire/post-list.php
r1905 r2055 59 59 60 60 <?php do_action( 'bp_after_wire_post_list' ) ?> 61 61 62 <input type="hidden" name="bp_wire_item_id" id="bp_wire_item_id" value="<?php echo bp_get_wire_item_id() ?>" /> 62 63 </div> 63 64 <?php else: ?>
Note: See TracChangeset
for help on using the changeset viewer.