Changeset 1408
- Timestamp:
- 04/27/2009 02:20:42 PM (17 years ago)
- Location:
- trunk
- Files:
-
- 1 deleted
- 22 edited
-
bp-activity/bp-activity-filters.php (modified) (1 diff)
-
bp-activity/bp-activity-templatetags.php (modified) (2 diffs)
-
bp-blogs/bp-blogs-templatetags.php (modified) (6 diffs)
-
bp-core.php (modified) (1 diff)
-
bp-core/bp-core-classes.php (modified) (1 diff)
-
bp-core/bp-core-templatetags.php (modified) (5 diffs)
-
bp-forums/bp-forums-filters.php (modified) (1 diff)
-
bp-forums/bp-forums-templatetags.php (modified) (3 diffs)
-
bp-friends.php (modified) (1 diff)
-
bp-friends/bp-friends-filters.php (deleted)
-
bp-friends/bp-friends-templatetags.php (modified) (1 diff)
-
bp-groups.php (modified) (21 diffs)
-
bp-groups/bp-groups-ajax.php (modified) (4 diffs)
-
bp-groups/bp-groups-filters.php (modified) (1 diff)
-
bp-groups/bp-groups-notifications.php (modified) (4 diffs)
-
bp-groups/bp-groups-templatetags.php (modified) (28 diffs)
-
bp-groups/bp-groups-widgets.php (modified) (1 diff)
-
bp-messages/bp-messages-filters.php (modified) (1 diff)
-
bp-messages/bp-messages-templatetags.php (modified) (8 diffs)
-
bp-wire/bp-wire-filters.php (modified) (1 diff)
-
bp-wire/bp-wire-templatetags.php (modified) (4 diffs)
-
bp-xprofile/bp-xprofile-filters.php (modified) (1 diff)
-
bp-xprofile/bp-xprofile-templatetags.php (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-activity/bp-activity-filters.php
r1366 r1408 2 2 3 3 /* Apply WordPress defined filters */ 4 add_filter( 'bp_ activity_content', 'wptexturize' );4 add_filter( 'bp_get_activity_content', 'wptexturize' ); 5 5 6 add_filter( 'bp_ activity_content', 'convert_smilies' );6 add_filter( 'bp_get_activity_content', 'convert_smilies' ); 7 7 8 add_filter( 'bp_ activity_content', 'convert_chars' );8 add_filter( 'bp_get_activity_content', 'convert_chars' ); 9 9 10 add_filter( 'bp_ activity_content', 'wpautop' );10 add_filter( 'bp_get_activity_content', 'wpautop' ); 11 11 12 add_filter( 'bp_ activity_content', 'stripslashes_deep' );12 add_filter( 'bp_get_activity_content', 'stripslashes_deep' ); 13 13 14 add_filter( 'bp_ activity_content', 'make_clickable' );14 add_filter( 'bp_get_activity_content', 'make_clickable' ); 15 15 16 16 ?> -
trunk/bp-activity/bp-activity-templatetags.php
r1366 r1408 176 176 global $bp_activity_title; 177 177 178 echo apply_filters( 'bp_activities_title', $bp_activity_title ); 179 } 178 echo bp_get_activities_title(); 179 } 180 function bp_get_activities_title() { 181 global $bp_activity_title; 182 183 return apply_filters( 'bp_get_activities_title', $bp_activity_title ); 184 } 180 185 181 186 function bp_activities_no_activity() { 182 187 global $bp_activity_no_activity; 183 echo apply_filters( 'bp_activities_no_activity', $bp_activity_no_activity ); 184 } 188 189 echo bp_get_activities_no_activity(); 190 } 191 function bp_get_activities_no_activity() { 192 global $bp_activity_no_activity; 193 194 return apply_filters( 'bp_get_activities_no_activity', $bp_activity_no_activity ); 195 } 185 196 186 197 function bp_activity_content() { 187 198 global $activities_template; 188 199 189 if ( bp_is_home() && $activities_template->activity_type == 'personal' ) { 190 echo apply_filters( 'bp_activity_content', bp_activity_content_filter( $activities_template->activity->content, $activities_template->activity->date_recorded, $activities_template->full_name ) ); 191 } else { 192 $activities_template->activity->content = bp_activity_insert_time_since( $activities_template->activity->content, $activities_template->activity->date_recorded ); 193 echo apply_filters( 'bp_activity_content', $activities_template->activity->content ); 194 } 195 } 200 echo bp_get_activity_content(); 201 } 202 function bp_get_activity_content() { 203 global $activities_template; 204 205 if ( bp_is_home() && $activities_template->activity_type == 'personal' ) { 206 return apply_filters( 'bp_get_activity_content', bp_activity_content_filter( $activities_template->activity->content, $activities_template->activity->date_recorded, $activities_template->full_name ) ); 207 } else { 208 $activities_template->activity->content = bp_activity_insert_time_since( $activities_template->activity->content, $activities_template->activity->date_recorded ); 209 return apply_filters( 'bp_get_activity_content', $activities_template->activity->content ); 210 } 211 } 196 212 197 213 function bp_activity_content_filter( $content, $date_recorded, $full_name, $insert_time = true, $filter_words = true, $filter_you = true ) { … … 242 258 243 259 function bp_activity_css_class() { 244 global $activities_template; 245 echo apply_filters( 'bp_activity_css_class', $activities_template->activity->component_name ); 246 } 260 echo bp_get_activity_css_class(); 261 } 262 function bp_get_activity_css_class() { 263 global $activities_template; 264 265 return apply_filters( 'bp_get_activity_css_class', $activities_template->activity->component_name ); 266 } 247 267 248 268 function bp_sitewide_activity_feed_link() { 249 global $bp; 250 251 echo apply_filters( 'bp_sitewide_activity_feed_link', site_url() . '/' . $bp->activity->slug . '/feed' ); 252 } 269 echo bp_get_sitewide_activity_feed_link(); 270 } 271 function bp_get_sitewide_activity_feed_link() { 272 global $bp; 273 274 return apply_filters( 'bp_get_sitewide_activity_feed_link', site_url() . '/' . $bp->activity->slug . '/feed' ); 275 } 253 276 254 277 function bp_activities_member_rss_link() { 255 global $bp; 256 257 if ( ( $bp->current_component == $bp->profile->slug ) || 'just-me' == $bp->current_action ) 258 echo apply_filters( 'bp_activities_member_rss_link', $bp->displayed_user->domain . $bp->activity->slug . '/feed' ); 259 else 260 echo apply_filters( 'bp_activities_member_rss_link', $bp->displayed_user->domain . $bp->activity->slug . '/my-friends/feed' ); 261 } 278 echo bp_get_activities_member_rss_link(); 279 } 280 function bp_get_activities_member_rss_link() { 281 global $bp; 282 283 if ( ( $bp->current_component == $bp->profile->slug ) || 'just-me' == $bp->current_action ) 284 return apply_filters( 'bp_get_activities_member_rss_link', $bp->displayed_user->domain . $bp->activity->slug . '/feed' ); 285 else 286 return apply_filters( 'bp_get_activities_member_rss_link', $bp->displayed_user->domain . $bp->activity->slug . '/my-friends/feed' ); 287 } 262 288 263 289 /* Template tags for RSS feed output */ 264 290 265 291 function bp_activity_feed_item_title() { 266 global $activities_template; 267 268 $title = explode( '<span', $activities_template->activity->content ); 269 echo apply_filters( 'bp_activity_feed_item_title', trim( strip_tags( html_entity_decode( $title[0] ) ) ) ); 270 } 292 echo bp_get_activity_feed_item_title(); 293 } 294 function bp_get_activity_feed_item_title() { 295 global $activities_template; 296 297 $title = explode( '<span', $activities_template->activity->content ); 298 return apply_filters( 'bp_get_activity_feed_item_title', trim( strip_tags( html_entity_decode( $title[0] ) ) ) ); 299 } 271 300 272 301 function bp_activity_feed_item_link() { 273 global $activities_template; 274 275 echo apply_filters( 'bp_activity_feed_item_link', $activities_template->activity->primary_link ); 276 } 302 echo bp_get_activity_feed_item_link(); 303 } 304 function bp_get_activity_feed_item_link() { 305 global $activities_template; 306 307 return apply_filters( 'bp_get_activity_feed_item_link', $activities_template->activity->primary_link ); 308 } 277 309 278 310 function bp_activity_feed_item_date() { 279 global $activities_template; 280 281 echo apply_filters( 'bp_activity_feed_item_date', $activities_template->activity->date_recorded ); 282 } 311 echo bp_get_activity_feed_item_date(); 312 } 313 function bp_get_activity_feed_item_date() { 314 global $activities_template; 315 316 return apply_filters( 'bp_get_activity_feed_item_date', $activities_template->activity->date_recorded ); 317 } 283 318 284 319 function bp_activity_feed_item_description() { 285 global $activities_template; 286 287 echo apply_filters( 'bp_activity_feed_item_description', html_entity_decode( str_replace( '%s', '', $activities_template->activity->content ), ENT_COMPAT, 'UTF-8' ) ); 288 } 289 290 320 echo bp_get_activity_feed_item_description(); 321 } 322 function bp_get_activity_feed_item_description() { 323 global $activities_template; 324 325 return apply_filters( 'bp_get_activity_feed_item_description', html_entity_decode( str_replace( '%s', '', $activities_template->activity->content ), ENT_COMPAT, 'UTF-8' ) ); 326 } 291 327 292 328 ?> -
trunk/bp-blogs/bp-blogs-templatetags.php
r1371 r1408 320 320 } 321 321 322 function bp_blogs_pagination_count() { 323 global $bp, $blogs_template; 324 325 $from_num = intval( ( $blogs_template->pag_page - 1 ) * $blogs_template->pag_num ) + 1; 326 $to_num = ( $from_num + ( $blogs_template->pag_num - 1 ) > $blogs_template->total_blog_count ) ? $blogs_template->total_blog_count : $from_num + ( $blogs_template->pag_num - 1 ) ; 327 328 echo sprintf( __( 'Viewing blog %d to %d (of %d blogs)', 'buddypress' ), $from_num, $to_num, $blogs_template->total_blog_count ); ?> 329 <img id="ajax-loader-blogs" src="<?php echo $bp->core->image_base ?>/ajax-loader.gif" height="7" alt="<?php _e( "Loading", "buddypress" ) ?>" style="display: none;" /><?php 330 } 331 332 function bp_blogs_pagination_links() { 333 echo bp_get_blogs_pagination_links(); 334 } 335 function bp_get_blogs_pagination_links() { 336 global $blogs_template; 337 338 return apply_filters( 'bp_get_blogs_pagination_links', $blogs_template->pag_links ); 339 } 340 322 341 function bp_blog_title() { 323 global $blogs_template; 324 echo apply_filters( 'bp_blog_title', $blogs_template->blog['title'] ); 325 } 342 echo bp_get_blog_title(); 343 } 344 function bp_get_blog_title() { 345 global $blogs_template; 346 347 return apply_filters( 'bp_get_blog_title', $blogs_template->blog['title'] ); 348 } 326 349 327 350 function bp_blog_description() { 328 global $blogs_template; 329 echo apply_filters( 'bp_blog_description', $blogs_template->blog['description'] ); 330 } 351 echo bp_get_blog_description(); 352 } 353 function bp_get_blog_description() { 354 global $blogs_template; 355 356 return apply_filters( 'bp_get_blog_description', $blogs_template->blog['description'] ); 357 } 331 358 332 359 function bp_blog_permalink() { 333 global $blogs_template; 334 echo apply_filters( 'bp_blog_permalink', $blogs_template->blog['siteurl'] ); 335 } 336 337 function bp_blogs_pagination() { 338 global $blogs_template; 339 echo $blogs_template->pag_links; 340 } 360 echo bp_get_blog_permalink(); 361 } 362 function bp_get_blog_permalink() { 363 global $blogs_template; 364 365 return apply_filters( 'bp_get_blog_permalink', $blogs_template->blog['siteurl'] ); 366 } 341 367 342 368 … … 470 496 } 471 497 472 function bp_post_pagination() { 473 global $posts_template; 474 echo $posts_template->pag_links; 475 } 476 477 function bp_post_title( $echo = true ) { 478 global $posts_template; 479 480 if ( $echo ) 481 echo apply_filters( 'bp_post_title', $posts_template->post->post_title ); 498 function bp_post_pagination_count() { 499 global $bp, $posts_template; 500 501 $from_num = intval( ( $posts_template->pag_page - 1 ) * $posts_template->pag_num ) + 1; 502 $to_num = ( $from_num + ( $posts_template->pag_num - 1 ) > $posts_template->total_post_count ) ? $posts_template->total_post_count : $from_num + ( $posts_template->pag_num - 1 ) ; 503 504 echo sprintf( __( 'Viewing post %d to %d (of %d posts)', 'buddypress' ), $from_num, $to_num, $posts_template->total_post_count ); ?> 505 <img id="ajax-loader-blogs" src="<?php echo $bp->core->image_base ?>/ajax-loader.gif" height="7" alt="<?php _e( "Loading", "buddypress" ) ?>" style="display: none;" /><?php 506 } 507 508 function bp_post_pagination_links() { 509 echo bp_get_post_pagination_links(); 510 } 511 function bp_get_post_pagination_links() { 512 global $posts_template; 513 514 return apply_filters( 'bp_get_post_pagination_links', $posts_template->pag_links ); 515 } 516 517 function bp_post_id() { 518 echo bp_get_post_id(); 519 } 520 function bp_get_post_id() { 521 global $posts_template; 522 echo apply_filters( 'bp_get_post_id', $posts_template->post->ID ); 523 } 524 525 function bp_post_title( $deprecated = true ) { 526 if ( !$deprecated ) 527 bp_get_post_title(); 482 528 else 483 return apply_filters( 'bp_post_title', $posts_template->post->post_title ); 484 } 529 echo bp_get_post_title(); 530 } 531 function bp_get_post_title() { 532 global $posts_template; 533 534 return apply_filters( 'bp_get_post_title', $posts_template->post->post_title ); 535 } 485 536 486 537 function bp_post_permalink() { 487 538 global $posts_template; 488 echo apply_filters( 'bp_post_permalink', bp_post_get_permalink() ); 539 540 echo bp_post_get_permalink(); 489 541 } 490 542 491 543 function bp_post_excerpt() { 492 global $posts_template; 493 echo apply_filters( 'bp_post_excerpt', $posts_template->post->post_excerpt ); 494 } 544 echo bp_get_post_excerpt(); 545 } 546 function bp_get_post_excerpt() { 547 global $posts_template; 548 echo apply_filters( 'bp_get_post_excerpt', $posts_template->post->post_excerpt ); 549 } 495 550 496 551 function bp_post_content() { 497 global $posts_template; 498 $content = $posts_template->post->post_content; 499 $content = apply_filters('the_content', $content); 500 $content = str_replace(']]>', ']]>', $content); 501 echo apply_filters( 'bp_post_content', $content ); 502 } 552 echo bp_get_post_content(); 553 } 554 function bp_get_post_content() { 555 global $posts_template; 556 $content = $posts_template->post->post_content; 557 $content = apply_filters('the_content', $content); 558 $content = str_replace(']]>', ']]>', $content); 559 return apply_filters( 'bp_get_post_content', $content ); 560 } 503 561 504 562 function bp_post_status() { 505 global $posts_template; 506 echo apply_filters( 'bp_post_status', $posts_template->post->post_status ); 507 } 508 509 function bp_post_date( $date_format = null, $echo = true ) { 510 global $posts_template; 511 563 echo bp_get_post_status(); 564 } 565 function bp_get_post_status() { 566 global $posts_template; 567 return apply_filters( 'bp_get_post_status', $posts_template->post->post_status ); 568 } 569 570 function bp_post_date( $date_format = null, $deprecated = true ) { 512 571 if ( !$date_format ) 513 572 $date_format = get_option('date_format'); 514 573 515 if ( $echo)516 echo apply_filters( 'bp_post_date', mysql2date( $date_format, $posts_template->post->post_date ));574 if ( !$deprecated ) 575 return bp_get_post_date( $date_format ); 517 576 else 518 return apply_filters( 'bp_post_date', mysql2date( $date_format, $posts_template->post->post_date ) ); 519 } 577 echo bp_get_post_date(); 578 } 579 function bp_get_post_date( $date_format = null ) { 580 global $posts_template; 581 582 if ( !$date_format ) 583 $date_format = get_option('date_format'); 584 585 echo apply_filters( 'bp_get_post_date', mysql2date( $date_format, $posts_template->post->post_date ) ); 586 } 520 587 521 588 function bp_post_comment_count() { 522 global $posts_template; 523 echo apply_filters( 'bp_post_comment_count', $posts_template->post->comment_count ); 524 } 589 echo bp_get_post_comment_count(); 590 } 591 function bp_get_post_comment_count() { 592 global $posts_template; 593 return apply_filters( 'bp_get_post_comment_count', $posts_template->post->comment_count ); 594 } 525 595 526 596 function bp_post_comments( $zero = 'No Comments', $one = '1 Comment', $more = '% Comments', $css_class = '', $none = 'Comments Off' ) { … … 561 631 } 562 632 563 function bp_post_author( $echo = true ) { 633 function bp_post_author( $deprecated = true ) { 634 if ( !$deprecated ) 635 return bp_get_post_author(); 636 else 637 echo bp_get_post_author(); 638 } 639 function bp_get_post_author() { 640 global $posts_template; 641 642 return apply_filters( 'bp_get_post_author', bp_core_get_userlink( $posts_template->post->post_author ) ); 643 } 644 645 function bp_post_category( $separator = '', $parents = '', $post_id = false, $deprecated = true ) { 564 646 global $posts_template; 565 566 if ( $echo)567 echo apply_filters( 'bp_post_author', bp_core_get_userlink( $posts_template->post->post_author ));647 648 if ( !$deprecated ) 649 return bp_get_post_category( $separator, $parents, $post_id ); 568 650 else 569 return apply_filters( 'bp_post_author', bp_core_get_userlink( $posts_template->post->post_author ) ); 570 } 571 572 function bp_post_id() { 573 global $posts_template; 574 echo apply_filters( 'bp_post_id', $posts_template->post->ID ); 575 } 576 577 function bp_post_category( $separator = '', $parents='', $post_id = false, $echo = true ) { 578 global $posts_template; 579 580 if ( $echo ) 581 echo apply_filters( 'bp_post_category', get_the_category_list( $separator, $parents, $posts_template->post->ID ) ); 582 else 583 return apply_filters( 'bp_post_category', get_the_category_list( $separator, $parents, $posts_template->post->ID ) ); 584 } 651 echo bp_get_post_category(); 652 } 653 function bp_get_post_category( $separator = '', $parents = '', $post_id = false ) { 654 global $posts_template; 655 656 if ( !$post_id ) 657 $post_id = $posts_template->post->ID; 658 659 return apply_filters( 'bp_get_post_category', get_the_category_list( $separator, $parents, $post_id ) ); 660 } 585 661 586 662 function bp_post_tags( $before = '', $sep = ', ', $after = '' ) { … … 593 669 594 670 function bp_post_blog_id() { 595 global $posts_template; 596 echo apply_filters( 'bp_post_blog_id', $posts_template->post->blog_id ); 597 } 598 599 function bp_post_blog_title() { 600 global $posts_template; 601 echo apply_filters( 'bp_post_blog_title', $posts_template->post->blog_id ); 602 } 603 604 function bp_post_blog_description() { 605 global $posts_template; 606 echo apply_filters( 'bp_post_blog_description', $posts_template->post->blog_id ); 607 } 671 echo bp_get_post_blog_id(); 672 } 673 function bp_get_post_blog_id() { 674 global $posts_template; 675 676 return apply_filters( 'bp_get_post_blog_id', $posts_template->post->blog_id ); 677 } 678 679 function bp_post_blog_name() { 680 echo bp_get_post_blog_name(); 681 } 682 function bp_get_post_blog_name() { 683 global $posts_template; 684 return apply_filters( 'bp_get_post_blog_name', get_blog_option( $posts_template->post->blog_id, 'blogname' ) ); 685 } 608 686 609 687 function bp_post_blog_permalink() { 610 global $posts_template; 611 echo apply_filters( 'bp_post_blog_permalink', $posts_template->post->blog_id ); 612 } 613 688 echo bp_get_post_blog_permalink(); 689 } 690 function bp_get_post_blog_permalink() { 691 global $posts_template; 692 return apply_filters( 'bp_get_post_blog_permalink', get_blog_option( $posts_template->post->blog_id, 'siteurl' ) ); 693 } 694 614 695 function bp_post_get_permalink( $post = null, $blog_id = null ) { 615 696 global $current_blog, $posts_template; … … 831 912 832 913 function bp_comments_pagination() { 914 echo bp_get_comments_pagination(); 915 } 916 function bp_get_comments_pagination() { 917 global $comments_template; 918 919 return apply_filters( 'bp_get_comments_pagination', $comments_template->pag_links ); 920 } 921 922 function bp_comment_id() { 923 echo bp_get_comment_id(); 924 } 925 function bp_get_comment_id() { 926 global $comments_template; 927 echo apply_filters( 'bp_get_comment_id', $comments_template->comment->comment_ID ); 928 } 929 930 function bp_comment_post_permalink( $depricated = true ) { 931 if ( !$depricated ) 932 return bp_get_comment_post_permalink(); 933 else 934 echo bp_get_comment_post_permalink(); 935 } 936 function bp_get_comment_post_permalink() { 937 global $comments_template; 938 939 return apply_filters( 'bp_get_comment_post_permalink', bp_post_get_permalink( $comments_template->comment->post, $comments_template->comment->blog_id ) . '#comment-' . $comments_template->comment->comment_ID ); 940 } 941 942 function bp_comment_post_title( $deprecated = true ) { 943 if ( !$deprecated ) 944 return bp_get_comment_post_title(); 945 else 946 echo bp_get_comment_post_title(); 947 } 948 function bp_get_comment_post_title( $deprecated = true ) { 949 global $comments_template; 950 951 return apply_filters( 'bp_get_comment_post_title', $comments_template->comment->post->post_title ); 952 } 953 954 function bp_comment_author( $deprecated = true ) { 833 955 global $comments_template; 834 echo $comments_template->pag_links; 835 } 836 837 function bp_comment_id() { 838 global $comments_template; 839 echo apply_filters( 'bp_comment_id', $comments_template->comment->comment_ID ); 840 } 841 842 function bp_comment_post_permalink( $echo = true ) { 843 global $comments_template; 844 845 if ( $echo ) 846 echo apply_filters( 'bp_comment_post_permalink', bp_post_get_permalink( $comments_template->comment->post, $comments_template->comment->blog_id ) . '#comment-' . $comments_template->comment->comment_ID ); 956 957 if ( !$deprecated ) 958 return bp_get_comment_author(); 847 959 else 848 return apply_filters( 'bp_comment_post_permalink', bp_post_get_permalink( $comments_template->comment->post, $comments_template->comment->blog_id ) . '#comment-' . $comments_template->comment->comment_ID ); 849 } 850 851 function bp_comment_post_title( $echo = true ) { 852 global $comments_template; 853 854 if ( $echo ) 855 echo apply_filters( 'bp_comment_post_title', $comments_template->comment->post->post_title ); 856 else 857 return apply_filters( 'bp_comment_post_title', $comments_template->comment->post->post_title ); 858 } 859 860 function bp_comment_author( $echo = true ) { 861 global $comments_template; 862 863 if ( $echo ) 864 echo apply_filters( 'bp_comment_author', bp_core_get_userlink( $comments_template->comment->user_id ) ); 865 else 866 return apply_filters( 'bp_comment_author', bp_core_get_userlink( $comments_template->comment->user_id ) ); 867 } 960 echo bp_get_comment_author(); 961 } 962 function bp_get_comment_author() { 963 global $comments_template; 964 965 return apply_filters( 'bp_get_comment_author', bp_core_get_userlink( $comments_template->comment->user_id ) ); 966 } 868 967 869 968 function bp_comment_content() { 870 global $comments_template; 871 $content = $comments_template->comment->comment_content; 872 $content = apply_filters('the_content', $content); 873 $content = str_replace(']]>', ']]>', $content); 874 echo apply_filters( 'bp_comment_content', $content ); 875 } 876 877 function bp_comment_date( $date_format = null, $echo = true ) { 878 global $comments_template; 879 969 echo bp_get_comment_content(); 970 } 971 function bp_get_comment_content() { 972 global $comments_template; 973 $content = $comments_template->comment->comment_content; 974 $content = apply_filters('the_content', $content); 975 $content = str_replace(']]>', ']]>', $content); 976 echo apply_filters( 'bp_get_comment_content', $content ); 977 } 978 979 function bp_comment_date( $date_format = null, $deprecated = true ) { 880 980 if ( !$date_format ) 881 981 $date_format = get_option('date_format'); 882 982 883 if ( $echo)884 echo apply_filters( 'bp_comment_date', mysql2date( $date_format, $comments_template->comment->comment_date ));983 if ( !$deprecated ) 984 return bp_get_comment_date( $date_format ); 885 985 else 886 return apply_filters( 'bp_comment_date', mysql2date( $date_format, $comments_template->comment->comment_date ) ); 887 } 888 889 function bp_comment_blog_permalink( $echo = true ) { 986 echo bp_get_comment_date( $date_format ); 987 } 988 function bp_get_comment_date( $date_format = null ) { 989 global $comments_template; 990 991 if ( !$date_format ) 992 $date_format = get_option('date_format'); 993 994 return apply_filters( 'bp_get_comment_date', mysql2date( $date_format, $comments_template->comment->comment_date ) ); 995 } 996 997 function bp_comment_blog_permalink( $deprecated = true ) { 998 if ( !$deprecated ) 999 return bp_get_comment_blog_permalink(); 1000 else 1001 echo bp_get_comment_blog_permalink(); 1002 } 1003 function bp_get_comment_blog_permalink() { 1004 global $comments_template; 1005 1006 return apply_filters( 'bp_get_comment_blog_permalink', get_blog_option( $comments_template->comment->blog_id, 'siteurl' ) ); 1007 } 1008 1009 function bp_comment_blog_name( $deprecated = true ) { 890 1010 global $comments_template; 891 1011 892 if ( $echo)893 echo apply_filters( 'bp_comment_blog_permalink', get_blog_option( $comments_template->comment->blog_id, 'siteurl' ) );1012 if ( !$deprecated ) 1013 return bp_get_comment_blog_permalink(); 894 1014 else 895 return apply_filters( 'bp_comment_blog_permalink', get_blog_option( $comments_template->comment->blog_id, 'siteurl' ) ); 896 } 897 898 function bp_comment_blog_name( $echo = true ) { 899 global $comments_template; 900 901 if ( $echo ) 902 echo apply_filters( 'bp_comment_blog_name', get_blog_option( $comments_template->comment->blog_id, 'blogname' ) ); 903 else 904 return apply_filters( 'bp_comment_blog_name', get_blog_option( $comments_template->comment->blog_id, 'blogname' ) ); 905 } 1015 echo bp_get_comment_blog_permalink(); 1016 } 1017 function bp_get_comment_blog_name( $deprecated = true ) { 1018 global $comments_template; 1019 1020 return apply_filters( 'bp_get_comment_blog_name', get_blog_option( $comments_template->comment->blog_id, 'blogname' ) ); 1021 } 906 1022 907 1023 /********************************************************************** … … 1073 1189 1074 1190 function bp_site_blogs_pagination_links() { 1075 global $site_blogs_template; 1076 echo $site_blogs_template->pag_links; 1077 } 1078 1191 echo bp_get_site_blogs_pagination_links(); 1192 } 1193 function bp_get_site_blogs_pagination_links() { 1194 global $site_blogs_template; 1195 1196 return apply_filters( 'bp_get_site_blogs_pagination_links', $site_blogs_template->pag_links ); 1197 } 1198 1079 1199 function bp_the_site_blog_avatar() { 1080 global $site_blogs_template, $bp; 1081 1082 /*** 1083 * In future BuddyPress versions you will be able to set the avatar for a blog. 1084 * Right now you can use a filter with the ID of the blog to change it if you wish. 1085 */ 1086 1087 echo apply_filters( 'bp_blogs_blog_avatar_' . $site_blogs_template->blog->blog_id, '<img src="http://www.gravatar.com/avatar/' . md5( $site_blogs_template->blog->blog_id . '.blogs@' . $bp->root_domain ) . '?d=identicon&s=150" class="avatar blog-avatar" alt="' . __( 'Blog Avatar', 'buddypress' ) . '" />' ); 1088 } 1200 echo bp_get_the_site_blog_avatar(); 1201 } 1202 function bp_get_the_site_blog_avatar() { 1203 global $site_blogs_template, $bp; 1204 1205 /*** 1206 * In future BuddyPress versions you will be able to set the avatar for a blog. 1207 * Right now you can use a filter with the ID of the blog to change it if you wish. 1208 */ 1209 return apply_filters( 'bp_get_blogs_blog_avatar_' . $site_blogs_template->blog->blog_id, '<img src="http://www.gravatar.com/avatar/' . md5( $site_blogs_template->blog->blog_id . '.blogs@' . $bp->root_domain ) . '?d=identicon&s=150" class="avatar blog-avatar" alt="' . __( 'Blog Avatar', 'buddypress' ) . '" />', $site_blogs_template->blog->blog_id ); 1210 } 1089 1211 1090 1212 function bp_the_site_blog_avatar_thumb() { 1091 global $site_blogs_template, $bp; 1092 1093 echo apply_filters( 'bp_blogs_blog_avatar_thumb_' . $site_blogs_template->blog->blog_id, '<img src="http://www.gravatar.com/avatar/' . md5( $site_blogs_template->blog->blog_id . '.blogs@' . $bp->root_domain ) . '?d=identicon&s=50" class="avatar blog-avatar thumb" alt="' . __( 'Blog Avatar', 'buddypress' ) . '" />' ); 1094 } 1213 echo bp_get_the_site_blog_avatar_thumb(); 1214 } 1215 function bp_get_the_site_blog_avatar_thumb() { 1216 global $site_blogs_template, $bp; 1217 1218 return apply_filters( 'bp_get_blogs_blog_avatar_thumb_' . $site_blogs_template->blog->blog_id, '<img src="http://www.gravatar.com/avatar/' . md5( $site_blogs_template->blog->blog_id . '.blogs@' . $bp->root_domain ) . '?d=identicon&s=50" class="avatar blog-avatar thumb" alt="' . __( 'Blog Avatar', 'buddypress' ) . '" />', $site_blogs_template->blog->blog_id ); 1219 } 1095 1220 1096 1221 function bp_the_site_blog_avatar_mini() { 1097 global $site_blogs_template, $bp; 1098 1099 echo apply_filters( 'bp_blogs_blog_avatar_mini_' . $site_blogs_template->blog->blog_id, '<img src="http://www.gravatar.com/avatar/' . md5( $site_blogs_template->blog->blog_id . '.blogs@' . $bp->root_domain ) . '?d=identicon&s=25" class="avatar blog-avatar mini" alt="' . __( 'Blog Avatar', 'buddypress' ) . '" />' ); 1100 } 1222 echo bp_get_the_site_blog_avatar_mini(); 1223 } 1224 function bp_get_the_site_blog_avatar_mini() { 1225 global $site_blogs_template, $bp; 1226 1227 return apply_filters( 'bp_get_blogs_blog_avatar_mini_' . $site_blogs_template->blog->blog_id, '<img src="http://www.gravatar.com/avatar/' . md5( $site_blogs_template->blog->blog_id . '.blogs@' . $bp->root_domain ) . '?d=identicon&s=25" class="avatar blog-avatar mini" alt="' . __( 'Blog Avatar', 'buddypress' ) . '" />', $site_blogs_template->blog->blog_id ); 1228 } 1101 1229 1102 1230 function bp_the_site_blog_link() { 1103 global $site_blogs_template; 1104 1105 echo get_blog_option( $site_blogs_template->blog->blog_id, 'siteurl' ); 1106 } 1231 echo bp_get_the_site_blog_link(); 1232 } 1233 function bp_get_the_site_blog_link() { 1234 global $site_blogs_template; 1235 1236 return apply_filters( 'bp_get_the_site_blog_link', get_blog_option( $site_blogs_template->blog->blog_id, 'siteurl' ) ); 1237 } 1107 1238 1108 1239 function bp_the_site_blog_name() { 1109 global $site_blogs_template; 1110 1111 echo get_blog_option( $site_blogs_template->blog->blog_id, 'blogname' ); 1112 } 1240 echo bp_get_the_site_blog_name(); 1241 } 1242 function bp_get_the_site_blog_name() { 1243 global $site_blogs_template; 1244 1245 return apply_filters( 'bp_get_the_site_blog_name', get_blog_option( $site_blogs_template->blog->blog_id, 'blogname' ) ); 1246 } 1113 1247 1114 1248 function bp_the_site_blog_description() { 1115 global $site_blogs_template; 1116 1117 echo get_blog_option( $site_blogs_template->blog->blog_id, 'blogdescription' ); 1118 } 1249 echo apply_filters( 'bp_the_site_blog_description', bp_get_the_site_blog_description() ); 1250 } 1251 function bp_get_the_site_blog_description() { 1252 global $site_blogs_template; 1253 1254 return apply_filters( 'bp_get_the_site_blog_description', get_blog_option( $site_blogs_template->blog->blog_id, 'blogdescription' ) ); 1255 } 1119 1256 1120 1257 function bp_the_site_blog_last_active() { 1121 global $site_blogs_template; 1122 1123 echo bp_core_get_last_activity( bp_blogs_get_blogmeta( $site_blogs_template->blog->blog_id, 'last_activity' ), __( 'active %s ago', 'buddypress' ) ); 1124 } 1258 echo bp_get_the_site_blog_last_active(); 1259 } 1260 function bp_get_the_site_blog_last_active() { 1261 global $site_blogs_template; 1262 1263 return apply_filters( 'bp_the_site_blog_last_active', bp_core_get_last_activity( bp_blogs_get_blogmeta( $site_blogs_template->blog->blog_id, 'last_activity' ), __( 'active %s ago', 'buddypress' ) ) ); 1264 } 1125 1265 1126 1266 function bp_the_site_blog_latest_post() { 1127 global $site_blogs_template; 1128 1129 if ( $post = bp_blogs_get_latest_posts( $site_blogs_template->blog->blog_id, 1 ) ) { 1130 printf( __( 'Latest Post: %s', 'buddypress' ), '<a href="' . bp_post_get_permalink( $post[0], $site_blogs_template->blog->blog_id ) . '">' . apply_filters( 'the_title', $post[0]->post_title ) . '</a>' ); 1131 } 1132 } 1133 1267 echo bp_get_the_site_blog_latest_post(); 1268 } 1269 function bp_get_the_site_blog_latest_post() { 1270 global $site_blogs_template; 1271 1272 if ( $post = bp_blogs_get_latest_posts( $site_blogs_template->blog->blog_id, 1 ) ) { 1273 return apply_filters( 'bp_get_the_site_blog_latest_post', sprintf( __( 'Latest Post: %s', 'buddypress' ), '<a href="' . bp_post_get_permalink( $post[0], $site_blogs_template->blog->blog_id ) . '">' . apply_filters( 'the_title', $post[0]->post_title ) . '</a>' ) ); 1274 } 1275 } 1134 1276 1135 1277 function bp_the_site_blog_hidden_fields() { -
trunk/bp-core.php
r1393 r1408 9 9 define( 'BP_PLUGIN_URL', WP_PLUGIN_URL . '/buddypress' ); 10 10 11 /* Place your custom code (actions/filters) in a file called bp-custom.php and it will be loaded before anything else. */12 if ( file_exists( BP_PLUGIN_DIR . '/bp-custom.php' ) )13 require( BP_PLUGIN_DIR . '/bp-custom.php' );11 /* Place your custom code (actions/filters) in a file called /plugins/bp-custom.php and it will be loaded before anything else. */ 12 if ( file_exists( WP_PLUGIN_DIR . '/bp-custom.php' ) ) 13 require( WP_PLUGIN_DIR . '/bp-custom.php' ); 14 14 15 15 /* Define on which blog ID BuddyPress should run */ -
trunk/bp-core/bp-core-classes.php
r1368 r1408 245 245 like_escape($search_terms); 246 246 247 $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 pd.value LIKE ' $search_terms%%' ORDER BY pd.value ASC", $search_terms );248 $paged_users_sql = apply_filters( 'bp_core_search_users_sql', "SELECT DISTINCT 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 pd.value LIKE ' $search_terms%%' ORDER BY pd.value ASC{$pag_sql}", $search_terms, $pag_sql );247 $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 pd.value LIKE '%%$search_terms%%' ORDER BY pd.value ASC", $search_terms ); 248 $paged_users_sql = apply_filters( 'bp_core_search_users_sql', "SELECT DISTINCT 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 pd.value LIKE '%%$search_terms%%' ORDER BY pd.value ASC{$pag_sql}", $search_terms, $pag_sql ); 249 249 250 250 $total_users = $wpdb->get_var( $total_users_sql ); -
trunk/bp-core/bp-core-templatetags.php
r1394 r1408 239 239 if ( !$fullname = wp_cache_get( 'bp_user_fullname_' . $user_id, 'bp' ) ) { 240 240 if ( function_exists('xprofile_install') ) { 241 $fullname = bp_core_ucfirst( xprofile_get_field_data( BP_XPROFILE_FULLNAME_FIELD_NAME, $user_id ));241 $fullname = xprofile_get_field_data( BP_XPROFILE_FULLNAME_FIELD_NAME, $user_id ); 242 242 243 243 if ( empty($fullname) || !$fullname ) { … … 932 932 933 933 function bp_site_members_pagination_links() { 934 global $site_members_template; 935 echo $site_members_template->pag_links; 936 } 934 echo bp_get_site_members_pagination_links(); 935 } 936 function bp_get_site_members_pagination_links() { 937 global $site_members_template; 938 939 return apply_filters( 'bp_get_site_members_pagination_links', $site_members_template->pag_links ); 940 } 937 941 938 942 function bp_the_site_member_user_id() { 939 global $site_members_template; 940 941 echo $site_members_template->member->id; 942 } 943 echo bp_get_the_site_member_user_id(); 944 } 945 function bp_get_the_site_member_user_id() { 946 global $site_members_template; 947 948 return apply_filters( 'bp_get_the_site_member_user_id', $site_members_template->member->id ); 949 } 943 950 944 951 function bp_the_site_member_avatar() { 945 global $site_members_template; 946 947 echo $site_members_template->member->avatar_thumb; 948 } 952 echo apply_filters( 'bp_the_site_member_avatar', bp_get_the_site_member_avatar() ); 953 } 954 function bp_get_the_site_member_avatar() { 955 global $site_members_template; 956 957 return apply_filters( 'bp_get_the_site_member_avatar', $site_members_template->member->avatar_thumb ); 958 } 949 959 950 960 function bp_the_site_member_link() { 951 global $site_members_template; 952 953 echo $site_members_template->member->user_url; 954 } 961 echo bp_get_the_site_member_link(); 962 } 963 function bp_get_the_site_member_link() { 964 global $site_members_template; 965 966 echo apply_filters( 'bp_get_the_site_member_link', $site_members_template->member->user_url ); 967 } 955 968 956 969 function bp_the_site_member_name() { 957 global $site_members_template; 958 959 echo $site_members_template->member->fullname; 960 } 970 echo apply_filters( 'bp_the_site_member_name', bp_get_the_site_member_name() ); 971 } 972 function bp_get_the_site_member_name() { 973 global $site_members_template; 974 975 return apply_filters( 'bp_get_the_site_member_name', $site_members_template->member->fullname ); 976 } 977 add_filter( 'bp_get_the_site_member_name', 'wp_filter_kses' ); 961 978 962 979 function bp_the_site_member_last_active() { 963 global $site_members_template; 964 965 echo $site_members_template->member->last_active; 966 } 967 980 echo bp_get_the_site_member_last_active(); 981 } 982 function bp_get_the_site_member_last_active() { 983 global $site_members_template; 984 985 return apply_filters( 'bp_the_site_member_last_active', $site_members_template->member->last_active ); 986 } 987 968 988 function bp_the_site_member_add_friend_button() { 969 989 global $site_members_template; … … 980 1000 return false; 981 1001 982 if ( 1 == (int) $site_members_template->member->total_friends ) 983 printf( __( '%d friend', 'buddypress' ), (int) $site_members_template->member->total_friends ); 984 else 985 printf( __( '%d friends', 'buddypress' ), (int) $site_members_template->member->total_friends ); 986 } 987 1002 echo bp_get_the_site_member_total_friend_count(); 1003 } 1004 function bp_get_the_site_member_total_friend_count() { 1005 global $site_members_template; 1006 1007 if ( !(int) $site_members_template->member->total_friends ) 1008 return false; 1009 1010 if ( 1 == (int) $site_members_template->member->total_friends ) 1011 return apply_filters( 'bp_get_the_site_member_total_friend_count', sprintf( __( '%d friend', 'buddypress' ), (int) $site_members_template->member->total_friends ) ); 1012 else 1013 return apply_filters( 'bp_get_the_site_member_total_friend_count', sprintf( __( '%d friends', 'buddypress' ), (int) $site_members_template->member->total_friends ) ); 1014 } 1015 988 1016 function bp_the_site_member_random_profile_data() { 989 1017 global $site_members_template; … … 991 1019 if ( function_exists( 'xprofile_get_random_profile_data' ) ) { ?> 992 1020 <?php $random_data = xprofile_get_random_profile_data( $site_members_template->member->id, true ); ?> 993 <strong><?php echo $random_data[0]->name?></strong>994 <?php echo $random_data[0]->value?>1021 <strong><?php echo wp_filter_kses( $random_data[0]->name ) ?></strong> 1022 <?php echo wp_filter_kses( $random_data[0]->value ) ?> 995 1023 <?php } 996 1024 } … … 1033 1061 also means we dont have to use the $bp variable in the template (looks messy) */ 1034 1062 1035 function bp_current_user_id() { 1036 global $bp; 1037 return apply_filters( 'bp_current_user_id', $bp->displayed_user->id ); 1038 } 1039 function bp_displayed_user_id() { 1040 return bp_current_user_id(); 1041 } 1063 function bp_displayed_user_id() { 1064 global $bp; 1065 return apply_filters( 'bp_displayed_user_id', $bp->displayed_user->id ); 1066 } 1067 function bp_current_user_id() { return bp_displayed_user_id(); } 1042 1068 1043 1069 function bp_loggedin_user_id() { -
trunk/bp-forums/bp-forums-filters.php
r1366 r1408 4 4 add_filter( 'bp_forums_new_post_text', 'bp_forums_filter_encode' ); 5 5 6 add_filter( 'bp_ the_topic_post_content', 'bp_forums_filter_decode' );7 add_filter( 'bp_ the_topic_latest_post_excerpt', 'bp_forums_filter_decode' );6 add_filter( 'bp_get_the_topic_post_content', 'bp_forums_filter_decode' ); 7 add_filter( 'bp_get_the_topic_latest_post_excerpt', 'bp_forums_filter_decode' ); 8 8 9 add_filter( 'bp_ the_topic_latest_post_excerpt', 'bp_create_excerpt' );9 add_filter( 'bp_get_the_topic_latest_post_excerpt', 'bp_create_excerpt' ); 10 10 11 11 /* Apply WordPress defined filters */ 12 add_filter( 'bp_ the_topic_title', 'wptexturize' );13 add_filter( 'bp_ the_topic_poster_name', 'wptexturize' );14 add_filter( 'bp_ the_topic_last_poster_name', 'wptexturize' );15 add_filter( 'bp_ the_topic_post_content', 'wptexturize' );16 add_filter( 'bp_ the_topic_post_poster_name', 'wptexturize' );12 add_filter( 'bp_get_the_topic_title', 'wptexturize' ); 13 add_filter( 'bp_get_the_topic_poster_name', 'wptexturize' ); 14 add_filter( 'bp_get_the_topic_last_poster_name', 'wptexturize' ); 15 add_filter( 'bp_get_the_topic_post_content', 'wptexturize' ); 16 add_filter( 'bp_get_the_topic_post_poster_name', 'wptexturize' ); 17 17 18 add_filter( 'bp_ the_topic_title', 'convert_smilies' );19 add_filter( 'bp_ the_topic_latest_post_excerpt', 'convert_smilies' );20 add_filter( 'bp_ the_topic_post_content', 'convert_smilies' );18 add_filter( 'bp_get_the_topic_title', 'convert_smilies' ); 19 add_filter( 'bp_get_the_topic_latest_post_excerpt', 'convert_smilies' ); 20 add_filter( 'bp_get_the_topic_post_content', 'convert_smilies' ); 21 21 22 add_filter( 'bp_ the_topic_title', 'convert_chars' );23 add_filter( 'bp_ the_topic_latest_post_excerpt', 'convert_chars' );24 add_filter( 'bp_ the_topic_post_content', 'convert_chars' );22 add_filter( 'bp_get_the_topic_title', 'convert_chars' ); 23 add_filter( 'bp_get_the_topic_latest_post_excerpt', 'convert_chars' ); 24 add_filter( 'bp_get_the_topic_post_content', 'convert_chars' ); 25 25 26 add_filter( 'bp_ the_topic_post_content', 'wpautop' );27 add_filter( 'bp_ the_topic_latest_post_excerpt', 'wpautop' );26 add_filter( 'bp_get_the_topic_post_content', 'wpautop' ); 27 add_filter( 'bp_get_the_topic_latest_post_excerpt', 'wpautop' ); 28 28 29 add_filter( 'bp_ the_topic_post_content', 'stripslashes_deep' );30 add_filter( 'bp_ the_topic_title', 'stripslashes_deep' );31 add_filter( 'bp_ the_topic_latest_post_excerpt', 'stripslashes_deep' );29 add_filter( 'bp_get_the_topic_post_content', 'stripslashes_deep' ); 30 add_filter( 'bp_get_the_topic_title', 'stripslashes_deep' ); 31 add_filter( 'bp_get_the_topic_latest_post_excerpt', 'stripslashes_deep' ); 32 32 33 add_filter( 'bp_ the_topic_post_content', 'make_clickable' );33 add_filter( 'bp_get_the_topic_post_content', 'make_clickable' ); 34 34 35 35 function bp_forums_add_allowed_tags( $allowedtags ) { -
trunk/bp-forums/bp-forums-templatetags.php
r1366 r1408 118 118 119 119 function bp_the_topic_id() { 120 echo bp_get_the_topic_id(); 121 } 122 function bp_get_the_topic_id() { 123 global $forum_template; 124 125 return apply_filters( 'bp_get_the_topic_id', $forum_template->topic->topic_id ); 126 } 127 128 function bp_the_topic_title() { 129 echo bp_get_the_topic_title(); 130 } 131 function bp_get_the_topic_title() { 132 global $forum_template; 133 134 return apply_filters( 'bp_get_the_topic_title', stripslashes( $forum_template->topic->topic_title ) ); 135 } 136 137 function bp_the_topic_slug() { 138 echo bp_get_the_topic_slug(); 139 } 140 function bp_get_the_topic_slug() { 141 global $forum_template; 142 143 return apply_filters( 'bp_get_the_topic_slug', $forum_template->topic->topic_slug ); 144 } 145 146 function bp_the_topic_poster_id() { 147 echo bp_get_the_topic_poster_id(); 148 } 149 function bp_get_the_topic_poster_id() { 150 global $forum_template; 151 152 return apply_filters( 'bp_get_the_topic_poster_id', $forum_template->topic->topic_poster ); 153 } 154 155 function bp_the_topic_poster_avatar() { 156 echo bp_get_the_topic_poster_avatar(); 157 } 158 function bp_get_the_topic_poster_avatar() { 159 global $forum_template; 160 161 return apply_filters( 'bp_get_the_topic_poster_avatar', bp_core_get_avatar( $forum_template->topic->topic_poster, 1 ) ); 162 } 163 164 function bp_the_topic_poster_name() { 165 echo bp_get_the_topic_poster_name(); 166 } 167 function bp_get_the_topic_poster_name() { 168 global $forum_template; 169 170 return apply_filters( 'bp_get_the_topic_poster_name', bp_core_get_userlink( $forum_template->topic->topic_poster ) ); 171 } 172 173 function bp_the_topic_last_poster_name() { 174 echo bp_get_the_topic_last_poster_name(); 175 } 176 function bp_get_the_topic_last_poster_name() { 177 global $forum_template; 178 179 return apply_filters( 'bp_get_the_topic_last_poster_name', bp_core_get_userlink( $forum_template->topic->topic_last_poster ) ); 180 } 181 182 function bp_the_topic_last_poster_avatar() { 183 echo bp_get_the_topic_last_poster_avatar(); 184 } 185 function bp_get_the_topic_last_poster_avatar() { 186 global $forum_template; 187 188 return apply_filters( 'bp_get_the_topic_last_poster_avatar', bp_core_get_avatar( $forum_template->topic->topic_last_poster, 1 ) ); 189 } 190 191 function bp_the_topic_start_time() { 192 echo bp_get_the_topic_start_time(); 193 } 194 function bp_get_the_topic_start_time() { 195 global $forum_template; 196 197 return apply_filters( 'bp_get_the_topic_start_time', $forum_template->topic->topic_start_time ); 198 } 199 200 function bp_the_topic_time() { 201 echo bp_get_the_topic_time(); 202 } 203 function bp_get_the_topic_time() { 204 global $forum_template; 205 206 return apply_filters( 'bp_get_the_topic_time', $forum_template->topic->topic_time ); 207 } 208 209 function bp_the_topic_forum_id() { 210 echo bp_get_the_topic_forum_id(); 211 } 212 function bp_get_the_topic_forum_id() { 213 global $forum_template; 214 215 return apply_filters( 'bp_get_the_topic_forum_id', $forum_template->topic->topic_forum_id ); 216 } 217 218 function bp_the_topic_status() { 219 echo bp_get_the_topic_status(); 220 } 221 function bp_get_the_topic_status() { 222 global $forum_template; 223 224 return apply_filters( 'bp_get_the_topic_status', $forum_template->topic->topic_status ); 225 } 226 227 function bp_the_topic_is_topic_open() { 228 echo bp_get_the_topic_is_topic_open(); 229 } 230 function bp_get_the_topic_is_topic_open() { 231 global $forum_template; 232 233 return apply_filters( 'bp_get_the_topic_is_topic_open', $forum_template->topic->topic_open ); 234 } 235 236 function bp_the_topic_last_post_id() { 237 echo bp_get_the_topic_last_post_id(); 238 } 239 function bp_get_the_topic_last_post_id() { 240 global $forum_template; 241 242 echo apply_filters( 'bp_get_the_topic_last_post_id', $forum_template->topic->topic_last_post_id ); 243 } 244 245 function bp_the_topic_is_sticky() { 246 echo bp_get_the_topic_is_sticky(); 247 } 248 function bp_get_the_topic_is_sticky() { 249 global $forum_template; 250 251 echo apply_filters( 'bp_get_the_topic_is_sticky', $forum_template->topic->topic_sticky ); 252 } 253 254 function bp_the_topic_total_post_count() { 255 echo bp_get_the_topic_total_post_count(); 256 } 257 function bp_get_the_topic_total_post_count() { 258 global $forum_template; 259 260 if ( $forum_template->topic->topic_posts == 1 ) 261 return apply_filters( 'bp_get_the_topic_total_post_count', sprintf( __( '%d post', 'buddypress' ), $forum_template->topic->topic_posts ) ); 262 else 263 return apply_filters( 'bp_get_the_topic_total_post_count', sprintf( __( '%d posts', 'buddypress' ), $forum_template->topic->topic_posts ) ); 264 } 265 266 function bp_the_topic_tag_count() { 267 echo bp_get_the_topic_tag_count(); 268 } 269 function bp_get_the_topic_tag_count() { 270 global $forum_template; 271 272 echo apply_filters( 'bp_get_the_topic_tag_count', $forum_template->topic->tag_count ); 273 } 274 275 function bp_the_topic_permalink() { 276 echo bp_get_the_topic_permalink(); 277 } 278 function bp_get_the_topic_permalink() { 279 global $forum_template, $bbpress_live, $group_obj; 280 281 $target_uri = $bbpress_live->fetch->options['target_uri']; 282 283 return apply_filters( 'bp_get_the_topic_permalink', bp_get_group_permalink( $group_obj ) . '/forum/topic/' . $forum_template->topic->topic_id ); 284 } 285 286 function bp_the_topic_time_since_created() { 287 echo bp_get_the_topic_time_since_created(); 288 } 289 function bp_get_the_topic_time_since_created() { 290 global $forum_template; 291 292 echo apply_filters( 'bp_get_the_topic_time_since_created', $forum_template->topic->topic_start_time_since ); 293 } 294 295 function bp_the_topic_latest_post_excerpt() { 296 echo bp_get_the_topic_latest_post_excerpt(); 297 } 298 function bp_get_the_topic_latest_post_excerpt() { 299 global $forum_template; 300 301 $post = bp_forums_get_post( $forum_template->topic->topic_last_post_id ); 302 return apply_filters( 'bp_get_the_topic_latest_post_excerpt', $post->post_text ); 303 } 304 305 function bp_the_topic_time_since_last_post( $deprecated = true ) { 120 306 global $forum_template; 121 307 122 echo apply_filters( 'bp_the_topic_id', $forum_template->topic->topic_id ); 123 } 124 125 function bp_the_topic_title() { 126 global $forum_template; 127 128 echo apply_filters( 'bp_the_topic_title', stripslashes( $forum_template->topic->topic_title ) ); 129 } 130 131 function bp_the_topic_slug() { 132 global $forum_template; 133 134 echo apply_filters( 'bp_the_topic_slug', $forum_template->topic->topic_slug ); 135 } 136 137 function bp_the_topic_poster_id() { 138 global $forum_template; 139 140 echo apply_filters( 'bp_the_topic_poster_id', $forum_template->topic->topic_poster ); 141 } 142 143 function bp_the_topic_poster_avatar() { 144 global $forum_template; 145 146 echo apply_filters( 'bp_the_topic_poster_avatar', bp_core_get_avatar( $forum_template->topic->topic_poster, 1 ) ); 147 } 148 149 function bp_the_topic_poster_name() { 150 global $forum_template; 151 152 echo apply_filters( 'bp_the_topic_poster_name', bp_core_get_userlink( $forum_template->topic->topic_poster ) ); 153 } 154 155 function bp_the_topic_last_poster_name() { 156 global $forum_template; 157 158 echo apply_filters( 'bp_the_topic_last_poster_name', bp_core_get_userlink( $forum_template->topic->topic_last_poster ) ); 159 } 160 161 function bp_the_topic_last_poster_avatar() { 162 global $forum_template; 163 164 echo apply_filters( 'bp_the_topic_last_poster_avatar', bp_core_get_avatar( $forum_template->topic->topic_last_poster, 1 ) ); 165 } 166 167 function bp_the_topic_start_time() { 168 global $forum_template; 169 170 echo apply_filters( 'bp_the_topic_start_time', $forum_template->topic->topic_start_time ); 171 } 172 173 function bp_the_topic_time() { 174 global $forum_template; 175 176 echo apply_filters( 'bp_the_topic_time', $forum_template->topic->topic_time ); 177 } 178 179 function bp_the_topic_forum_id() { 180 global $forum_template; 181 182 echo apply_filters( 'bp_the_topic_forum_id', $forum_template->topic->topic_forum_id ); 183 } 184 185 function bp_the_topic_status() { 186 global $forum_template; 187 188 echo apply_filters( 'bp_the_topic_status', $forum_template->topic->topic_status ); 189 } 190 191 function bp_the_topic_is_topic_open() { 192 global $forum_template; 193 194 echo apply_filters( 'bp_the_topic_is_topic_open', $forum_template->topic->topic_open ); 195 } 196 197 function bp_the_topic_last_post_id() { 198 global $forum_template; 199 200 echo apply_filters( 'bp_the_topic_last_post_id', $forum_template->topic->topic_last_post_id ); 201 } 202 203 function bp_the_topic_is_sticky() { 204 global $forum_template; 205 206 echo apply_filters( 'bp_the_topic_is_sticky', $forum_template->topic->topic_sticky ); 207 } 208 209 function bp_the_topic_total_post_count() { 210 global $forum_template; 211 212 if ( $forum_template->topic->topic_posts == 1 ) 213 echo apply_filters( 'bp_the_topic_total_post_count', sprintf( __( '%d post', 'buddypress' ), $forum_template->topic->topic_posts ) ); 308 if ( !$deprecated ) 309 return bp_get_the_topic_time_since_last_post(); 214 310 else 215 echo apply_filters( 'bp_the_topic_total_post_count', sprintf( __( '%d posts', 'buddypress' ), $forum_template->topic->topic_posts ) ); 216 } 217 218 function bp_the_topic_tag_count() { 219 global $forum_template; 220 221 echo apply_filters( 'bp_the_topic_tag_count', $forum_template->topic->tag_count ); 222 } 223 224 function bp_the_topic_permalink() { 225 global $forum_template, $bbpress_live, $group_obj; 226 227 $target_uri = $bbpress_live->fetch->options['target_uri']; 228 229 echo apply_filters( 'bp_the_topic_permalink', bp_group_permalink( $group_obj, false ) . '/forum/topic/' . $forum_template->topic->topic_id ); 230 } 231 232 function bp_the_topic_time_since_created() { 233 global $forum_template; 234 235 echo apply_filters( 'bp_the_topic_time_since_created', $forum_template->topic->topic_start_time_since ); 236 } 237 238 function bp_the_topic_latest_post_excerpt() { 239 global $forum_template; 240 241 $post = bp_forums_get_post( $forum_template->topic->topic_last_post_id ); 242 echo apply_filters( 'bp_the_topic_latest_post_excerpt', $post->post_text ); 243 } 244 245 function bp_the_topic_time_since_last_post( $echo = false ) { 246 global $forum_template; 247 248 if ( $echo ) 249 echo apply_filters( 'bp_the_topic_time_since_last_post', $forum_template->topic->topic_time_since ); 250 else 251 return apply_filters( 'bp_the_topic_time_since_last_post', $forum_template->topic->topic_time_since ); 252 } 311 echo bp_get_the_topic_time_since_last_post(); 312 } 313 function bp_get_the_topic_time_since_last_post() { 314 global $forum_template; 315 316 return apply_filters( 'bp_get_the_topic_time_since_last_post', $forum_template->topic->topic_time_since ); 317 } 253 318 254 319 function bp_forum_pagination() { 255 global $forum_template; 256 257 echo apply_filters( 'bp_forum_pagination', $forum_template->pag_links ); 258 } 320 echo bp_get_forum_pagination(); 321 } 322 function bp_get_forum_pagination() { 323 global $forum_template; 324 325 echo apply_filters( 'bp_get_forum_pagination', $forum_template->pag_links ); 326 } 259 327 260 328 function bp_forum_pagination_count() { … … 393 461 394 462 function bp_the_topic_post_id() { 395 global $topic_template; 396 echo apply_filters( 'bp_the_topic_post_id', $topic_template->post->post_id ); 397 } 463 echo bp_get_the_topic_post_id(); 464 } 465 function bp_get_the_topic_post_id() { 466 global $topic_template; 467 468 return apply_filters( 'bp_get_the_topic_post_id', $topic_template->post->post_id ); 469 } 398 470 399 471 function bp_the_topic_post_content() { 400 global $topic_template; 401 402 echo apply_filters( 'bp_the_topic_post_content', stripslashes( $topic_template->post->post_text ) ); 403 } 472 echo bp_get_the_topic_post_content(); 473 } 474 function bp_get_the_topic_post_content() { 475 global $topic_template; 476 477 return apply_filters( 'bp_get_the_topic_post_content', stripslashes( $topic_template->post->post_text ) ); 478 } 404 479 405 480 function bp_the_topic_post_poster_avatar() { 406 global $topic_template; 407 408 echo apply_filters( 'bp_the_topic_post_poster_avatar', bp_core_get_avatar( $topic_template->post->poster_id, 1, 20, 20 ) ); 409 } 410 411 function bp_the_topic_post_poster_name( $echo = true ) { 412 global $topic_template; 413 414 if ( $echo ) 415 echo apply_filters( 'bp_the_topic_post_poster_name', bp_core_get_userlink( $topic_template->post->poster_id ) ); 481 echo bp_the_topic_post_poster_avatar(); 482 } 483 function bp_get_the_topic_post_poster_avatar() { 484 global $topic_template; 485 486 return apply_filters( 'bp_get_the_topic_post_poster_avatar', bp_core_get_avatar( $topic_template->post->poster_id, 1, 20, 20 ) ); 487 } 488 489 function bp_the_topic_post_poster_name( $deprecated = true ) { 490 if ( !$deprecated ) 491 return bp_get_the_topic_post_poster_name(); 416 492 else 417 return apply_filters( 'bp_the_topic_post_poster_name', bp_core_get_userlink( $topic_template->post->poster_id ) ); 418 } 419 420 function bp_the_topic_post_time_since( $echo = true ) { 421 global $topic_template; 422 423 if ( $echo ) 424 echo apply_filters( 'bp_the_topic_post_time_since', $topic_template->post->post_time_since ); 493 echo bp_get_the_topic_post_poster_name(); 494 } 495 function bp_get_the_topic_post_poster_name() { 496 global $topic_template; 497 498 return apply_filters( 'bp_get_the_topic_post_poster_name', bp_core_get_userlink( $topic_template->post->poster_id ) ); 499 } 500 501 function bp_the_topic_post_time_since( $deprecated = true ) { 502 if ( !$deprecated ) 503 return bp_get_the_topic_post_time_since(); 425 504 else 426 return apply_filters( 'bp_the_topic_post_time_since', $topic_template->post->post_time_since ); 427 } 505 echo bp_get_the_topic_post_time_since(); 506 } 507 function bp_get_the_topic_post_time_since() { 508 global $topic_template; 509 510 return apply_filters( 'bp_get_the_topic_post_time_since', $topic_template->post->post_time_since ); 511 } 428 512 429 513 function bp_the_topic_pagination() { 430 global $topic_template; 431 432 echo apply_filters( 'bp_the_topic_pagination', $topic_template->pag_links ); 433 } 514 echo bp_get_the_topic_pagination(); 515 } 516 function bp_get_the_topic_pagination() { 517 global $topic_template; 518 519 return apply_filters( 'bp_get_the_topic_pagination', $topic_template->pag_links ); 520 } 434 521 435 522 function bp_the_topic_pagination_count() { … … 446 533 447 534 function bp_forum_permalink() { 448 global $group_obj; 449 450 echo apply_filters( 'bp_forum_permalink', bp_group_permalink( $group_obj, false ) . '/forum' ); 451 } 535 echo bp_get_forum_permalink(); 536 } 537 function bp_get_forum_permalink() { 538 global $group_obj; 539 540 return apply_filters( 'bp_get_forum_permalink', bp_get_group_permalink( $group_obj ) . '/forum' ); 541 } 452 542 453 543 function bp_forum_action() { 454 global $topic_template; 455 456 echo apply_filters( 'bp_forum_action', bp_group_permalink( $group_obj, false ) . '/forum' ); 457 } 544 echo bp_get_forum_action(); 545 } 546 function bp_get_forum_action() { 547 global $topic_template; 548 549 return apply_filters( 'bp_get_forum_action', bp_get_group_permalink( $group_obj ) . '/forum' ); 550 } 458 551 459 552 function bp_forum_topic_action() { 460 global $topic_template; 461 462 463 echo apply_filters( 'bp_forum_topic_action', bp_group_permalink( $group_obj, false ) . '/forum/topic/' . $topic_template->topic_id ); 464 } 553 echo bp_get_forum_topic_action(); 554 } 555 function bp_get_forum_topic_action() { 556 global $topic_template; 557 558 return apply_filters( 'bp_get_forum_topic_action', bp_get_group_permalink( $group_obj ) . '/forum/topic/' . $topic_template->topic_id ); 559 } 465 560 466 561 ?> -
trunk/bp-friends.php
r1399 r1408 12 12 require ( 'bp-friends/bp-friends-cssjs.php' ); 13 13 require ( 'bp-friends/bp-friends-templatetags.php' ); 14 require ( 'bp-friends/bp-friends-filters.php' );15 14 16 15 /************************************************************************** -
trunk/bp-friends/bp-friends-templatetags.php
r1398 r1408 182 182 } 183 183 184 function bp_friend_avatar_thumb( $template = false ) { 185 global $friends_template; 186 187 if ( !$template ) 188 $template = &$friends_template->friendship->friend; 189 190 echo apply_filters( 'bp_friend_avatar_thumb', $template->avatar_thumb ); 191 } 192 193 function bp_friend_status( $template = false ) { 194 global $friends_template; 195 196 if ( !$template ) 197 $template = &$friends_template->friendship->friend; 198 199 if ( $template->status ) 200 echo apply_filters( 'bp_friend_status', $template->status ); 201 } 202 203 function bp_friend_name( $template = false ) { 204 global $friends_template; 205 206 if ( !$template ) 207 $template = &$friends_template->friendship->friend; 208 209 echo apply_filters( 'bp_friend_name', strip_tags( $template->user_link ) ); 210 } 211 212 function bp_friend_link( $template = false ) { 213 global $friends_template; 214 215 if ( !$template ) 216 $template = &$friends_template->friendship->friend; 217 218 echo apply_filters( 'bp_friend_link', $template->user_link ); 219 } 220 221 function bp_friend_url( $template = false ) { 222 global $friends_template; 223 224 if ( !$template ) 225 $template = &$friends_template->friendship->friend; 226 227 echo apply_filters( 'bp_friend_url', $template->user_url ); 228 } 229 230 function bp_friend_last_active( $time = false, $template = false ) { 231 global $friends_template; 232 233 if ( !$time ) 234 $time = $friends_template->friendship->friend->last_active; 235 236 if ( !$template ) 237 $template = &$friends_template->friendship->friend; 238 239 echo apply_filters( 'bp_friend_last_active', $time ); 240 } 241 242 function bp_friend_last_profile_update( $template = false ) { 243 global $friends_template; 244 245 if ( !$template ) 246 $template = &$friends_template->friendship->friend; 247 248 echo apply_filters( 'bp_friend_last_profile_update', $template->profile_last_updated ); 249 } 250 251 function bp_friend_last_status_update( $template = false ) { 252 global $friends_template; 253 254 if ( !$template ) 255 $template = &$friends_template->friendship->friend; 256 257 echo apply_filters( 'bp_friend_last_status_update', $template->profile_last_updated ); 258 } 259 260 261 function bp_friend_last_content_update( $template = false ) { 262 global $friends_template; 263 264 if ( !$template ) 265 $template = &$friends_template->friendship->friend; 266 267 echo apply_filters( 'bp_friend_last_content_update', $template->content_last_updated ); 268 } 269 184 function bp_friend_avatar_thumb() { 185 echo bp_get_friend_avatar_thumb(); 186 } 187 function bp_get_friend_avatar_thumb() { 188 global $friends_template; 189 190 if ( !$template ) 191 $template = &$friends_template->friendship->friend; 192 193 return apply_filters( 'bp_get_friend_avatar_thumb', $friends_template->friendship->friend->avatar_thumb ); 194 } 195 196 function bp_friend_status() { 197 echo bp_get_friend_status(); 198 } 199 function bp_get_friend_status() { 200 global $friends_template; 201 202 if ( $friends_template->friendship->friend->status ) 203 return apply_filters( 'bp_get_friend_status', $friends_template->friendship->friend->status ); 204 205 return false; 206 } 207 208 function bp_friend_name() { 209 echo bp_get_friend_name(); 210 } 211 function bp_get_friend_name() { 212 global $friends_template; 213 214 return apply_filters( 'bp_get_friend_name', strip_tags( $friends_template->friendship->friend->user_link ) ); 215 } 216 217 function bp_friend_link() { 218 echo bp_get_friend_link(); 219 } 220 function bp_get_friend_link() { 221 global $friends_template; 222 223 return apply_filters( 'bp_get_friend_link', $friends_template->friendship->friend->user_link ); 224 } 225 226 function bp_friend_url() { 227 echo bp_get_friend_url(); 228 } 229 function bp_get_friend_url() { 230 global $friends_template; 231 232 return apply_filters( 'bp_get_friend_url', $friends_template->friendship->friend->user_url ); 233 } 234 235 function bp_friend_last_active() { 236 echo bp_get_friend_last_active(); 237 } 238 function bp_get_friend_last_active() { 239 global $friends_template; 240 241 return apply_filters( 'bp_get_friend_last_active', $friends_template->friendship->friend->last_active ); 242 } 243 244 function bp_friend_last_profile_update() { 245 echo bp_get_friend_last_profile_update(); 246 } 247 function bp_get_friend_last_profile_update() { 248 global $friends_template; 249 250 return apply_filters( 'bp_get_friend_last_profile_update', $friends_template->friendship->friend->profile_last_updated ); 251 } 252 253 function bp_friend_last_status_update() { 254 echo bp_get_friend_last_status_update(); 255 } 256 function bp_get_friend_last_status_update() { 257 global $friends_template; 258 259 echo apply_filters( 'bp_get_friend_last_status_update', $friends_template->friendship->friend->profile_last_updated ); 260 } 261 262 function bp_friend_last_content_update() { 263 echo bp_get_friend_last_content_update(); 264 } 265 function bp_get_friend_last_content_update() { 266 global $friends_template; 267 268 echo apply_filters( 'bp_get_friend_last_content_update', $friends_template->friendship->friend->content_last_updated ); 269 } 270 270 271 function bp_friend_time_since_requested() { 271 global $friends_template; 272 273 if ( $friends_template->friendship->date_created != "0000-00-00 00:00:00" ) { 274 echo apply_filters( 'bp_friend_time_since_requested', sprintf( __( 'requested %s ago', 'buddypress' ), bp_core_time_since( strtotime( $friends_template->friendship->date_created ) ) ) ); 275 } 276 } 272 echo bp_get_friend_time_since_requested(); 273 } 274 function bp_get_friend_time_since_requested() { 275 global $friends_template; 276 277 if ( $friends_template->friendship->date_created != "0000-00-00 00:00:00" ) { 278 return apply_filters( 'bp_friend_time_since_requested', sprintf( __( 'requested %s ago', 'buddypress' ), bp_core_time_since( strtotime( $friends_template->friendship->date_created ) ) ) ); 279 } 280 281 return false; 282 } 277 283 278 284 function bp_friend_accept_request_link() { 279 global $friends_template, $bp; 280 281 echo apply_filters( 'bp_friend_accept_request_link', wp_nonce_url( $bp->loggedin_user->domain . $bp->friends->slug . '/requests/accept/' . $friends_template->friendship->id, 'friends_accept_friendship' ) ); 282 } 285 echo bp_get_friend_accept_request_link(); 286 } 287 function bp_get_friend_accept_request_link() { 288 global $friends_template, $bp; 289 290 return apply_filters( 'bp_get_friend_accept_request_link', wp_nonce_url( $bp->loggedin_user->domain . $bp->friends->slug . '/requests/accept/' . $friends_template->friendship->id, 'friends_accept_friendship' ) ); 291 } 283 292 284 293 function bp_friend_reject_request_link() { 285 global $friends_template, $bp; 286 287 echo apply_filters( 'bp_friend_reject_request_link', wp_nonce_url( $bp->loggedin_user->domain . $bp->friends->slug . '/requests/reject/' . $friends_template->friendship->id, 'friends_reject_friendship' ) ); 288 } 294 echo bp_get_friend_reject_request_link(); 295 } 296 function bp_get_friend_reject_request_link() { 297 global $friends_template, $bp; 298 299 return apply_filters( 'bp_get_friend_reject_request_link', wp_nonce_url( $bp->loggedin_user->domain . $bp->friends->slug . '/requests/reject/' . $friends_template->friendship->id, 'friends_reject_friendship' ) ); 300 } 289 301 290 302 function bp_friend_pagination() { 291 global $friends_template; 292 echo apply_filters( 'bp_friend_pagination', $friends_template->pag_links ); 293 } 303 echo bp_get_friend_pagination(); 304 } 305 function bp_get_friend_pagination() { 306 global $friends_template; 307 308 return apply_filters( 'bp_friend_pagination', $friends_template->pag_links ); 309 } 310 294 311 295 312 function bp_friend_search_form() { -
trunk/bp-groups.php
r1396 r1408 387 387 388 388 if ( $completed_to_step == 4 ) 389 bp_core_redirect( bp_g roup_permalink( $group_obj, false) );389 bp_core_redirect( bp_get_group_permalink( $group_obj ) ); 390 390 } 391 391 … … 427 427 if ( isset( $_POST['submit_reply'] ) && function_exists( 'bp_forums_new_post') ) { 428 428 groups_new_group_forum_post( $_POST['reply_text'], $topic_id ); 429 bp_core_redirect( bp_g roup_permalink( $group_obj, false) . '/forum/topic/' . $topic_id );429 bp_core_redirect( bp_get_group_permalink( $group_obj ) . '/forum/topic/' . $topic_id ); 430 430 } 431 431 … … 439 439 if ( isset( $_POST['submit_topic'] ) && function_exists( 'bp_forums_new_topic') ) { 440 440 groups_new_group_forum_topic( $_POST['topic_title'], $_POST['topic_text'], $_POST['topic_tags'], $forum_id ); 441 bp_core_redirect( bp_g roup_permalink( $group_obj, false) . '/forum/' );441 bp_core_redirect( bp_get_group_permalink( $group_obj ) . '/forum/' ); 442 442 } 443 443 … … 466 466 467 467 if ( !strpos( $_SERVER['HTTP_REFERER'], $bp->wire->slug ) ) { 468 bp_core_redirect( bp_g roup_permalink( $group_obj, false) );468 bp_core_redirect( bp_get_group_permalink( $group_obj ) ); 469 469 } else { 470 bp_core_redirect( bp_g roup_permalink( $group_obj, false) . '/' . $bp->wire->slug );470 bp_core_redirect( bp_get_group_permalink( $group_obj ) . '/' . $bp->wire->slug ); 471 471 } 472 472 … … 481 481 482 482 if ( !strpos( $_SERVER['HTTP_REFERER'], $bp->wire->slug ) ) { 483 bp_core_redirect( bp_g roup_permalink( $group_obj, false) );483 bp_core_redirect( bp_get_group_permalink( $group_obj ) ); 484 484 } else { 485 bp_core_redirect( bp_g roup_permalink( $group_obj, false) . '/' . $bp->wire->slug );485 bp_core_redirect( bp_get_group_permalink( $group_obj ) . '/' . $bp->wire->slug ); 486 486 } 487 487 … … 528 528 do_action( 'groups_screen_group_invite', $group_obj->id ); 529 529 530 bp_core_redirect( bp_g roup_permalink( $group_obj, false) );530 bp_core_redirect( bp_get_group_permalink( $group_obj ) ); 531 531 } else { 532 532 // Show send invite page … … 546 546 if ( groups_is_group_admin( $bp->loggedin_user->id, $group_obj->id ) ) { 547 547 bp_core_add_message( __('As the only group administrator, you cannot leave this group.', 'buddypress'), 'error' ); 548 bp_core_redirect( bp_g roup_permalink( $group_obj, false) );548 bp_core_redirect( bp_get_group_permalink( $group_obj ) ); 549 549 } 550 550 … … 552 552 if ( !groups_leave_group( $group_obj->id ) ) { 553 553 bp_core_add_message( __('There was an error leaving the group. Please try again.', 'buddypress'), 'error' ); 554 bp_core_redirect( bp_g roup_permalink( $group_obj, false) );554 bp_core_redirect( bp_get_group_permalink( $group_obj ) ); 555 555 } else { 556 556 bp_core_add_message( __('You left the group successfully.', 'buddypress') ); … … 560 560 } else if ( isset($bp->action_variables) && 'no' == $bp->action_variables[0] ) { 561 561 562 bp_core_redirect( bp_g roup_permalink( $group_obj, false) );562 bp_core_redirect( bp_get_group_permalink( $group_obj ) ); 563 563 564 564 } else { … … 587 587 bp_core_add_message( __( 'Your membership request was sent to the group administrator successfully. You will be notified when the group administrator responds to your request.', 'buddypress' ) ); 588 588 } 589 bp_core_redirect( bp_g roup_permalink( $group_obj, false) );589 bp_core_redirect( bp_get_group_permalink( $group_obj ) ); 590 590 } 591 591 … … 935 935 bp_core_add_message( __('You joined the group!', 'buddypress') ); 936 936 } 937 bp_core_redirect( bp_g roup_permalink( $group_obj, false) );937 bp_core_redirect( bp_get_group_permalink( $group_obj ) ); 938 938 } 939 939 … … 995 995 996 996 $user_link = bp_core_get_userlink( $user_id ); 997 $group_link = bp_g roup_permalink( $group, false);997 $group_link = bp_get_group_permalink( $group ); 998 998 999 999 return array( … … 1009 1009 1010 1010 $user_link = bp_core_get_userlink( $user_id ); 1011 $group_link = bp_g roup_permalink( $group, false);1011 $group_link = bp_get_group_permalink( $group ); 1012 1012 1013 1013 return array( … … 1024 1024 1025 1025 $user_link = bp_core_get_userlink( $user_id ); 1026 $group_link = bp_g roup_permalink( $group, false);1026 $group_link = bp_get_group_permalink( $group ); 1027 1027 $post_excerpt = bp_create_excerpt( $wire_post->content ); 1028 1028 … … 1047 1047 1048 1048 $user_link = bp_core_get_userlink($user_id); 1049 $group_link = bp_g roup_permalink( $group, false);1049 $group_link = bp_get_group_permalink( $group ); 1050 1050 1051 1051 $post_content = apply_filters( 'bp_the_topic_post_content', bp_create_excerpt( stripslashes( $forum_post['post_text'] ), 55, false ) ); … … 1072 1072 1073 1073 $user_link = bp_core_get_userlink($user_id); 1074 $group_link = bp_g roup_permalink( $group, false);1074 $group_link = bp_get_group_permalink( $group ); 1075 1075 1076 1076 $post_content = apply_filters( 'bp_the_topic_post_content', bp_create_excerpt( stripslashes( $forum_post['post_text'] ), 55, false ) ); … … 1104 1104 $group = new BP_Groups_Group( $group_id, false, false ); 1105 1105 1106 $group_link = bp_g roup_permalink( $group, false);1106 $group_link = bp_get_group_permalink( $group ); 1107 1107 1108 1108 if ( (int)$total_items > 1 ) { … … 1118 1118 1119 1119 $group = new BP_Groups_Group( $group_id, false, false ); 1120 $group_link = bp_g roup_permalink( $group, false) . '/?new';1120 $group_link = bp_get_group_permalink( $group ) . '/?new'; 1121 1121 1122 1122 if ( (int)$total_items > 1 ) { … … 1131 1131 1132 1132 $group = new BP_Groups_Group( $group_id, false, false ); 1133 $group_link = bp_g roup_permalink( $group, false) . '/?new';1133 $group_link = bp_get_group_permalink( $group ) . '/?new'; 1134 1134 1135 1135 if ( (int)$total_items > 1 ) { … … 1145 1145 1146 1146 $group = new BP_Groups_Group( $group_id, false, false ); 1147 $group_link = bp_g roup_permalink( $group, false) . '/?new';1147 $group_link = bp_get_group_permalink( $group ) . '/?new'; 1148 1148 1149 1149 if ( (int)$total_items > 1 ) { … … 1158 1158 1159 1159 $group = new BP_Groups_Group( $group_id, false, false ); 1160 $group_link = bp_g roup_permalink( $group, false) . '/?new';1160 $group_link = bp_get_group_permalink( $group ) . '/?new'; 1161 1161 1162 1162 if ( (int)$total_items > 1 ) { -
trunk/bp-groups/bp-groups-ajax.php
r1371 r1408 93 93 94 94 <div class="item"> 95 <div class="item-title"><a href="<?php echo bp_g roup_permalink( $group, true) ?>" title="<?php echo $group->name ?>"><?php echo $group->name ?></a></div>95 <div class="item-title"><a href="<?php echo bp_get_group_permalink( $group ) ?>" title="<?php echo $group->name ?>"><?php echo $group->name ?></a></div> 96 96 <div class="item-meta"> 97 97 <span class="activity"> … … 238 238 _e( 'Error joining group', 'buddypress' ); 239 239 } else { 240 echo '<a id="group-' . $group->id . '" class="leave-group" rel="leave" title="' . __( 'Leave Group', 'buddypress' ) . '" href="' . wp_nonce_url( bp_g roup_permalink( $group, false) . '/leave-group', 'groups_leave_group' ) . '">' . __( 'Leave Group', 'buddypress' ) . '</a>';240 echo '<a id="group-' . $group->id . '" class="leave-group" rel="leave" title="' . __( 'Leave Group', 'buddypress' ) . '" href="' . wp_nonce_url( bp_get_group_permalink( $group ) . '/leave-group', 'groups_leave_group' ) . '">' . __( 'Leave Group', 'buddypress' ) . '</a>'; 241 241 } 242 242 … … 248 248 _e( 'Error requesting membership', 'buddypress' ); 249 249 } else { 250 echo '<a id="group-' . $group->id . '" class="membership-requested" rel="membership-requested" title="' . __( 'Membership Requested', 'buddypress' ) . '" href="' . bp_g roup_permalink( $group, false) . '">' . __( 'Membership Requested', 'buddypress' ) . '</a>';250 echo '<a id="group-' . $group->id . '" class="membership-requested" rel="membership-requested" title="' . __( 'Membership Requested', 'buddypress' ) . '" href="' . bp_get_group_permalink( $group ) . '">' . __( 'Membership Requested', 'buddypress' ) . '</a>'; 251 251 } 252 252 } … … 260 260 } else { 261 261 if ( 'public' == $group->status ) { 262 echo '<a id="group-' . $group->id . '" class="join-group" rel="join" title="' . __( 'Join Group', 'buddypress' ) . '" href="' . wp_nonce_url( bp_g roup_permalink( $group, false) . '/join', 'groups_join_group' ) . '">' . __( 'Join Group', 'buddypress' ) . '</a>';262 echo '<a id="group-' . $group->id . '" class="join-group" rel="join" title="' . __( 'Join Group', 'buddypress' ) . '" href="' . wp_nonce_url( bp_get_group_permalink( $group ) . '/join', 'groups_join_group' ) . '">' . __( 'Join Group', 'buddypress' ) . '</a>'; 263 263 } else if ( 'private' == $group->status ) { 264 echo '<a id="group-' . $group->id . '" class="request-membership" rel="join" title="' . __( 'Request Membership', 'buddypress' ) . '" href="' . wp_nonce_url( bp_g roup_permalink( $group, false) . '/request-membership', 'groups_send_membership_request' ) . '">' . __( 'Request Membership', 'buddypress' ) . '</a>';264 echo '<a id="group-' . $group->id . '" class="request-membership" rel="join" title="' . __( 'Request Membership', 'buddypress' ) . '" href="' . wp_nonce_url( bp_get_group_permalink( $group ) . '/request-membership', 'groups_send_membership_request' ) . '">' . __( 'Request Membership', 'buddypress' ) . '</a>'; 265 265 } 266 266 } -
trunk/bp-groups/bp-groups-filters.php
r1366 r1408 2 2 3 3 /* Apply WordPress defined filters */ 4 add_filter( 'bp_group_description', 'wptexturize' ); 5 add_filter( 'bp_group_description_excerpt', 'wptexturize' ); 6 add_filter( 'bp_group_news', 'wptexturize' ); 7 add_filter( 'bp_group_name', 'wptexturize' ); 4 add_filter( 'bp_get_group_description', 'wptexturize' ); 5 add_filter( 'bp_get_group_description_excerpt', 'wptexturize' ); 6 add_filter( 'bp_get_the_site_group_description', 'wptexturize' ); 7 add_filter( 'bp_get_the_site_group_description_excerpt', 'wptexturize' ); 8 add_filter( 'bp_get_group_news', 'wptexturize' ); 9 add_filter( 'bp_get_group_name', 'wptexturize' ); 10 add_filter( 'bp_get_the_site_group_name', 'wptexturize' ); 8 11 9 add_filter( 'bp_group_description', 'convert_smilies' ); 10 add_filter( 'bp_group_description_excerpt', 'convert_smilies' ); 11 add_filter( 'bp_group_news', 'convert_smilies' ); 12 add_filter( 'bp_get_group_description', 'convert_smilies' ); 13 add_filter( 'bp_get_group_description_excerpt', 'convert_smilies' ); 14 add_filter( 'bp_get_group_news', 'convert_smilies' ); 15 add_filter( 'bp_get_the_site_group_description', 'convert_smilies' ); 16 add_filter( 'bp_get_the_site_group_description_excerpt', 'convert_smilies' ); 12 17 13 add_filter( 'bp_group_description', 'convert_chars' ); 14 add_filter( 'bp_group_description_excerpt', 'convert_chars' ); 15 add_filter( 'bp_group_news', 'convert_chars' ); 16 add_filter( 'bp_group_name', 'convert_chars' ); 18 add_filter( 'bp_get_group_description', 'convert_chars' ); 19 add_filter( 'bp_get_group_description_excerpt', 'convert_chars' ); 20 add_filter( 'bp_get_group_news', 'convert_chars' ); 21 add_filter( 'bp_get_group_name', 'convert_chars' ); 22 add_filter( 'bp_get_the_site_group_name', 'convert_chars' ); 23 add_filter( 'bp_get_the_site_group_description', 'convert_chars' ); 24 add_filter( 'bp_get_the_site_group_description_excerpt', 'convert_chars' ); 17 25 18 add_filter( 'bp_group_description', 'wpautop' ); 19 add_filter( 'bp_group_news', 'wpautop' ); 26 add_filter( 'bp_get_group_description', 'wpautop' ); 27 add_filter( 'bp_get_group_description_excerpt', 'wpautop' ); 28 add_filter( 'bp_get_group_news', 'wpautop' ); 29 add_filter( 'bp_get_the_site_group_description', 'wpautop' ); 30 add_filter( 'bp_get_the_site_group_description_excerpt', 'wpautop' ); 20 31 21 add_filter( 'bp_g roup_description', 'make_clickable' );22 add_filter( 'bp_g roup_description_excerpt', 'make_clickable' );23 add_filter( 'bp_g roup_news', 'make_clickable' );32 add_filter( 'bp_get_group_description', 'make_clickable' ); 33 add_filter( 'bp_get_group_description_excerpt', 'make_clickable' ); 34 add_filter( 'bp_get_group_news', 'make_clickable' ); 24 35 25 add_filter( 'bp_group_description', 'wp_filter_kses', 1 ); 26 add_filter( 'bp_group_description_excerpt', 'wp_filter_kses', 1 ); 27 add_filter( 'bp_group_news', 'wp_filter_kses', 1 ); 28 add_filter( 'bp_group_name', 'wp_filter_kses', 1 ); 36 add_filter( 'bp_get_group_name', 'wp_filter_kses', 1 ); 37 add_filter( 'bp_get_group_description', 'wp_filter_kses', 1 ); 38 add_filter( 'bp_get_group_description_excerpt', 'wp_filter_kses', 1 ); 39 add_filter( 'bp_get_group_news', 'wp_filter_kses', 1 ); 40 add_filter( 'bp_get_the_site_group_name', 'wp_filter_kses', 1 ); 41 add_filter( 'bp_get_the_site_group_description', 'wp_filter_kses', 1 ); 42 add_filter( 'bp_get_the_site_group_description_excerpt', 'wp_filter_kses', 1 ); 29 43 add_filter( 'groups_details_name_pre_save', 'wp_filter_kses', 1 ); 30 44 add_filter( 'groups_details_description_pre_save', 'wp_filter_kses', 1 ); 31 45 add_filter( 'groups_details_news_pre_save', 'wp_filter_kses', 1 ); 32 46 33 add_filter( 'bp_g roup_description', 'stripslashes' );34 add_filter( 'bp_g roup_description_excerpt', 'stripslashes' );35 add_filter( 'bp_g roup_news', 'stripslashes' );36 add_filter( 'bp_g roup_name', 'stripslashes' );47 add_filter( 'bp_get_group_description', 'stripslashes' ); 48 add_filter( 'bp_get_group_description_excerpt', 'stripslashes' ); 49 add_filter( 'bp_get_group_news', 'stripslashes' ); 50 add_filter( 'bp_get_group_name', 'stripslashes' ); 37 51 38 52 add_filter( 'groups_new_group_forum_desc', 'bp_create_excerpt' ); -
trunk/bp-groups/bp-groups-notifications.php
r1366 r1408 101 101 $requesting_ud = get_userdata($requesting_user_id); 102 102 103 $group_request_accept = wp_nonce_url( bp_g roup_permalink( $group, false) . '/admin/membership-requests/accept/' . $membership_id, 'groups_accept_membership_request' );104 $group_request_reject = wp_nonce_url( bp_g roup_permalink( $group, false) . '/admin/membership-requests/reject/' . $membership_id, 'groups_reject_membership_request' );103 $group_request_accept = wp_nonce_url( bp_get_group_permalink( $group ) . '/admin/membership-requests/accept/' . $membership_id, 'groups_accept_membership_request' ); 104 $group_request_reject = wp_nonce_url( bp_get_group_permalink( $group ) . '/admin/membership-requests/reject/' . $membership_id, 'groups_reject_membership_request' ); 105 105 $profile_link = site_url() . '/' . BP_MEMBERS_SLUG . '/' . $requesting_ud->user_login . '/profile'; 106 106 $settings_link = site_url() . '/' . BP_MEMBERS_SLUG . '/' . $ud->user_login . '/settings/notifications'; … … 146 146 $ud = get_userdata($requesting_user_id); 147 147 148 $group_link = bp_g roup_permalink( $group, false);148 $group_link = bp_get_group_permalink( $group ); 149 149 $settings_link = site_url() . '/' . BP_MEMBERS_SLUG . '/' . $ud->user_login . '/settings/notifications'; 150 150 … … 199 199 $ud = get_userdata($user_id); 200 200 201 $group_link = bp_g roup_permalink( $group, false);201 $group_link = bp_get_group_permalink( $group ); 202 202 $settings_link = site_url() . '/' . BP_MEMBERS_SLUG . '/' . $ud->user_login . '/settings/notifications'; 203 203 … … 229 229 $inviter_link = site_url() . '/' . BP_MEMBERS_SLUG . '/' . $inviter_ud->user_login; 230 230 231 $group_link = bp_g roup_permalink( $group, false);231 $group_link = bp_get_group_permalink( $group ); 232 232 233 233 if ( !$member->invite_sent ) { -
trunk/bp-groups/bp-groups-templatetags.php
r1398 r1408 29 29 global $create_group_step; 30 30 31 switch( $create_group_step ) {32 case '1':31 switch( (int) $create_group_step ) { 32 case 1: 33 33 echo '<span>— ' . __('Group Details', 'buddypress') . '</span>'; 34 34 break; 35 35 36 case '2':36 case 2: 37 37 echo '<span>— ' . __('Group Settings', 'buddypress') . '</span>'; 38 38 break; 39 39 40 case '3':40 case 3: 41 41 echo '<span>— ' . __('Group Avatar', 'buddypress') . '</span>'; 42 42 break; 43 43 44 case '4':44 case 4: 45 45 echo '<span>— ' . __('Invite Members', 'buddypress') . '</span>'; 46 46 break; … … 54 54 ?> 55 55 <form action="<?php echo $bp->displayed_user->domain . $bp->groups->slug ?>/create/step/<?php echo $create_group_step ?>" method="post" id="create-group-form" class="standard-form" enctype="multipart/form-data"> 56 <?php switch( $create_group_step ) {57 case '1': ?>56 <?php switch( (int) $create_group_step ) { 57 case 1: ?> 58 58 <label for="group-name">* <?php _e('Group Name', 'buddypress') ?></label> 59 59 <input type="text" name="group-name" id="group-name" value="<?php echo ( $group_obj ) ? $group_obj->name : $_POST['group-name']; ?>" /> … … 72 72 <?php break; ?> 73 73 74 <?php case '2': ?>74 <?php case 2: ?> 75 75 <?php if ( $completed_to_step > 0 ) { ?> 76 76 <?php if ( function_exists('bp_wire_install') ) : ?> … … 147 147 <?php break; ?> 148 148 149 <?php case '3': ?>149 <?php case 3: ?> 150 150 <?php if ( $completed_to_step > 1 ) { ?> 151 151 <div class="left-menu"> … … 176 176 <?php } ?> 177 177 <?php break; ?> 178 <?php case '4': ?>178 <?php case 4: ?> 179 179 <?php 180 180 if ( $completed_to_step > 2 ) { 181 $group_link = bp_g roup_permalink( $group_obj, false);181 $group_link = bp_get_group_permalink( $group_obj ); 182 182 183 183 if ( function_exists('friends_install') ) { … … 307 307 <li> 308 308 <div class="item-avatar"> 309 <a href="<?php echo bp_g roup_permalink( $group ) ?>" title="<?php echo $group->name ?>"><img src="<?php echo $group->avatar_thumb ?>" class="avatar" alt="<?php printf( __( '%s Avatar', 'buddypress' ), $group->name ) ?>" /></a>309 <a href="<?php echo bp_get_group_permalink( $group ) ?>" title="<?php echo $group->name ?>"><img src="<?php echo $group->avatar_thumb ?>" class="avatar" alt="<?php printf( __( '%s Avatar', 'buddypress' ), $group->name ) ?>" /></a> 310 310 </div> 311 311 312 312 <div class="item"> 313 <div class="item-title"><a href="<?php echo bp_g roup_permalink( $group ) ?>" title="<?php echo $group->name ?>"><?php echo $group->name ?></a></div>313 <div class="item-title"><a href="<?php echo bp_get_group_permalink( $group ) ?>" title="<?php echo $group->name ?>"><?php echo $group->name ?></a></div> 314 314 <div class="item-meta"><span class="activity"><?php echo bp_core_get_last_activity( groups_get_groupmeta( $group->id, 'last_activity' ), __( 'active %s ago', 'buddypress' ) ) ?></span></div> 315 315 <div class="item-meta desc"><?php echo bp_create_excerpt( $group->description ) ?></div> … … 361 361 } 362 362 ?> <li> 363 <a href="<?php echo bp_g roup_permalink( $group, false) ?>"><img src="<?php echo $group->avatar_thumb; ?>" class="avatar" alt="<?php _e( 'Group Avatar', 'buddypress' ) ?>" /></a>364 <h5><a href="<?php echo bp_g roup_permalink( $group, false) ?>"><?php echo $group->name ?></a></h5>363 <a href="<?php echo bp_get_group_permalink( $group ) ?>"><img src="<?php echo $group->avatar_thumb; ?>" class="avatar" alt="<?php _e( 'Group Avatar', 'buddypress' ) ?>" /></a> 364 <h5><a href="<?php echo bp_get_group_permalink( $group ) ?>"><?php echo $group->name ?></a></h5> 365 365 </li> 366 366 <?php } ?> … … 641 641 } 642 642 643 function bp_group_id( $ echo = true, $group= false ) {643 function bp_group_id( $deprecated = true, $deprecated2 = false ) { 644 644 global $groups_template; 645 645 646 if ( !$group ) 647 $group =& $groups_template->group; 648 649 if ( $echo ) 650 echo apply_filters( 'bp_group_id', $group->id ); 646 if ( !$deprecated ) 647 return bp_get_group_id(); 651 648 else 652 return apply_filters( 'bp_group_id', $group->id ); 653 } 654 655 function bp_group_name( $echo = true, $group = false ) { 649 echo bp_get_group_id(); 650 } 651 function bp_get_group_id( $group = false ) { 652 global $groups_template; 653 654 if ( !$group ) 655 $group =& $groups_template->group; 656 657 return apply_filters( 'bp_get_group_id', $group->id ); 658 } 659 660 function bp_group_name( $deprecated = true, $deprecated2 = false ) { 656 661 global $groups_template; 657 662 658 if ( !$group ) 659 $group =& $groups_template->group; 660 661 if ( $echo ) 662 echo apply_filters( 'bp_group_name', $group->name ); 663 if ( !$deprecated ) 664 return bp_get_group_name(); 663 665 else 664 return apply_filters( 'bp_group_name', $group->name ); 665 } 666 667 function bp_group_type( $group = false ) { 668 global $groups_template; 669 670 if ( !$group ) 671 $group =& $groups_template->group; 672 673 if ( 'public' == $group->status ) { 674 $type = __( "Public Group", "buddypress" ); 675 } else if ( 'hidden' == $group->status ) { 676 $type = __( "Hidden Group", "buddypress" ); 677 } else if ( 'private' == $group->status ) { 678 $type = __( "Private Group", "buddypress" ); 679 } else { 680 $type = ucwords( $group->status ) . ' ' . __( 'Group', 'buddypress' ); 681 } 682 683 echo apply_filters( 'bp_group_type', $type ); 684 } 685 686 function bp_group_avatar( $group = false ) { 687 global $groups_template; 688 689 if ( !$group ) 690 $group =& $groups_template->group; 691 692 ?><img src="<?php echo $group->avatar_full ?>" class="avatar" alt="<?php echo $group->name ?> Avatar" /><?php 693 } 694 695 function bp_group_avatar_thumb( $group = false ) { 696 global $groups_template; 697 698 if ( !$group ) 699 $group =& $groups_template->group; 700 701 ?><img src="<?php echo $group->avatar_thumb ?>" class="avatar" alt="<?php echo $group->name ?> Avatar" /><?php 702 } 703 704 function bp_group_avatar_mini( $group = false) { 705 global $groups_template; 706 707 if ( !$group ) 708 $group =& $groups_template->group; 709 710 ?><img src="<?php echo $group->avatar_thumb ?>" width="30" height="30" class="avatar" alt="<?php echo $group->name ?> Avatar" /><?php 711 } 712 713 function bp_group_last_active( $echo = true, $group = false ) { 714 global $groups_template; 715 716 if ( !$group ) 717 $group =& $groups_template->group; 718 719 $last_active = groups_get_groupmeta( $group->id, 'last_activity' ); 720 721 if ( empty( $last_active ) ) { 722 if ( $echo ) 723 _e( 'not yet active', 'buddypress' ); 724 else 666 echo bp_get_group_name(); 667 } 668 function bp_get_group_name( $group = false ) { 669 global $groups_template; 670 671 if ( !$group ) 672 $group =& $groups_template->group; 673 674 return apply_filters( 'bp_get_group_name', $group->name ); 675 } 676 677 function bp_group_type() { 678 echo bp_get_group_type(); 679 } 680 function bp_get_group_type( $group = false ) { 681 global $groups_template; 682 683 if ( !$group ) 684 $group =& $groups_template->group; 685 686 if ( 'public' == $group->status ) { 687 $type = __( "Public Group", "buddypress" ); 688 } else if ( 'hidden' == $group->status ) { 689 $type = __( "Hidden Group", "buddypress" ); 690 } else if ( 'private' == $group->status ) { 691 $type = __( "Private Group", "buddypress" ); 692 } else { 693 $type = ucwords( $group->status ) . ' ' . __( 'Group', 'buddypress' ); 694 } 695 696 return apply_filters( 'bp_get_group_type', $type ); 697 } 698 699 function bp_group_avatar() { 700 echo bp_get_group_avatar(); 701 } 702 function bp_get_group_avatar( $group = false ) { 703 global $groups_template; 704 705 if ( !$group ) 706 $group =& $groups_template->group; 707 708 return apply_filters( 'bp_get_group_avatar', '<img src="' . $group->avatar_full . '" class="avatar" alt="' . $group->name . '" />', $group->avatar_full, $group->avatar_name ); 709 } 710 711 function bp_group_avatar_thumb() { 712 echo bp_get_group_avatar_thumb(); 713 } 714 function bp_get_group_avatar_thumb( $group = false ) { 715 global $groups_template; 716 717 if ( !$group ) 718 $group =& $groups_template->group; 719 720 return apply_filters( 'bp_get_group_avatar_thumb', '<img src="' . $group->avatar_thumb . '" class="avatar" alt="' . $group->name . '" />', $group->avatar_thumb, $group->avatar_name ); 721 } 722 723 function bp_group_avatar_mini() { 724 echo bp_get_group_avatar_mini(); 725 } 726 function bp_get_group_avatar_mini( $group = false ) { 727 global $groups_template; 728 729 if ( !$group ) 730 $group =& $groups_template->group; 731 732 return apply_filters( 'bp_get_group_avatar_mini', '<img src="' . $group->avatar_thumb . '" class="avatar" width="30" height="30" alt="' . $group->name . '" />', $group->avatar_thumb, $group->avatar_name ); 733 } 734 735 function bp_group_last_active( $deprecated = true, $deprecated2 = false ) { 736 if ( !$deprecated ) 737 return bp_get_group_last_active(); 738 else 739 echo bp_get_group_last_active(); 740 } 741 function bp_get_group_last_active( $group = false ) { 742 global $groups_template; 743 744 if ( !$group ) 745 $group =& $groups_template->group; 746 747 $last_active = groups_get_groupmeta( $group->id, 'last_activity' ); 748 749 if ( empty( $last_active ) ) { 725 750 return __( 'not yet active', 'buddypress' ); 726 } else { 727 if ( $echo ) 728 echo apply_filters( 'bp_group_last_active', bp_core_time_since( $last_active ) ); 729 else 730 return apply_filters( 'bp_group_last_active', bp_core_time_since( $last_active ) ); 731 } 732 } 733 734 function bp_group_permalink( $group = false, $echo = true ) { 735 global $groups_template, $bp, $current_blog; 736 737 if ( !$group ) 738 $group =& $groups_template->group; 739 740 if ( $echo ) 741 echo apply_filters( 'bp_group_permalink', $bp->root_domain . '/' . $bp->groups->slug . '/' . $group->slug ); 751 } else { 752 return apply_filters( 'bp_get_group_last_active', bp_core_time_since( $last_active ) ); 753 } 754 } 755 756 function bp_group_permalink( $deprecated = false, $deprecated2 = true ) { 757 if ( !$deprecated2 ) 758 return bp_get_group_permalink(); 742 759 else 743 return apply_filters( 'bp_group_permalink', $bp->root_domain . '/' . $bp->groups->slug . '/' . $group->slug ); 744 } 745 746 function bp_group_admin_permalink( $echo = true, $group = false ) { 747 global $groups_template, $bp, $current_blog; 748 749 if ( !$group ) 750 $group =& $groups_template->group; 751 752 if ( $echo ) 753 echo apply_filters( 'bp_group_admin_permalink', $bp->root_domain . '/' . $bp->groups->slug . '/' . $group->slug . '/admin' ); 760 echo bp_get_group_permalink(); 761 } 762 function bp_get_group_permalink( $group = false ) { 763 global $groups_template, $bp; 764 765 if ( !$group ) 766 $group =& $groups_template->group; 767 768 return apply_filters( 'bp_get_group_permalink', $bp->root_domain . '/' . $bp->groups->slug . '/' . $group->slug ); 769 } 770 771 function bp_group_admin_permalink( $deprecated = true, $deprecated2 = false ) { 772 if ( !$deprecated ) 773 return bp_get_group_admin_permalink(); 754 774 else 755 return apply_filters( 'bp_group_admin_permalink', $bp->root_domain . '/' . $bp->groups->slug . '/' . $group->slug . '/admin' ); 756 } 757 758 function bp_group_slug( $group = false ) { 759 global $groups_template; 760 761 if ( !$group ) 762 $group =& $groups_template->group; 763 764 echo apply_filters( 'bp_group_slug', $group->slug ); 765 } 766 767 function bp_group_description( $group = false, $echo = true ) { 768 global $groups_template; 769 770 if ( !$group ) 771 $group =& $groups_template->group; 772 773 if ( $echo ) 774 echo apply_filters( 'bp_group_description', stripslashes($group->description) ); 775 echo bp_get_group_admin_permalink(); 776 } 777 function bp_get_group_admin_permalink( $group = false ) { 778 global $groups_template, $bp; 779 780 if ( !$group ) 781 $group =& $groups_template->group; 782 783 return apply_filters( 'bp_get_group_admin_permalink', $bp->root_domain . '/' . $bp->groups->slug . '/' . $group->slug . '/admin' ); 784 } 785 786 function bp_group_slug() { 787 echo bp_get_group_slug(); 788 } 789 function bp_get_group_slug( $group = false ) { 790 global $groups_template; 791 792 if ( !$group ) 793 $group =& $groups_template->group; 794 795 return apply_filters( 'bp_get_group_slug', $group->slug ); 796 } 797 798 function bp_group_description( $deprecated = false, $deprecated2 = true ) { 799 if ( !$deprecated2 ) 800 return bp_get_group_description(); 775 801 else 776 return apply_filters( 'bp_group_description', stripslashes($group->description) ); 777 } 778 779 function bp_group_description_editable( $group = false ) { 780 global $groups_template; 781 782 if ( !$group ) 783 $group =& $groups_template->group; 784 785 echo apply_filters( 'bp_group_description_editable', $group->description ); 786 } 787 788 function bp_group_description_excerpt( $group = false ) { 789 global $groups_template; 790 791 if ( !$group ) 792 $group =& $groups_template->group; 793 794 echo apply_filters( 'bp_group_description_excerpt', bp_create_excerpt( $group->description, 20 ) ); 795 } 796 797 function bp_group_news( $group = false ) { 798 global $groups_template; 799 800 if ( !$group ) 801 $group =& $groups_template->group; 802 803 echo apply_filters( 'bp_group_news', stripslashes($groups_template->group->news) ); 804 } 805 806 function bp_group_news_editable( $group = false ) { 807 global $groups_template; 808 809 if ( !$group ) 810 $group =& $groups_template->group; 811 812 echo apply_filters( 'bp_group_news_editable', $group->news ); 813 } 814 815 function bp_group_public_status( $group = false ) { 816 global $groups_template; 817 818 if ( !$group ) 819 $group =& $groups_template->group; 820 821 if ( $group->is_public ) { 822 _e('Public', 'buddypress'); 823 } else { 824 _e('Private', 'buddypress'); 825 } 826 } 827 function bp_group_is_public( $group = false ) { 802 echo bp_get_group_description(); 803 } 804 function bp_get_group_description( $group = false ) { 828 805 global $groups_template; 829 806 … … 831 808 $group =& $groups_template->group; 832 809 833 return apply_filters( 'bp_group_is_public', $group->is_public ); 834 } 835 836 837 function bp_group_date_created( $group = false ) { 838 global $groups_template; 839 840 if ( !$group ) 841 $group =& $groups_template->group; 842 843 echo apply_filters( 'bp_group_date_created', date( get_option( 'date_format' ), $group->date_created ) ); 844 } 810 return apply_filters( 'bp_get_group_description', stripslashes($group->description) ); 811 } 812 813 function bp_group_description_editable( $deprecated = false ) { 814 echo bp_get_group_description_editable(); 815 } 816 function bp_get_group_description_editable( $group = false ) { 817 global $groups_template; 818 819 if ( !$group ) 820 $group =& $groups_template->group; 821 822 return apply_filters( 'bp_get_group_description_editable', $group->description ); 823 } 824 825 function bp_group_description_excerpt( $deprecated = false ) { 826 echo bp_get_group_description_excerpt(); 827 } 828 function bp_get_group_description_excerpt( $group = false ) { 829 global $groups_template; 830 831 if ( !$group ) 832 $group =& $groups_template->group; 833 834 return apply_filters( 'bp_get_group_description_excerpt', bp_create_excerpt( $group->description, 20 ) ); 835 } 836 837 function bp_group_news( $deprecated = false ) { 838 echo bp_get_group_news(); 839 } 840 function bp_get_group_news( $group = false ) { 841 global $groups_template; 842 843 if ( !$group ) 844 $group =& $groups_template->group; 845 846 return apply_filters( 'bp_get_group_news', stripslashes($groups_template->group->news) ); 847 } 848 849 function bp_group_news_editable( $deprecated = false ) { 850 echo bp_get_group_news_editable(); 851 } 852 function bp_get_group_news_editable( $group = false ) { 853 global $groups_template; 854 855 if ( !$group ) 856 $group =& $groups_template->group; 857 858 return apply_filters( 'bp_get_group_news_editable', $group->news ); 859 } 860 861 function bp_group_public_status( $deprecated = false ) { 862 echo bp_get_group_public_status(); 863 } 864 function bp_get_group_public_status( $group = false ) { 865 global $groups_template; 866 867 if ( !$group ) 868 $group =& $groups_template->group; 869 870 if ( $group->is_public ) { 871 return __( 'Public', 'buddypress' ); 872 } else { 873 return __( 'Private', 'buddypress' ); 874 } 875 } 876 877 function bp_group_is_public( $deprecated = false ) { 878 echo bp_get_group_is_public(); 879 } 880 function bp_get_group_is_public( $group = false ) { 881 global $groups_template; 882 883 if ( !$group ) 884 $group =& $groups_template->group; 885 886 return apply_filters( 'bp_get_group_is_public', $group->is_public ); 887 } 888 889 function bp_group_date_created( $deprecated = false ) { 890 echo bp_get_group_date_created(); 891 } 892 function bp_get_group_date_created( $group = false ) { 893 global $groups_template; 894 895 if ( !$group ) 896 $group =& $groups_template->group; 897 898 return apply_filters( 'bp_get_group_date_created', date( get_option( 'date_format' ), $group->date_created ) ); 899 } 845 900 846 901 function bp_group_list_admins( $full_list = true, $group = false ) { … … 909 964 } 910 965 911 function bp_group_all_members_permalink( $ echo = true, $group= false ) {966 function bp_group_all_members_permalink( $deprecated = true, $deprecated2 = false ) { 912 967 global $groups_template, $bp; 913 968 … … 915 970 $group =& $groups_template->group; 916 971 917 if ( $echo)918 echo apply_filters( 'bp_group_all_members_permalink', bp_group_permalink( $group, true ) . '/' . BP_MEMBERS_SLUG);972 if ( !$deprecated ) 973 return bp_get_group_all_members_permalink(); 919 974 else 920 return apply_filters( 'bp_group_all_members_permalink', bp_group_permalink( $group, false ) . '/' . BP_MEMBERS_SLUG ); 921 } 975 echo bp_get_group_all_members_permalink(); 976 } 977 function bp_get_group_all_members_permalink( $group = false ) { 978 global $groups_template, $bp; 979 980 if ( !$group ) 981 $group =& $groups_template->group; 982 983 return apply_filters( 'bp_get_group_all_members_permalink', bp_get_group_permalink( $group ) . '/' . BP_MEMBERS_SLUG ); 984 } 922 985 923 986 function bp_group_random_members( $group = false ) { … … 1018 1081 1019 1082 function bp_group_pagination() { 1020 global $groups_template; 1021 echo apply_filters( 'bp_group_pagination', $groups_template->pag_links ); 1022 } 1083 echo bp_get_group_pagination(); 1084 } 1085 function bp_get_group_pagination() { 1086 global $groups_template; 1087 1088 return apply_filters( 'bp_get_group_pagination', $groups_template->pag_links ); 1089 } 1023 1090 1024 1091 function bp_total_group_count() { 1025 global $groups_template; 1026 1027 echo apply_filters( 'bp_total_group_count', $groups_template->total_group_count ); 1028 } 1029 1030 function bp_group_total_members( $echo = true, $group = false ) { 1092 echo bp_get_total_group_count(); 1093 } 1094 function bp_get_total_group_count() { 1095 global $groups_template; 1096 1097 return apply_filters( 'bp_get_total_group_count', $groups_template->total_group_count ); 1098 } 1099 1100 function bp_group_total_members( $deprecated = true, $deprecated2 = false ) { 1101 if ( !$deprecated ) 1102 return bp_get_group_total_members(); 1103 else 1104 echo bp_get_group_total_members(); 1105 } 1106 function bp_get_group_total_members( $echo = true, $group = false ) { 1107 global $groups_template; 1108 1109 if ( !$group ) 1110 $group =& $groups_template->group; 1111 1112 return apply_filters( 'bp_get_group_total_members', $group->total_member_count ); 1113 } 1114 1115 function bp_group_show_wire_setting( $group = false ) { 1031 1116 global $groups_template; 1032 1117 … … 1034 1119 $group =& $groups_template->group; 1035 1120 1036 if ( $echo ) 1037 echo apply_filters( 'groups_template', $group->total_member_count ); 1038 else 1039 return apply_filters( 'groups_template', $group->total_member_count ); 1040 } 1041 1042 function bp_group_is_photos_enabled( $group = false ) { 1121 if ( $group->enable_wire ) 1122 echo ' checked="checked"'; 1123 } 1124 1125 function bp_group_is_wire_enabled( $group = false ) { 1043 1126 global $groups_template; 1044 1127 1045 1128 if ( !$group ) 1046 1129 $group =& $groups_template->group; 1047 1048 if ( $group->enable_photos )1049 return true;1050 1051 return false;1052 }1053 1054 function bp_group_show_wire_setting( $group = false ) {1055 global $groups_template;1056 1057 if ( !$group )1058 $group =& $groups_template->group;1059 1060 if ( $group->enable_wire )1061 echo ' checked="checked"';1062 }1063 1064 function bp_group_is_wire_enabled( $group = false ) {1065 global $groups_template;1066 1067 if ( !$group )1068 $group =& $groups_template->group;1069 1130 1070 1131 if ( $group->enable_wire ) … … 1074 1135 } 1075 1136 1076 function bp_group_forum_permalink( $group = false ) { 1077 global $groups_template; 1078 1079 if ( !$group ) 1080 $group =& $groups_template->group; 1081 1082 echo bp_group_permalink( $group, false ) . '/forum'; 1083 } 1137 function bp_group_forum_permalink( $deprecated = false ) { 1138 echo bp_get_group_forum_permalink(); 1139 } 1140 function bp_get_group_forum_permalink( $group = false ) { 1141 global $groups_template; 1142 1143 if ( !$group ) 1144 $group =& $groups_template->group; 1145 1146 return apply_filters( 'bp_get_group_forum_permalink', bp_get_group_permalink( $group ) . '/forum' ); 1147 } 1084 1148 1085 1149 function bp_group_is_forum_enabled( $group = false ) { … … 1110 1174 1111 1175 if ( $group->enable_forum ) 1112 echo ' checked="checked"';1113 }1114 1115 function bp_group_show_photos_setting( $group = false ) {1116 global $groups_template;1117 1118 if ( !$group )1119 $group =& $groups_template->group;1120 1121 if ( $group->enable_photos )1122 echo ' checked="checked"';1123 }1124 1125 function bp_group_show_photos_upload_setting( $permission, $group = false ) {1126 global $groups_template;1127 1128 if ( !$group )1129 $group =& $groups_template->group;1130 1131 if ( 'admin' == $permission && $group->photos_admin_only )1132 echo ' checked="checked"';1133 1134 if ( 'member' == $permission && !$group->photos_admin_only )1135 1176 echo ' checked="checked"'; 1136 1177 } … … 1231 1272 } 1232 1273 1233 function bp_group_member_promote_link( $group = false ) { 1234 global $members_template, $groups_template, $bp; 1235 1236 if ( !$group ) 1237 $group =& $groups_template->group; 1238 1239 echo apply_filters( 'bp_group_member_promote_link', wp_nonce_url( bp_group_permalink( $group, false ) . '/admin/manage-members/promote/' . $members_template->member->user_id, 'groups_promote_member' ) ); 1240 } 1241 1242 function bp_group_member_demote_link( $user_id = false, $group = false ) { 1243 global $members_template, $groups_template, $bp; 1244 1245 if ( !$group ) 1246 $group =& $groups_template->group; 1247 1274 function bp_group_member_promote_link( $user_id = false, $deprecated = false ) { 1275 global $members_template; 1276 1248 1277 if ( !$user_id ) 1249 1278 $user_id = $members_template->member->user_id; 1250 1251 echo apply_filters( 'bp_group_member_demote_link', wp_nonce_url( bp_group_permalink( $group, false ) . '/admin/manage-members/demote/' . $user_id, 'groups_demote_member' ) ); 1252 } 1253 1254 function bp_group_member_ban_link( $group = false ) { 1255 global $members_template, $groups_template, $bp; 1256 1257 if ( !$group ) 1258 $group =& $groups_template->group; 1259 1260 echo apply_filters( 'bp_group_member_ban_link', wp_nonce_url( bp_group_permalink( $group, false ) . '/admin/manage-members/ban/' . $members_template->member->user_id, 'groups_ban_member' ) ); 1261 } 1262 1263 function bp_group_member_unban_link( $group = false ) { 1264 global $members_template, $groups_template, $bp; 1265 1266 if ( !$group ) 1267 $group =& $groups_template->group; 1268 1269 echo apply_filters( 'bp_group_member_unban_link', wp_nonce_url( bp_group_permalink( $group, false ) . '/admin/manage-members/unban/' . $members_template->member->user_id, 'groups_unban_member' ) ); 1270 } 1279 1280 echo bp_get_group_member_promote_link( $user_id ); 1281 } 1282 function bp_get_group_member_promote_link( $user_id = false, $group = false ) { 1283 global $members_template, $groups_template, $bp; 1284 1285 if ( !$user_id ) 1286 $user_id = $members_template->member->user_id; 1287 1288 if ( !$group ) 1289 $group =& $groups_template->group; 1290 1291 return apply_filters( 'bp_get_group_member_promote_link', wp_nonce_url( bp_get_group_permalink( $group ) . '/admin/manage-members/promote/' . $user_id, 'groups_promote_member' ) ); 1292 } 1293 1294 function bp_group_member_demote_link( $user_id = false, $deprecated = false ) { 1295 global $members_template; 1296 1297 if ( !$user_id ) 1298 $user_id = $members_template->member->user_id; 1299 1300 echo bp_get_group_member_demote_link( $user_id ); 1301 } 1302 function bp_get_group_member_demote_link( $user_id = false, $group = false ) { 1303 global $members_template, $groups_template, $bp; 1304 1305 if ( !$group ) 1306 $group =& $groups_template->group; 1307 1308 if ( !$user_id ) 1309 $user_id = $members_template->member->user_id; 1310 1311 return apply_filters( 'bp_get_group_member_demote_link', wp_nonce_url( bp_get_group_permalink( $group ) . '/admin/manage-members/demote/' . $user_id, 'groups_demote_member' ) ); 1312 } 1313 1314 function bp_group_member_ban_link( $user_id = false, $deprecated = false ) { 1315 global $members_template; 1316 1317 if ( !$user_id ) 1318 $user_id = $members_template->member->user_id; 1319 1320 echo bp_get_group_member_ban_link( $user_id ); 1321 } 1322 function bp_get_group_member_ban_link( $user_id = false, $group = false ) { 1323 global $members_template, $groups_template, $bp; 1324 1325 if ( !$group ) 1326 $group =& $groups_template->group; 1327 1328 return apply_filters( 'bp_get_group_member_ban_link', wp_nonce_url( bp_get_group_permalink( $group ) . '/admin/manage-members/ban/' . $user_id, 'groups_ban_member' ) ); 1329 } 1330 1331 function bp_group_member_unban_link( $user_id = false, $deprecated = false ) { 1332 global $members_template; 1333 1334 if ( !$user_id ) 1335 $user_id = $members_template->member->user_id; 1336 1337 echo bp_get_group_member_unban_link( $user_id ); 1338 } 1339 function bp_get_group_member_unban_link( $user_id = false, $group = false ) { 1340 global $members_template; 1341 1342 if ( !$user_id ) 1343 $user_id = $members_template->member->user_id; 1344 1345 if ( !$group ) 1346 $group =& $groups_template->group; 1347 1348 return apply_filters( 'bp_get_group_member_unban_link', wp_nonce_url( bp_get_group_permalink( $group ) . '/admin/manage-members/unban/' . $user_id, 'groups_unban_member' ) ); 1349 } 1271 1350 1272 1351 function bp_group_admin_tabs( $group = false ) { … … 1306 1385 } 1307 1386 1308 function bp_group_form_action( $page, $group = false ) { 1387 function bp_group_form_action( $page, $deprecated = false ) { 1388 echo bp_get_group_form_action( $page ); 1389 } 1390 function bp_get_group_form_action( $page, $group = false ) { 1391 global $bp, $groups_template; 1392 1393 if ( !$group ) 1394 $group =& $groups_template->group; 1395 1396 return apply_filters( 'bp_group_form_action', bp_get_group_permalink( $group ) . '/' . $page ); 1397 } 1398 1399 function bp_group_admin_form_action( $page, $deprecated = false ) { 1400 echo bp_get_group_admin_form_action( $page ); 1401 } 1402 function bp_get_group_admin_form_action( $page, $group = false ) { 1403 global $bp, $groups_template; 1404 1405 if ( !$group ) 1406 $group =& $groups_template->group; 1407 1408 return apply_filters( 'bp_group_admin_form_action', bp_get_group_permalink( $group ) . '/admin/' . $page ); 1409 } 1410 1411 function bp_group_has_requested_membership( $group = false ) { 1309 1412 global $bp, $groups_template; 1310 1413 … … 1312 1415 $group =& $groups_template->group; 1313 1416 1314 echo apply_filters( 'bp_group_form_action', bp_group_permalink( $group, false ) . '/' . $page ); 1315 } 1316 1317 function bp_group_admin_form_action( $page, $group = false ) { 1417 if ( groups_check_for_membership_request( $bp->loggedin_user->id, $group->id ) ) 1418 return true; 1419 1420 return false; 1421 } 1422 1423 function bp_group_is_member( $group = false ) { 1318 1424 global $bp, $groups_template; 1319 1425 … … 1321 1427 $group =& $groups_template->group; 1322 1428 1323 echo apply_filters( 'bp_group_admin_form_action', bp_group_permalink( $group, false ) . '/admin/' . $page );1324 }1325 1326 function bp_group_has_requested_membership( $group = false ) {1327 global $bp, $groups_template;1328 1329 if ( !$group )1330 $group =& $groups_template->group;1331 1332 if ( groups_check_for_membership_request( $bp->loggedin_user->id, $group->id ) )1333 return true;1334 1335 return false;1336 }1337 1338 function bp_group_is_member( $group = false ) {1339 global $bp, $groups_template;1340 1341 if ( !$group )1342 $group =& $groups_template->group;1343 1344 1429 if ( groups_is_user_member( $bp->loggedin_user->id, $group->id ) ) 1345 1430 return true; … … 1348 1433 } 1349 1434 1350 function bp_group_accept_invite_link( $group = false ) { 1351 global $groups_template, $bp; 1352 1353 if ( !$group ) 1354 $group =& $groups_template->group; 1355 1356 echo apply_filters( 'bp_group_accept_invite_link', wp_nonce_url( $bp->loggedin_user->domain . $bp->groups->slug . '/invites/accept/' . $group->id, 'groups_accept_invite' ) ); 1357 } 1358 1359 function bp_group_reject_invite_link( $group = false ) { 1360 global $groups_template, $bp; 1361 1362 if ( !$group ) 1363 $group =& $groups_template->group; 1364 1365 echo apply_filters( 'bp_group_reject_invite_link', wp_nonce_url( $bp->loggedin_user->domain . $bp->groups->slug . '/invites/reject/' . $group->id, 'groups_reject_invite' ) ); 1366 } 1367 1368 function bp_has_friends_to_invite( $group = false ) { 1369 global $groups_template, $bp; 1370 1371 if ( !function_exists('friends_install') ) 1372 return false; 1373 1374 if ( !$group ) 1375 $group =& $groups_template->group; 1376 1377 if ( !friends_check_user_has_friends( $bp->loggedin_user->id ) || !friends_count_invitable_friends( $bp->loggedin_user->id, $group->id ) ) 1378 return false; 1379 1380 return true; 1381 } 1382 1383 function bp_group_leave_confirm_link( $group = false ) { 1384 global $groups_template, $bp; 1385 1386 if ( !$group ) 1387 $group =& $groups_template->group; 1388 1389 echo apply_filters( 'bp_group_leave_confirm_link', wp_nonce_url( bp_group_permalink( $group, true ) . '/leave-group/yes', 'groups_leave_group' ) ); 1390 } 1391 1392 function bp_group_leave_reject_link( $group = false ) { 1393 global $groups_template, $bp; 1394 1395 if ( !$group ) 1396 $group =& $groups_template->group; 1397 1398 echo apply_filters( 'bp_group_leave_reject_link', bp_group_permalink( $group, true ) ); 1399 } 1435 function bp_group_accept_invite_link( $deprecated = false ) { 1436 echo bp_get_group_accept_invite_link(); 1437 } 1438 function bp_get_group_accept_invite_link( $group = false ) { 1439 global $groups_template, $bp; 1440 1441 if ( !$group ) 1442 $group =& $groups_template->group; 1443 1444 return apply_filters( 'bp_get_group_accept_invite_link', wp_nonce_url( $bp->loggedin_user->domain . $bp->groups->slug . '/invites/accept/' . $group->id, 'groups_accept_invite' ) ); 1445 } 1446 1447 function bp_group_reject_invite_link( $deprecated = false ) { 1448 echo bp_get_group_reject_invite_link(); 1449 } 1450 function bp_get_group_reject_invite_link( $group = false ) { 1451 global $groups_template, $bp; 1452 1453 if ( !$group ) 1454 $group =& $groups_template->group; 1455 1456 return apply_filters( 'bp_get_group_reject_invite_link', wp_nonce_url( $bp->loggedin_user->domain . $bp->groups->slug . '/invites/reject/' . $group->id, 'groups_reject_invite' ) ); 1457 } 1458 1459 function bp_group_leave_confirm_link( $deprecated = false ) { 1460 echo bp_group_leave_confirm_link(); 1461 } 1462 function bp_get_group_leave_confirm_link( $group = false ) { 1463 global $groups_template, $bp; 1464 1465 if ( !$group ) 1466 $group =& $groups_template->group; 1467 1468 return apply_filters( 'bp_group_leave_confirm_link', wp_nonce_url( bp_get_group_permalink( $group ) . '/leave-group/yes', 'groups_leave_group' ) ); 1469 } 1470 1471 function bp_group_leave_reject_link( $deprecated = false ) { 1472 echo bp_get_group_leave_reject_link(); 1473 } 1474 function bp_get_group_leave_reject_link( $group = false ) { 1475 global $groups_template, $bp; 1476 1477 if ( !$group ) 1478 $group =& $groups_template->group; 1479 1480 return apply_filters( 'bp_get_group_leave_reject_link', bp_get_group_permalink( $group ) ); 1481 } 1482 1483 function bp_group_send_invite_form_action( $deprecated = false ) { 1484 echo bp_get_group_send_invite_form_action(); 1485 } 1486 function bp_get_group_send_invite_form_action( $group = false ) { 1487 global $groups_template, $bp; 1488 1489 if ( !$group ) 1490 $group =& $groups_template->group; 1491 1492 return apply_filters( 'bp_group_send_invite_form_action', bp_get_group_permalink( $group ) . '/send-invites/send' ); 1493 } 1400 1494 1401 1495 function bp_group_send_invite_form( $group = false ) { … … 1443 1537 } 1444 1538 1445 function bp_ group_send_invite_form_action( $group = false ) {1539 function bp_has_friends_to_invite( $group = false ) { 1446 1540 global $groups_template, $bp; 1447 1541 1542 if ( !function_exists('friends_install') ) 1543 return false; 1544 1448 1545 if ( !$group ) 1449 1546 $group =& $groups_template->group; 1450 1547 1451 echo apply_filters( 'bp_group_send_invite_form_action', bp_group_permalink( $group, true ) . '/send-invites/send' ); 1548 if ( !friends_check_user_has_friends( $bp->loggedin_user->id ) || !friends_count_invitable_friends( $bp->loggedin_user->id, $group->id ) ) 1549 return false; 1550 1551 return true; 1452 1552 } 1453 1553 … … 1467 1567 case 'public': 1468 1568 if ( BP_Groups_Member::check_is_member( $bp->loggedin_user->id, $group->id ) ) 1469 echo '<a class="leave-group" href="' . wp_nonce_url( bp_g roup_permalink( $group, false) . '/leave-group', 'groups_leave_group' ) . '">' . __( 'Leave Group', 'buddypress' ) . '</a>';1569 echo '<a class="leave-group" href="' . wp_nonce_url( bp_get_group_permalink( $group ) . '/leave-group', 'groups_leave_group' ) . '">' . __( 'Leave Group', 'buddypress' ) . '</a>'; 1470 1570 else 1471 echo '<a class="join-group" href="' . wp_nonce_url( bp_g roup_permalink( $group, false) . '/join', 'groups_join_group' ) . '">' . __( 'Join Group', 'buddypress' ) . '</a>';1571 echo '<a class="join-group" href="' . wp_nonce_url( bp_get_group_permalink( $group ) . '/join', 'groups_join_group' ) . '">' . __( 'Join Group', 'buddypress' ) . '</a>'; 1472 1572 break; 1473 1573 1474 1574 case 'private': 1475 1575 if ( BP_Groups_Member::check_is_member( $bp->loggedin_user->id, $group->id ) ) { 1476 echo '<a class="leave-group" href="' . wp_nonce_url( bp_g roup_permalink( $group, false) . '/leave-group', 'groups_leave_group' ) . '">' . __( 'Leave Group', 'buddypress' ) . '</a>';1576 echo '<a class="leave-group" href="' . wp_nonce_url( bp_get_group_permalink( $group ) . '/leave-group', 'groups_leave_group' ) . '">' . __( 'Leave Group', 'buddypress' ) . '</a>'; 1477 1577 } else { 1478 1578 if ( !bp_group_has_requested_membership( $group ) ) 1479 echo '<a class="request-membership" href="' . wp_nonce_url( bp_g roup_permalink( $group, false) . '/request-membership', 'groups_request_membership' ) . '">' . __('Request Membership', 'buddypress') . '</a>';1579 echo '<a class="request-membership" href="' . wp_nonce_url( bp_get_group_permalink( $group ) . '/request-membership', 'groups_request_membership' ) . '">' . __('Request Membership', 'buddypress') . '</a>'; 1480 1580 else 1481 echo '<a class="membership-requested" href="' . bp_g roup_permalink( $group, false) . '">' . __( 'Request Sent', 'buddypress' ) . '</a>';1581 echo '<a class="membership-requested" href="' . bp_get_group_permalink( $group ) . '">' . __( 'Request Sent', 'buddypress' ) . '</a>'; 1482 1582 } 1483 1583 break; … … 1639 1739 1640 1740 function bp_group_member_avatar() { 1641 global $members_template; 1642 1643 echo apply_filters( 'bp_group_member_avatar', bp_core_get_avatar( $members_template->member->user_id, 1 ) ); 1644 } 1741 echo bp_get_group_member_avatar(); 1742 } 1743 function bp_get_group_member_avatar() { 1744 global $members_template; 1745 1746 return apply_filters( 'bp_get_group_member_avatar', bp_core_get_avatar( $members_template->member->user_id, 1 ) ); 1747 } 1645 1748 1646 1749 function bp_group_member_avatar_mini( $width = 30, $height = 30 ) { 1647 global $members_template; 1648 1649 echo apply_filters( 'bp_group_member_avatar_mini', bp_core_get_avatar( $members_template->member->user_id, 1, $width, $height ) ); 1650 } 1750 echo bp_get_group_member_avatar_mini( $width, $height ); 1751 } 1752 function bp_get_group_member_avatar_mini( $width = 30, $height = 30 ) { 1753 global $members_template; 1754 1755 return apply_filters( 'bp_get_group_member_avatar_mini', bp_core_get_avatar( $members_template->member->user_id, 1, $width, $height ) ); 1756 } 1651 1757 1652 1758 function bp_group_member_name() { 1653 global $members_template; 1654 1655 echo apply_filters( 'bp_group_member_name', bp_fetch_user_fullname( $members_template->member->user_id, false ) ); 1656 } 1759 echo bp_get_group_member_name(); 1760 } 1761 function bp_get_group_member_name() { 1762 global $members_template; 1763 1764 return apply_filters( 'bp_get_group_member_name', bp_fetch_user_fullname( $members_template->member->user_id, false ) ); 1765 } 1657 1766 1658 1767 function bp_group_member_url() { 1659 global $members_template; 1660 1661 echo apply_filters( 'bp_group_member_url', bp_core_get_userlink( $members_template->member->user_id, false, true ) ); 1662 } 1768 echo bp_get_group_member_url(); 1769 } 1770 function bp_get_group_member_url() { 1771 global $members_template; 1772 1773 return apply_filters( 'bp_get_group_member_url', bp_core_get_userlink( $members_template->member->user_id, false, true ) ); 1774 } 1663 1775 1664 1776 function bp_group_member_link() { 1665 global $members_template; 1666 1667 echo apply_filters( 'bp_group_member_link', bp_core_get_userlink( $members_template->member->user_id ) ); 1668 } 1669 1777 echo bp_get_group_member_link(); 1778 } 1779 function bp_get_group_member_link() { 1780 global $members_template; 1781 1782 return apply_filters( 'bp_get_group_member_link', bp_core_get_userlink( $members_template->member->user_id ) ); 1783 } 1784 1670 1785 function bp_group_member_is_banned() { 1671 global $members_template, $groups_template; 1672 1673 return apply_filters( 'bp_group_member_is_banned', groups_is_user_banned( $members_template->member->user_id, $groups_template->group->id ) ); 1674 } 1786 echo bp_get_group_member_is_banned(); 1787 } 1788 function bp_get_group_member_is_banned() { 1789 global $members_template, $groups_template; 1790 1791 return apply_filters( 'bp_get_group_member_is_banned', groups_is_user_banned( $members_template->member->user_id, $groups_template->group->id ) ); 1792 } 1675 1793 1676 1794 function bp_group_member_joined_since() { 1677 global $members_template; 1678 1679 echo apply_filters( 'bp_group_member_joined_since', bp_core_get_last_activity( strtotime( $members_template->member->date_modified ), __( 'joined %s ago', 'buddypress') ) ); 1680 } 1795 echo bp_get_group_member_joined_since(); 1796 } 1797 function bp_get_group_member_joined_since() { 1798 global $members_template; 1799 1800 return apply_filters( 'bp_get_group_member_joined_since', bp_core_get_last_activity( strtotime( $members_template->member->date_modified ), __( 'joined %s ago', 'buddypress') ) ); 1801 } 1802 1681 1803 1682 1804 function bp_group_member_id() { 1683 global $members_template; 1684 return apply_filters( 'bp_group_member_id', $members_template->member->user_id ); 1685 } 1805 echo bp_get_group_member_id(); 1806 } 1807 function bp_get_group_member_id() { 1808 global $members_template; 1809 1810 return apply_filters( 'bp_get_group_member_id', $members_template->member->user_id ); 1811 } 1686 1812 1687 1813 function bp_group_member_needs_pagination() { … … 1695 1821 1696 1822 function bp_group_pag_id() { 1697 global $bp; 1698 1699 echo apply_filters( 'bp_group_pag_id', 'pag' ); 1700 } 1823 echo bp_get_group_pag_id(); 1824 } 1825 function bp_get_group_pag_id() { 1826 global $bp; 1827 1828 return apply_filters( 'bp_get_group_pag_id', 'pag' ); 1829 } 1701 1830 1702 1831 1703 1832 function bp_group_member_pagination() { 1704 global $members_template; 1705 echo $members_template->pag_links; 1833 echo bp_get_group_member_pagination(); 1706 1834 wp_nonce_field( 'bp_groups_member_list', '_member_pag_nonce' ); 1707 1835 } 1836 function bp_get_group_member_pagination() { 1837 global $members_template; 1838 return apply_filters( 'bp_get_group_member_pagination', $members_template->pag_links ); 1839 } 1708 1840 1709 1841 function bp_group_member_pagination_count() { 1710 global $members_template; 1711 1712 $from_num = intval( ( $members_template->pag_page - 1 ) * $members_template->pag_num ) + 1; 1713 $to_num = ( $from_num + ( $members_template->pag_num - 1 ) > $members_template->total_member_count ) ? $members_template->total_member_count : $from_num + ( $members_template->pag_num - 1 ); 1714 1715 echo apply_filters( 'bp_group_member_pagination_count', sprintf( __( 'Viewing members %d to %d (of %d members)', 'buddypress' ), $from_num, $to_num, $members_template->total_member_count ) ); 1716 } 1842 echo bp_get_group_member_pagination_count(); 1843 } 1844 function bp_get_group_member_pagination_count() { 1845 global $members_template; 1846 1847 $from_num = intval( ( $members_template->pag_page - 1 ) * $members_template->pag_num ) + 1; 1848 $to_num = ( $from_num + ( $members_template->pag_num - 1 ) > $members_template->total_member_count ) ? $members_template->total_member_count : $from_num + ( $members_template->pag_num - 1 ); 1849 1850 return apply_filters( 'bp_get_group_member_pagination_count', sprintf( __( 'Viewing members %d to %d (of %d members)', 'buddypress' ), $from_num, $to_num, $members_template->total_member_count ) ); 1851 } 1717 1852 1718 1853 function bp_group_member_admin_pagination() { 1719 global $members_template; 1720 echo $members_template->pag_links; 1854 echo bp_get_group_member_admin_pagination(); 1721 1855 wp_nonce_field( 'bp_groups_member_admin_list', '_member_admin_pag_nonce' ); 1722 1856 } 1857 function bp_get_group_member_admin_pagination() { 1858 global $members_template; 1859 1860 return $members_template->pag_links; 1861 } 1723 1862 1724 1863 /******************************************************************************** … … 1901 2040 1902 2041 function bp_site_groups_pagination_links() { 1903 global $site_groups_template; 1904 echo $site_groups_template->pag_links; 1905 } 2042 echo bp_get_site_groups_pagination_links(); 2043 } 2044 function bp_get_site_groups_pagination_links() { 2045 global $site_groups_template; 2046 2047 return apply_filters( 'bp_get_site_groups_pagination_links', $site_groups_template->pag_links ); 2048 } 1906 2049 1907 2050 function bp_the_site_group_id() { 1908 global $site_groups_template; 1909 echo $site_groups_template->group->id; 1910 } 2051 echo bp_get_the_site_group_id(); 2052 } 2053 function bp_get_the_site_group_id() { 2054 global $site_groups_template; 2055 2056 return apply_filters( 'bp_get_the_site_group_id', $site_groups_template->group->id ); 2057 } 1911 2058 1912 2059 function bp_the_site_group_avatar() { 1913 global $site_groups_template; 1914 echo bp_group_avatar( $site_groups_template->group ); 1915 } 2060 echo bp_get_the_site_group_avatar(); 2061 } 2062 function bp_get_the_site_group_avatar() { 2063 global $site_groups_template; 2064 2065 return apply_filters( 'bp_the_site_group_avatar', bp_group_avatar( $site_groups_template->group ) ); 2066 } 1916 2067 1917 2068 function bp_the_site_group_avatar_thumb() { 1918 global $site_groups_template; 1919 echo bp_group_avatar_thumb( $site_groups_template->group ); 1920 } 2069 echo bp_get_the_site_group_avatar_thumb(); 2070 } 2071 function bp_get_the_site_group_avatar_thumb() { 2072 global $site_groups_template; 2073 2074 return apply_filters( 'bp_get_the_site_group_avatar_thumb', bp_group_avatar_thumb( $site_groups_template->group ) ); 2075 } 1921 2076 1922 2077 function bp_the_site_group_avatar_mini() { 1923 global $site_groups_template; 1924 echo bp_group_avatar_mini( $site_groups_template->group ); 1925 } 2078 echo bp_get_the_site_group_avatar_mini(); 2079 } 2080 function bp_get_the_site_group_avatar_mini() { 2081 global $site_groups_template; 2082 2083 return apply_filters( 'bp_get_the_site_group_avatar_mini', bp_group_avatar_mini( $site_groups_template->group ) ); 2084 } 1926 2085 1927 2086 function bp_the_site_group_link() { 1928 global $site_groups_template; 1929 echo bp_group_permalink( $site_groups_template->group ); 1930 } 2087 echo bp_get_the_site_group_link(); 2088 } 2089 function bp_get_the_site_group_link() { 2090 global $site_groups_template; 2091 2092 return apply_filters( 'bp_get_the_site_group_link', bp_get_group_permalink( $site_groups_template->group ) ); 2093 } 1931 2094 1932 2095 function bp_the_site_group_name() { 1933 global $site_groups_template; 1934 echo bp_group_name( true, $site_groups_template->group ); 1935 } 2096 echo bp_get_the_site_group_name(); 2097 } 2098 function bp_get_the_site_group_name() { 2099 global $site_groups_template; 2100 2101 return apply_filters( 'bp_get_the_site_group_name', bp_get_group_name( $site_groups_template->group ) ); 2102 } 1936 2103 1937 2104 function bp_the_site_group_last_active() { 1938 global $site_groups_template; 1939 1940 printf( __( 'active %s ago', 'buddypress' ), bp_group_last_active( false, $site_groups_template->group ) ); 1941 } 2105 echo bp_get_the_site_group_last_active(); 2106 } 2107 function bp_get_the_site_group_last_active() { 2108 global $site_groups_template; 2109 2110 return apply_filters( 'bp_get_the_site_group_last_active', sprintf( __( 'active %s ago', 'buddypress' ), bp_get_group_last_active( $site_groups_template->group ) ) ); 2111 } 1942 2112 1943 2113 function bp_the_site_group_join_button() { … … 1948 2118 1949 2119 function bp_the_site_group_description() { 1950 global $site_groups_template; 1951 1952 echo bp_group_description( $site_groups_template->group ); 1953 } 2120 echo bp_get_the_site_group_description(); 2121 } 2122 function bp_get_the_site_group_description() { 2123 global $site_groups_template; 2124 2125 return apply_filters( 'bp_get_the_site_group_description', bp_get_group_description( $site_groups_template->group ) ); 2126 } 1954 2127 1955 2128 function bp_the_site_group_description_excerpt() { 1956 global $site_groups_template; 1957 1958 echo bp_create_excerpt( bp_group_description( $site_groups_template->group, false ), 35 ); 1959 } 2129 echo bp_get_the_site_group_description_excerpt(); 2130 } 2131 function bp_get_the_site_group_description_excerpt() { 2132 global $site_groups_template; 2133 2134 return apply_filters( 'bp_get_the_site_group_description_excerpt', bp_create_excerpt( bp_get_group_description( $site_groups_template->group, false ), 35 ) ); 2135 } 1960 2136 1961 2137 function bp_the_site_group_date_created() { 1962 global $site_groups_template; 1963 1964 echo date( get_option( 'date_format' ), $site_groups_template->group->date_created ); 1965 } 2138 echo bp_get_the_site_group_date_created(); 2139 } 2140 function bp_get_the_site_group_date_created() { 2141 global $site_groups_template; 2142 2143 return apply_filters( 'bp_get_the_site_group_date_created', date( get_option( 'date_format' ), $site_groups_template->group->date_created ) ); 2144 } 1966 2145 1967 2146 function bp_the_site_group_member_count() { 1968 global $site_groups_template; 1969 1970 if ( 1 == (int) $site_groups_template->group->total_member_count ) 1971 printf( '%d member', (int) $site_groups_template->group->total_member_count ); 1972 else 1973 printf( '%d members', (int) $site_groups_template->group->total_member_count ); 1974 } 2147 echo bp_get_the_site_group_member_count(); 2148 } 2149 function bp_get_the_site_group_member_count() { 2150 global $site_groups_template; 2151 2152 if ( 1 == (int) $site_groups_template->group->total_member_count ) 2153 return apply_filters( 'bp_get_the_site_group_member_count', sprintf( '%d member', (int) $site_groups_template->group->total_member_count ) ); 2154 else 2155 return apply_filters( 'bp_get_the_site_group_member_count', sprintf( '%d members', (int) $site_groups_template->group->total_member_count ) ); 2156 } 1975 2157 1976 2158 function bp_the_site_group_type() { 1977 global $site_groups_template; 1978 1979 echo bp_group_type( $site_groups_template->group ); 1980 } 1981 2159 echo bp_get_the_site_group_type(); 2160 } 2161 function bp_get_the_site_group_type() { 2162 global $site_groups_template; 2163 2164 return apply_filters( 'bp_get_the_site_group_type', bp_get_group_type( $site_groups_template->group ) ); 2165 } 1982 2166 1983 2167 function bp_the_site_group_hidden_fields() { … … 2138 2322 global $requests_template, $groups_template; 2139 2323 2140 echo apply_filters( 'bp_group_request_reject_link', wp_nonce_url( bp_g roup_permalink( $groups_template->group, false) . '/admin/membership-requests/reject/' . $requests_template->request->id, 'groups_reject_membership_request' ) );2324 echo apply_filters( 'bp_group_request_reject_link', wp_nonce_url( bp_get_group_permalink( $groups_template->group ) . '/admin/membership-requests/reject/' . $requests_template->request->id, 'groups_reject_membership_request' ) ); 2141 2325 } 2142 2326 … … 2144 2328 global $requests_template, $groups_template; 2145 2329 2146 echo apply_filters( 'bp_group_request_accept_link', wp_nonce_url( bp_g roup_permalink( $groups_template->group, false) . '/admin/membership-requests/accept/' . $requests_template->request->id, 'groups_accept_membership_request' ) );2330 echo apply_filters( 'bp_group_request_accept_link', wp_nonce_url( bp_get_group_permalink( $groups_template->group ) . '/admin/membership-requests/accept/' . $requests_template->request->id, 'groups_accept_membership_request' ) ); 2147 2331 } 2148 2332 -
trunk/bp-groups/bp-groups-widgets.php
r1366 r1408 55 55 <li> 56 56 <div class="item-avatar"> 57 <a href="<?php echo bp_g roup_permalink( $group ) ?>" title="<?php echo $group->name ?>"><img src="<?php echo $group->avatar_thumb; ?>" alt="<?php echo $group->name ?> Avatar" class="avatar" /></a>57 <a href="<?php echo bp_get_group_permalink( $group ) ?>" title="<?php echo $group->name ?>"><img src="<?php echo $group->avatar_thumb; ?>" alt="<?php echo $group->name ?> Avatar" class="avatar" /></a> 58 58 </div> 59 59 60 60 <div class="item"> 61 <div class="item-title"><a href="<?php echo bp_g roup_permalink( $group ) ?>" title="<?php echo $group->name ?>"><?php echo $group->name ?></a></div>61 <div class="item-title"><a href="<?php echo bp_get_group_permalink( $group ) ?>" title="<?php echo $group->name ?>"><?php echo $group->name ?></a></div> 62 62 <div class="item-meta"> 63 63 <span class="activity"> -
trunk/bp-messages/bp-messages-filters.php
r1366 r1408 2 2 3 3 /* Apply WordPress defined filters */ 4 add_filter( 'bp_message_notice_subject', 'wptexturize' ); 5 add_filter( 'bp_message_notice_text', 'wptexturize' ); 6 add_filter( 'bp_message_thread_subject', 'wptexturize' ); 7 add_filter( 'bp_message_thread_excerpt', 'wptexturize' ); 8 add_filter( 'bp_message_content', 'wptexturize' ); 9 10 add_filter( 'bp_message_notice_subject', 'convert_smilies' ); 11 add_filter( 'bp_message_notice_text', 'convert_smilies' ); 12 add_filter( 'bp_message_thread_subject', 'convert_smilies' ); 13 add_filter( 'bp_message_thread_excerpt', 'convert_smilies' ); 14 add_filter( 'bp_message_content', 'convert_smilies' ); 15 16 add_filter( 'bp_message_notice_subject', 'convert_chars' ); 17 add_filter( 'bp_message_notice_text', 'convert_chars' ); 18 add_filter( 'bp_message_thread_subject', 'convert_chars' ); 19 add_filter( 'bp_message_thread_excerpt', 'convert_chars' ); 20 add_filter( 'bp_message_content', 'convert_chars' ); 21 22 add_filter( 'bp_message_notice_subject', 'wpautop' ); 23 add_filter( 'bp_message_notice_text', 'wpautop' ); 24 add_filter( 'bp_message_thread_subject', 'wpautop' ); 25 add_filter( 'bp_message_thread_excerpt', 'wpautop' ); 26 add_filter( 'bp_message_content', 'wpautop' ); 27 28 add_filter( 'bp_message_notice_subject', 'stripslashes_deep' ); 29 add_filter( 'bp_message_notice_text', 'stripslashes_deep' ); 30 add_filter( 'bp_message_thread_subject', 'stripslashes_deep' ); 31 add_filter( 'bp_message_thread_excerpt', 'stripslashes_deep' ); 32 add_filter( 'bp_messages_subject_value', 'stripslashes_deep' ); 33 add_filter( 'bp_messages_content_value', 'stripslashes_deep' ); 34 add_filter( 'bp_message_content', 'stripslashes_deep' ); 35 36 add_filter( 'bp_message_notice_subject', 'wp_filter_kses', 1 ); 37 add_filter( 'bp_message_notice_text', 'wp_filter_kses', 1 ); 38 add_filter( 'bp_message_thread_subject', 'wp_filter_kses', 1 ); 39 add_filter( 'bp_message_thread_excerpt', 'wp_filter_kses', 1 ); 40 add_filter( 'bp_messages_subject_value', 'wp_filter_kses', 1 ); 41 add_filter( 'bp_messages_content_value', 'wp_filter_kses', 1 ); 42 add_filter( 'bp_message_content', 'wp_filter_kses', 1 ); 4 add_filter( 'bp_get_message_notice_subject', 'wp_filter_kses', 1 ); 5 add_filter( 'bp_get_message_notice_text', 'wp_filter_kses', 1 ); 6 add_filter( 'bp_get_message_thread_subject', 'wp_filter_kses', 1 ); 7 add_filter( 'bp_get_message_thread_excerpt', 'wp_filter_kses', 1 ); 8 add_filter( 'bp_get_messages_subject_value', 'wp_filter_kses', 1 ); 9 add_filter( 'bp_get_messages_content_value', 'wp_filter_kses', 1 ); 10 add_filter( 'bp_get_message_content', 'wp_filter_kses', 1 ); 43 11 add_filter( 'messages_message_content_before_save', 'wp_filter_kses', 1 ); 44 12 add_filter( 'messages_message_subject_before_save', 'wp_filter_kses', 1 ); 45 13 14 add_filter( 'bp_get_message_notice_subject', 'wptexturize' ); 15 add_filter( 'bp_get_message_notice_text', 'wptexturize' ); 16 add_filter( 'bp_get_message_thread_subject', 'wptexturize' ); 17 add_filter( 'bp_get_message_thread_excerpt', 'wptexturize' ); 18 add_filter( 'bp_get_message_content', 'wptexturize' ); 19 20 add_filter( 'bp_get_message_notice_subject', 'convert_smilies', 2 ); 21 add_filter( 'bp_get_message_notice_text', 'convert_smilies', 2 ); 22 add_filter( 'bp_get_message_thread_subject', 'convert_smilies', 2 ); 23 add_filter( 'bp_get_message_thread_excerpt', 'convert_smilies', 2 ); 24 add_filter( 'bp_get_message_content', 'convert_smilies', 2 ); 25 26 add_filter( 'bp_get_message_notice_subject', 'convert_chars' ); 27 add_filter( 'bp_get_message_notice_text', 'convert_chars' ); 28 add_filter( 'bp_get_message_thread_subject', 'convert_chars' ); 29 add_filter( 'bp_get_message_thread_excerpt', 'convert_chars' ); 30 add_filter( 'bp_get_message_content', 'convert_chars' ); 31 32 add_filter( 'bp_get_message_notice_subject', 'wpautop' ); 33 add_filter( 'bp_get_message_notice_text', 'wpautop' ); 34 add_filter( 'bp_get_message_thread_subject', 'wpautop' ); 35 add_filter( 'bp_get_message_thread_excerpt', 'wpautop' ); 36 add_filter( 'bp_get_message_content', 'wpautop' ); 37 38 add_filter( 'bp_get_message_notice_subject', 'stripslashes_deep' ); 39 add_filter( 'bp_get_message_notice_text', 'stripslashes_deep' ); 40 add_filter( 'bp_get_message_thread_subject', 'stripslashes_deep' ); 41 add_filter( 'bp_get_message_thread_excerpt', 'stripslashes_deep' ); 42 add_filter( 'bp_get_messages_subject_value', 'stripslashes_deep' ); 43 add_filter( 'bp_get_messages_content_value', 'stripslashes_deep' ); 44 add_filter( 'bp_get_message_content', 'stripslashes_deep' ); 45 46 46 ?> -
trunk/bp-messages/bp-messages-templatetags.php
r1401 r1408 148 148 149 149 function bp_message_thread_id() { 150 global $messages_template; 151 echo apply_filters( 'bp_message_thread_id', $messages_template->thread->thread_id ); 152 } 150 echo bp_get_message_thread_id(); 151 } 152 function bp_get_message_thread_id() { 153 global $messages_template; 154 return apply_filters( 'bp_get_message_thread_id', $messages_template->thread->thread_id ); 155 } 153 156 154 157 function bp_message_thread_subject() { 155 global $messages_template; 156 echo apply_filters( 'bp_message_thread_subject', stripslashes_deep( $messages_template->thread->last_message_subject ) ); 157 } 158 echo bp_get_message_thread_subject(); 159 } 160 function bp_get_message_thread_subject() { 161 global $messages_template; 162 return apply_filters( 'bp_message_thread_subject', stripslashes_deep( $messages_template->thread->last_message_subject ) ); 163 } 158 164 159 165 function bp_message_thread_excerpt() { 160 global $messages_template; 161 echo apply_filters( 'bp_message_thread_excerpt', bp_create_excerpt($messages_template->thread->last_message_message, 20) ); 162 } 166 echo bp_get_message_thread_excerpt(); 167 } 168 function bp_get_message_thread_excerpt() { 169 global $messages_template; 170 return apply_filters( 'bp_get_message_thread_excerpt', bp_create_excerpt($messages_template->thread->last_message_message, 20) ); 171 } 163 172 164 173 function bp_message_thread_from() { 165 global $messages_template; 166 echo apply_filters( 'bp_message_thread_from', bp_core_get_userlink($messages_template->thread->last_sender_id) ); 167 } 174 echo bp_get_message_thread_from(); 175 } 176 function bp_get_message_thread_from() { 177 global $messages_template; 178 return apply_filters( 'bp_get_message_thread_from', bp_core_get_userlink($messages_template->thread->last_sender_id) ); 179 } 168 180 169 181 function bp_message_thread_to() { 170 global $messages_template; 171 echo apply_filters( 'bp_message_thread_to', BP_Messages_Thread::get_recipient_links($messages_template->thread->recipients) ); 172 } 182 echo bp_get_message_thread_to(); 183 } 184 function bp_get_message_thread_to() { 185 global $messages_template; 186 return apply_filters( 'bp_message_thread_to', BP_Messages_Thread::get_recipient_links($messages_template->thread->recipients) ); 187 } 173 188 174 189 function bp_message_thread_view_link() { 175 global $messages_template, $bp; 176 echo apply_filters( 'bp_message_thread_view_link', $bp->loggedin_user->domain . $bp->messages->slug . '/view/' . $messages_template->thread->thread_id ); 177 } 178 190 echo bp_get_message_thread_view_link(); 191 } 192 function bp_get_message_thread_view_link() { 193 global $messages_template, $bp; 194 return apply_filters( 'bp_get_message_thread_view_link', $bp->loggedin_user->domain . $bp->messages->slug . '/view/' . $messages_template->thread->thread_id ); 195 } 196 179 197 function bp_message_thread_delete_link() { 180 global $messages_template, $bp; 181 echo apply_filters( 'bp_message_thread_delete_link', wp_nonce_url( $bp->loggedin_user->domain . $bp->messages->slug . '/' . $bp->current_action . '/delete/' . $messages_template->thread->thread_id, 'messages_delete_thread' ) ); 182 } 183 198 echo bp_get_message_thread_delete_link(); 199 } 200 function bp_get_message_thread_delete_link() { 201 global $messages_template, $bp; 202 return apply_filters( 'bp_get_message_thread_delete_link', wp_nonce_url( $bp->loggedin_user->domain . $bp->messages->slug . '/' . $bp->current_action . '/delete/' . $messages_template->thread->thread_id, 'messages_delete_thread' ) ); 203 } 204 184 205 function bp_message_thread_has_unread() { 185 206 global $messages_template; 186 207 187 208 if ( $messages_template->thread->unread_count ) 188 209 return true; … … 192 213 193 214 function bp_message_thread_unread_count() { 194 global $messages_template; 195 echo apply_filters( 'bp_message_thread_unread_count', $messages_template->thread->unread_count ); 196 } 215 echo bp_get_message_thread_unread_count(); 216 } 217 function bp_get_message_thread_unread_count() { 218 global $messages_template; 219 220 if ( (int)$messages_template->thread->unread_count ) 221 return apply_filters( 'bp_get_message_thread_unread_count', $messages_template->thread->unread_count ); 222 223 return false; 224 } 197 225 198 226 function bp_message_thread_last_post_date() { 199 global $messages_template; 200 echo apply_filters( 'bp_message_thread_last_post_date', bp_format_time( strtotime($messages_template->thread->last_post_date) ) ); 201 } 227 echo bp_get_message_thread_last_post_date(); 228 } 229 function bp_get_message_thread_last_post_date() { 230 global $messages_template; 231 echo apply_filters( 'bp_get_message_thread_last_post_date', bp_format_time( strtotime($messages_template->thread->last_post_date) ) ); 232 } 202 233 203 234 function bp_message_thread_avatar() { 204 global $messages_template; 205 echo apply_filters( 'bp_message_thread_avatar', bp_core_get_avatar($messages_template->thread->last_sender_id, 1) ); 206 } 235 echo bp_get_message_thread_avatar(); 236 } 237 function bp_get_message_thread_avatar() { 238 global $messages_template; 239 echo apply_filters( 'bp_get_message_thread_avatar', bp_core_get_avatar($messages_template->thread->last_sender_id, 1) ); 240 } 207 241 208 242 function bp_message_thread_view() { … … 213 247 214 248 function bp_total_unread_messages_count() { 215 echo BP_Messages_Thread::get_inbox_count(); 216 } 249 echo bp_get_total_unread_messages_count(); 250 } 251 function bp_get_total_unread_messages_count() { 252 return apply_filters( 'bp_get_total_unread_messages_count', BP_Messages_Thread::get_inbox_count() ); 253 } 217 254 218 255 function bp_messages_pagination() { 219 global $messages_template; 220 echo apply_filters( 'bp_messages_pagination', $messages_template->pag_links ); 221 } 256 echo bp_get_messages_pagination(); 257 } 258 function bp_get_messages_pagination() { 259 global $messages_template; 260 return apply_filters( 'bp_get_messages_pagination', $messages_template->pag_links ); 261 } 222 262 223 263 function bp_messages_form_action() { 224 global $bp; 225 226 echo apply_filters( 'bp_messages_form_action', $bp->loggedin_user->domain . $bp->messages->slug . '/' . $bp->current_action ); 227 } 264 echo bp_get_messages_form_action(); 265 } 266 267 function bp_get_messages_form_action() { 268 global $bp; 269 270 return apply_filters( 'bp_get_messages_form_action', $bp->loggedin_user->domain . $bp->messages->slug . '/' . $bp->current_action ); 271 } 228 272 229 273 function bp_messages_username_value() { 230 if ( isset( $_SESSION['send_to'] ) ) { 231 echo apply_filters( 'bp_messages_username_value', $_SESSION['send_to'] ); 232 } else if ( isset( $_GET['r'] ) && !isset( $_SESSION['send_to'] ) ) { 233 echo apply_filters( 'bp_messages_username_value', $_GET['r'] ); 234 } 235 } 274 echo bp_get_messages_username_value(); 275 } 276 function bp_get_messages_username_value() { 277 if ( isset( $_SESSION['send_to'] ) ) { 278 return apply_filters( 'bp_get_messages_username_value', $_SESSION['send_to'] ); 279 } else if ( isset( $_GET['r'] ) && !isset( $_SESSION['send_to'] ) ) { 280 return apply_filters( 'bp_get_messages_username_value', $_GET['r'] ); 281 } 282 } 236 283 237 284 function bp_messages_subject_value() { 238 echo apply_filters( 'bp_messages_subject_value', $_SESSION['subject'] ); 239 } 285 echo bp_get_messages_subject_value(); 286 } 287 function bp_get_messages_subject_value() { 288 return apply_filters( 'bp_get_messages_subject_value', $_SESSION['subject'] ); 289 } 240 290 241 291 function bp_messages_content_value() { 242 echo apply_filters( 'bp_messages_content_value', $_SESSION['content'] ); 243 } 292 echo bp_get_messages_content_value(); 293 } 294 function bp_get_messages_content_value() { 295 return apply_filters( 'bp_get_messages_content_value', $_SESSION['content'] ); 296 } 244 297 245 298 function bp_messages_options() { … … 267 320 if ( $messages_template->thread->is_active ) { 268 321 echo "<strong>"; 269 _e( 'Currently Active', 'buddypress');322 _e( 'Currently Active', 'buddypress' ); 270 323 echo "</strong>"; 271 324 } 272 325 } 326 function bp_get_message_is_active_notice() { 327 global $messages_template; 328 329 if ( $messages_template->thread->is_active ) 330 return true; 331 332 return false; 333 } 273 334 274 335 function bp_message_notice_post_date() { 275 global $messages_template; 276 echo apply_filters( 'bp_message_notice_post_date', bp_format_time( strtotime($messages_template->thread->date_sent) ) ); 277 } 336 echo bp_get_message_notice_post_date(); 337 } 338 function bp_get_message_notice_post_date() { 339 global $messages_template; 340 return apply_filters( 'bp_get_message_notice_post_date', bp_format_time( strtotime($messages_template->thread->date_sent) ) ); 341 } 278 342 279 343 function bp_message_notice_subject() { 280 global $messages_template; 281 echo apply_filters( 'bp_message_notice_subject', $messages_template->thread->subject ); 282 } 344 echo bp_get_message_notice_subject(); 345 } 346 function bp_get_message_notice_subject() { 347 global $messages_template; 348 return apply_filters( 'bp_get_message_notice_subject', $messages_template->thread->subject ); 349 } 283 350 284 351 function bp_message_notice_text() { 285 global $messages_template; 286 echo apply_filters( 'bp_message_notice_text', $messages_template->thread->message ); 287 } 352 echo bp_get_message_notice_text(); 353 } 354 function bp_get_message_notice_text() { 355 global $messages_template; 356 return apply_filters( 'bp_get_message_notice_text', $messages_template->thread->message ); 357 } 288 358 289 359 function bp_message_notice_delete_link() { 290 global $messages_template, $bp; 291 292 echo apply_filters( 'bp_message_notice_delete_link', wp_nonce_url( $bp->loggedin_user->domain . $bp->messages->slug . '/notices/delete/' . $messages_template->thread->id, 'messages_delete_thread' ) ); 293 } 360 echo bp_get_message_notice_delete_link(); 361 } 362 function bp_get_message_notice_delete_link() { 363 global $messages_template, $bp; 364 365 return apply_filters( 'bp_get_message_notice_delete_link', wp_nonce_url( $bp->loggedin_user->domain . $bp->messages->slug . '/notices/delete/' . $messages_template->thread->id, 'messages_delete_thread' ) ); 366 } 294 367 295 368 function bp_message_activate_deactivate_link() { 296 global $messages_template, $bp; 297 298 if ( 1 == (int)$messages_template->thread->is_active ) { 299 $link = wp_nonce_url( $bp->loggedin_user->domain . $bp->messages->slug . '/notices/deactivate/' . $messages_template->thread->id, 'messages_deactivate_notice' ); 300 } else { 301 $link = wp_nonce_url( $bp->loggedin_user->domain . $bp->messages->slug . '/notices/activate/' . $messages_template->thread->id, 'messages_activate_notice' ); 302 } 303 echo apply_filters( 'bp_message_activate_deactivate_link', $link ); 304 } 369 echo bp_get_message_activate_deactivate_link(); 370 } 371 function bp_get_message_activate_deactivate_link() { 372 global $messages_template, $bp; 373 374 if ( 1 == (int)$messages_template->thread->is_active ) { 375 $link = wp_nonce_url( $bp->loggedin_user->domain . $bp->messages->slug . '/notices/deactivate/' . $messages_template->thread->id, 'messages_deactivate_notice' ); 376 } else { 377 $link = wp_nonce_url( $bp->loggedin_user->domain . $bp->messages->slug . '/notices/activate/' . $messages_template->thread->id, 'messages_activate_notice' ); 378 } 379 return apply_filters( 'bp_get_message_activate_deactivate_link', $link ); 380 } 305 381 306 382 function bp_message_activate_deactivate_text() { 307 global $messages_template; 308 309 if ( 1 == (int)$messages_template->thread->is_active ) { 310 $text = __('Deactivate', 'buddypress'); 311 } else { 312 $text = __('Activate', 'buddypress'); 313 } 314 echo apply_filters( 'bp_message_activate_deactivate_text', $text ); 315 } 383 echo bp_get_message_activate_deactivate_text(); 384 } 385 function bp_get_message_activate_deactivate_text() { 386 global $messages_template; 387 388 if ( 1 == (int)$messages_template->thread->is_active ) { 389 $text = __('Deactivate', 'buddypress'); 390 } else { 391 $text = __('Activate', 'buddypress'); 392 } 393 return apply_filters( 'bp_message_activate_deactivate_text', $text ); 394 } 316 395 317 396 function bp_message_get_notices() { … … 352 431 353 432 function bp_message_loading_image_src() { 354 global $bp; 355 echo $bp->messages->image_base . '/ajax-loader.gif'; 356 } 433 echo bp_get_message_loading_image_src(); 434 } 435 function bp_get_message_loading_image_src() { 436 global $bp; 437 return apply_filters( 'bp_get_message_loading_image_src', $bp->messages->image_base . '/ajax-loader.gif' ); 438 } 357 439 358 440 function bp_message_get_recipient_tabs() { … … 377 459 378 460 function bp_message_get_recipient_usernames() { 379 echo $_GET['r']; 380 } 381 461 echo bp_get_message_get_recipient_usernames(); 462 } 463 function bp_get_message_get_recipient_usernames() { 464 return apply_filters( 'bp_get_message_get_recipient_usernames', $_GET['r'] ); 465 } 466 382 467 function messages_view_thread( $thread_id ) { 383 468 global $bp; … … 418 503 <div class="message-box<?php echo $alt ?>"> 419 504 <div class="avatar-box"> 420 <?php echo apply_filters( 'bp_ message_sender_avatar', bp_core_get_avatar( $message->sender_id, 1 ) ) ?>421 <h3><?php echo apply_filters( 'bp_ message_sender_id', bp_core_get_userlink( $message->sender_id ) ) ?></h3>422 <small><?php echo apply_filters( 'bp_ message_date_sent', bp_format_time( strtotime($message->date_sent ) ) ) ?></small>505 <?php echo apply_filters( 'bp_get_message_sender_avatar', bp_core_get_avatar( $message->sender_id, 1 ) ) ?> 506 <h3><?php echo apply_filters( 'bp_get_message_sender_id', bp_core_get_userlink( $message->sender_id ) ) ?></h3> 507 <small><?php echo apply_filters( 'bp_get_message_date_sent', bp_format_time( strtotime($message->date_sent ) ) ) ?></small> 423 508 </div> 424 509 425 510 <?php do_action( 'messages_custom_fields_output_before' ) ?> 426 511 427 <?php echo apply_filters( 'bp_ message_content', stripslashes($message->message) ); ?>512 <?php echo apply_filters( 'bp_get_message_content', stripslashes($message->message) ); ?> 428 513 429 514 <?php do_action( 'messages_custom_fields_output_after' ) ?> … … 448 533 <label for="reply"></label> 449 534 <div> 450 <textarea name="content" id="message_content" rows="15" cols="40"><?php echo $content; ?></textarea>535 <textarea name="content" id="message_content" rows="15" cols="40"><?php echo attribute_escape( wp_filter_kses( $content ) ); ?></textarea> 451 536 </div> 452 537 </div> -
trunk/bp-wire/bp-wire-filters.php
r1366 r1408 2 2 3 3 /* Apply WordPress defined filters */ 4 add_filter( 'bp_wire_post_content', 'wptexturize' ); 5 6 add_filter( 'bp_wire_post_content', 'convert_smilies' ); 7 8 add_filter( 'bp_wire_post_content', 'convert_chars' ); 9 10 add_filter( 'bp_wire_post_content', 'wpautop' ); 11 12 add_filter( 'bp_wire_post_content', 'stripslashes_deep' ); 13 14 add_filter( 'bp_wire_post_content', 'make_clickable' ); 15 16 add_filter( 'bp_wire_post_content', 'wp_filter_kses', 1 ); 4 add_filter( 'bp_get_wire_post_content', 'wp_filter_kses', 1 ); 17 5 add_filter( 'bp_wire_post_content_before_save', 'wp_filter_kses', 1 ); 18 6 7 add_filter( 'bp_get_wire_post_content', 'wptexturize' ); 8 9 add_filter( 'bp_get_wire_post_content', 'convert_smilies', 2 ); 10 11 add_filter( 'bp_get_wire_post_content', 'convert_chars' ); 12 13 add_filter( 'bp_get_wire_post_content', 'wpautop' ); 14 15 add_filter( 'bp_get_wire_post_content', 'stripslashes_deep' ); 16 17 add_filter( 'bp_get_wire_post_content', 'make_clickable' ); 18 19 19 ?> -
trunk/bp-wire/bp-wire-templatetags.php
r1376 r1408 156 156 157 157 function bp_wire_title() { 158 global $bp_wire_header; 159 echo apply_filters( 'bp_group_reject_invite_link', $bp_wire_header ); 160 } 161 162 function bp_wire_item_id( $echo = false ) { 158 echo bp_get_wire_title(); 159 } 160 function bp_get_wire_title() { 161 global $bp_wire_header; 162 return apply_filters( 'bp_get_wire_title', $bp_wire_header ); 163 } 164 165 function bp_wire_item_id( $deprecated = false ) { 163 166 global $bp_item_id; 164 167 165 if ( $echo ) 166 echo apply_filters( 'bp_wire_item_id', $bp_item_id ); 167 else 168 return apply_filters( 'bp_wire_item_id', $bp_item_id ); 169 } 168 if ( $deprecated ) 169 echo bp_get_wire_item_id(); 170 else 171 return bp_get_wire_item_id(); 172 } 173 function bp_get_wire_item_id() { 174 global $bp_item_id; 175 176 return apply_filters( 'bp_get_wire_item_id', $bp_item_id ); 177 } 170 178 171 179 function bp_wire_no_posts_message() { 172 global $bp_wire_msg; 173 echo apply_filters( 'bp_wire_no_posts_message', $bp_wire_msg ); 174 } 175 180 echo bp_get_wire_no_posts_message(); 181 } 182 function bp_get_wire_no_posts_message() { 183 global $bp_wire_msg; 184 return apply_filters( 'bp_get_wire_no_posts_message', $bp_wire_msg ); 185 } 186 176 187 function bp_wire_can_post() { 177 188 global $bp_wire_can_post; … … 184 195 } 185 196 186 function bp_wire_post_id( $echo = true ) { 187 global $wire_posts_template; 188 189 if ( $echo ) 190 echo apply_filters( 'bp_wire_post_id', $wire_posts_template->wire_post->id ); 191 else 192 return apply_filters( 'bp_wire_post_id', $wire_posts_template->wire_post->id ); 193 } 197 function bp_wire_post_id( $deprecated = true ) { 198 global $wire_posts_template; 199 200 if ( !$deprecated ) 201 return bp_get_wire_post_id(); 202 else 203 echo bp_get_wire_post_id(); 204 } 205 function bp_get_wire_post_id() { 206 global $wire_posts_template; 207 208 return apply_filters( 'bp_get_wire_post_id', $wire_posts_template->wire_post->id ); 209 } 194 210 195 211 function bp_wire_post_content() { 196 global $wire_posts_template; 197 198 echo apply_filters( 'bp_wire_post_content', $wire_posts_template->wire_post->content ); 199 } 212 echo bp_get_wire_post_content(); 213 } 214 function bp_get_wire_post_content() { 215 global $wire_posts_template; 216 217 return apply_filters( 'bp_get_wire_post_content', $wire_posts_template->wire_post->content ); 218 } 200 219 201 220 function bp_wire_needs_pagination() { … … 209 228 210 229 function bp_wire_pagination() { 211 global $wire_posts_template; 212 echo $wire_posts_template->pag_links; 230 echo bp_get_wire_pagination(); 213 231 wp_nonce_field( 'get_wire_posts' ); 214 232 } 215 233 function bp_get_wire_pagination() { 234 global $wire_posts_template; 235 return apply_filters( 'bp_get_wire_pagination', $wire_posts_template->pag_links ); 236 } 237 216 238 function bp_wire_pagination_count() { 217 global $wire_posts_template; 218 219 $from_num = intval( ( $wire_posts_template->pag_page - 1 ) * $wire_posts_template->pag_num ) + 1; 220 $to_num = ( $from_num + ( $wire_posts_template->pag_num - 1) > $wire_posts_template->total_wire_post_count ) ? $wire_posts_template->total_wire_post_count : $from_num + ( $wire_posts_template->pag_num - 1); 221 222 echo apply_filters( 'bp_wire_pagination_count', sprintf( __( 'Viewing post %d to %d (%d total posts)', 'buddypress' ), $from_num, $to_num, $wire_posts_template->total_wire_post_count ) ); 223 } 224 239 echo bp_get_wire_pagination_count(); 240 } 241 function bp_get_wire_pagination_count() { 242 global $wire_posts_template; 243 244 $from_num = intval( ( $wire_posts_template->pag_page - 1 ) * $wire_posts_template->pag_num ) + 1; 245 $to_num = ( $from_num + ( $wire_posts_template->pag_num - 1) > $wire_posts_template->total_wire_post_count ) ? $wire_posts_template->total_wire_post_count : $from_num + ( $wire_posts_template->pag_num - 1); 246 247 return apply_filters( 'bp_get_wire_pagination_count', sprintf( __( 'Viewing post %d to %d (%d total posts)', 'buddypress' ), $from_num, $to_num, $wire_posts_template->total_wire_post_count ) ); 248 } 249 225 250 function bp_wire_ajax_loader_src() { 226 global $bp; 227 228 echo apply_filters( 'bp_wire_ajax_loader_src', $bp->wire->image_base . '/ajax-loader.gif' ); 229 } 230 231 function bp_wire_post_date( $date_format = null, $echo = true ) { 232 global $wire_posts_template; 233 234 if ( !$date_format ) 235 $date_format = get_option('date_format'); 236 237 if ( $echo ) 238 echo apply_filters( 'bp_wire_post_date', mysql2date( $date_format, $wire_posts_template->wire_post->date_posted ) ); 239 else 240 return apply_filters( 'bp_wire_post_date', mysql2date( $date_format, $wire_posts_template->wire_post->date_posted ) ); 241 } 242 243 function bp_wire_post_author_name( $echo = true ) { 244 global $wire_posts_template; 245 246 if ( $echo ) 247 echo apply_filters( 'bp_wire_post_author_name', bp_core_get_userlink( $wire_posts_template->wire_post->user_id ) ); 248 else 249 return apply_filters( 'bp_wire_post_author_name', bp_core_get_userlink( $wire_posts_template->wire_post->user_id ) ); 250 } 251 echo bp_get_wire_ajax_loader_src(); 252 } 253 function bp_get_wire_ajax_loader_src() { 254 global $bp; 255 256 return apply_filters( 'bp_get_wire_ajax_loader_src', $bp->wire->image_base . '/ajax-loader.gif' ); 257 } 258 259 function bp_wire_post_date( $deprecated = null, $deprecated2 = true ) { 260 global $wire_posts_template; 261 262 if ( !$deprecated2 ) 263 return bp_get_wire_post_date(); 264 else 265 echo bp_get_wire_post_date(); 266 } 267 function bp_get_wire_post_date() { 268 global $wire_posts_template; 269 270 return apply_filters( 'bp_get_wire_post_date', mysql2date( get_blog_option( BP_ROOT_BLOG, 'date_format'), $wire_posts_template->wire_post->date_posted ) ); 271 } 272 273 function bp_wire_post_author_name( $deprecated = true ) { 274 global $wire_posts_template; 275 276 if ( !$deprecated ) 277 return bp_get_wire_post_author_name(); 278 else 279 echo bp_get_wire_post_author_name(); 280 } 281 function bp_get_wire_post_author_name() { 282 global $wire_posts_template; 283 284 return apply_filters( 'bp_get_wire_post_author_name', bp_core_get_userlink( $wire_posts_template->wire_post->user_id ) ); 285 } 251 286 252 287 function bp_wire_post_author_avatar() { 253 global $wire_posts_template; 254 255 echo apply_filters( 'bp_wire_post_author_avatar', bp_core_get_avatar( $wire_posts_template->wire_post->user_id, 1 ) ); 256 } 288 echo bp_get_wire_post_author_avatar(); 289 } 290 function bp_get_wire_post_author_avatar() { 291 global $wire_posts_template; 292 293 return apply_filters( 'bp_get_wire_post_author_avatar', bp_core_get_avatar( $wire_posts_template->wire_post->user_id, 1 ) ); 294 } 257 295 258 296 function bp_wire_get_post_form() { … … 264 302 265 303 function bp_wire_get_action() { 266 global $bp; 267 268 if ( empty( $bp->current_item ) ) 269 $uri = $bp->current_action; 270 else 271 $uri = $bp->current_item; 272 273 if ( $bp->current_component == $bp->wire->slug || $bp->current_component == $bp->profile->slug ) { 274 echo apply_filters( 'bp_wire_get_action', $bp->displayed_user->domain . $bp->wire->slug . '/post/' ); 275 } else { 276 echo apply_filters( 'bp_wire_get_action', site_url() . '/' . $bp->{$bp->current_component}->slug . '/' . $uri . '/wire/post/' ); 277 } 278 } 304 echo bp_get_wire_get_action(); 305 } 306 function bp_get_wire_get_action() { 307 global $bp; 308 309 if ( empty( $bp->current_item ) ) 310 $uri = $bp->current_action; 311 else 312 $uri = $bp->current_item; 313 314 if ( $bp->current_component == $bp->wire->slug || $bp->current_component == $bp->profile->slug ) { 315 return apply_filters( 'bp_get_wire_get_action', $bp->displayed_user->domain . $bp->wire->slug . '/post/' ); 316 } else { 317 return apply_filters( 'bp_get_wire_get_action', site_url() . '/' . $bp->{$bp->current_component}->slug . '/' . $uri . '/' . $bp->wire->slug . '/post/' ); 318 } 319 } 279 320 280 321 function bp_wire_poster_avatar() { 281 global $bp; 282 283 echo apply_filters( 'bp_wire_poster_avatar', bp_core_get_avatar( $bp->loggedin_user->id, 1 ) ); 284 } 285 286 function bp_wire_poster_name( $echo = true ) { 287 global $bp; 288 289 if ( $echo ) 290 echo apply_filters( 'bp_wire_poster_name', '<a href="' . $bp->loggedin_user->domain . $bp->profile->slug . '">' . __('You', 'buddypress') . '</a>' ); 291 else 292 return apply_filters( 'bp_wire_poster_name', '<a href="' . $bp->loggedin_user->domain . $bp->profile->slug . '">' . __('You', 'buddypress') . '</a>' ); 293 } 294 295 function bp_wire_poster_date( $date_format = null, $echo = true ) { 296 if ( !$date_format ) 297 $date_format = get_option('date_format'); 298 299 if ( $echo ) 300 echo apply_filters( 'bp_wire_poster_date', mysql2date( $date_format, date("Y-m-d H:i:s") ) ); 301 else 302 return apply_filters( 'bp_wire_poster_date', mysql2date( $date_format, date("Y-m-d H:i:s") ) ); 303 } 322 echo bp_get_wire_poster_avatar(); 323 } 324 function bp_get_wire_poster_avatar() { 325 global $bp; 326 327 return apply_filters( 'bp_get_wire_poster_avatar', bp_core_get_avatar( $bp->loggedin_user->id, 1 ) ); 328 } 329 330 function bp_wire_poster_name( $deprecated = true ) { 331 if ( !$deprecated ) 332 return bp_get_wire_poster_name(); 333 else 334 echo bp_get_wire_poster_name(); 335 } 336 function bp_get_wire_poster_name() { 337 global $bp; 338 339 return apply_filters( 'bp_get_wire_poster_name', '<a href="' . $bp->loggedin_user->domain . $bp->profile->slug . '">' . __('You', 'buddypress') . '</a>' ); 340 } 341 342 function bp_wire_poster_date( $deprecated = null, $deprecated2 = true ) { 343 if ( !$deprecated2 ) 344 return bp_get_wire_poster_date(); 345 else 346 echo bp_get_wire_poster_date(); 347 } 348 function bp_get_wire_poster_date() { 349 return apply_filters( 'bp_get_wire_poster_date', mysql2date( get_blog_option( BP_ROOT_BLOG, 'date_format' ), date("Y-m-d H:i:s") ) ); 350 } 304 351 305 352 function bp_wire_delete_link() { 306 global $wire_posts_template, $bp; 307 308 if ( empty( $bp->current_item ) ) 309 $uri = $bp->current_action; 310 else 311 $uri = $bp->current_item; 312 313 if ( ( $wire_posts_template->wire_post->user_id == $bp->loggedin_user->id ) || $bp->is_item_admin || is_site_admin() ) { 314 if ( $bp->wire->slug == $bp->current_component || $bp->profile->slug == $bp->current_component ) { 315 echo apply_filters( 'bp_wire_delete_link', '<a href="' . wp_nonce_url( $bp->displayed_user->domain . $bp->wire->slug . '/delete/' . $wire_posts_template->wire_post->id, 'bp_wire_delete_link' ) . '">[' . __('Delete', 'buddypress') . ']</a>' ); 353 echo bp_get_wire_delete_link(); 354 } 355 function bp_get_wire_delete_link() { 356 global $wire_posts_template, $bp; 357 358 if ( empty( $bp->current_item ) ) 359 $uri = $bp->current_action; 360 else 361 $uri = $bp->current_item; 362 363 if ( ( $wire_posts_template->wire_post->user_id == $bp->loggedin_user->id ) || $bp->is_item_admin || is_site_admin() ) { 364 if ( $bp->wire->slug == $bp->current_component || $bp->profile->slug == $bp->current_component ) { 365 return apply_filters( 'bp_get_wire_delete_link', '<a href="' . wp_nonce_url( $bp->displayed_user->domain . $bp->wire->slug . '/delete/' . $wire_posts_template->wire_post->id, 'bp_wire_delete_link' ) . '">[' . __('Delete', 'buddypress') . ']</a>' ); 366 } else { 367 return apply_filters( 'bp_get_wire_delete_link', '<a href="' . wp_nonce_url( site_url( $bp->{$bp->current_component}->slug . '/' . $uri . '/wire/delete/' . $wire_posts_template->wire_post->id ), 'bp_wire_delete_link' ) . '">[' . __('Delete', 'buddypress') . ']</a>' ); 368 } 369 } 370 } 371 372 function bp_wire_see_all_link() { 373 echo bp_get_wire_see_all_link(); 374 } 375 function bp_get_wire_see_all_link() { 376 global $bp; 377 378 if ( empty( $bp->current_item ) ) 379 $uri = $bp->current_action; 380 else 381 $uri = $bp->current_item; 382 383 if ( $bp->current_component == $bp->wire->slug || $bp->current_component == $bp->profile->slug ) { 384 return apply_filters( 'bp_get_wire_see_all_link', $bp->displayed_user->domain . $bp->wire->slug ); 316 385 } else { 317 echo apply_filters( 'bp_wire_delete_link', '<a href="' . wp_nonce_url( site_url( $bp->{$bp->current_component}->slug . '/' . $uri . '/wire/delete/' . $wire_posts_template->wire_post->id ), 'bp_wire_delete_link' ) . '">[' . __('Delete', 'buddypress') . ']</a>' ); 318 } 319 } 320 } 321 322 function bp_wire_see_all_link() { 323 global $bp; 324 325 if ( empty( $bp->current_item ) ) 326 $uri = $bp->current_action; 327 else 328 $uri = $bp->current_item; 329 330 if ( $bp->current_component == $bp->wire->slug || $bp->current_component == $bp->profile->slug ) { 331 echo apply_filters( 'bp_wire_see_all_link', $bp->displayed_user->domain . $bp->wire->slug ); 332 } else { 333 echo apply_filters( 'bp_wire_see_all_link', $bp->root_domain . '/' . $bp->groups->slug . '/' . $uri . '/wire' ); 334 } 335 } 386 return apply_filters( 'bp_get_wire_see_all_link', $bp->root_domain . '/' . $bp->groups->slug . '/' . $uri . '/wire' ); 387 } 388 } 336 389 337 390 function bp_custom_wire_boxes_before() { -
trunk/bp-xprofile/bp-xprofile-filters.php
r1404 r1408 2 2 3 3 /* Apply WordPress defined filters */ 4 add_filter( 'bp_ the_profile_field_value', 'wp_filter_kses', 1 );4 add_filter( 'bp_get_the_profile_field_value', 'wp_filter_kses', 1 ); 5 5 add_filter( 'xprofile_get_field_data', 'wp_filter_kses', 1 ); 6 6 add_filter( 'xprofile_field_name_before_save', 'wp_filter_kses', 1 ); 7 7 add_filter( 'xprofile_field_description_before_save', 'wp_filter_kses', 1 ); 8 8 9 add_filter( 'bp_the_profile_field_value', 'wptexturize' ); 10 add_filter( 'bp_the_profile_field_value', 'convert_smilies' ); 11 add_filter( 'bp_the_profile_field_value', 'convert_chars' ); 12 add_filter( 'bp_the_profile_field_value', 'wpautop' ); 13 add_filter( 'bp_the_profile_field_value', 'make_clickable' ); 14 add_filter( 'bp_the_profile_field_value', 'xprofile_filter_format_field_value', 1, 2 ); 15 add_filter( 'bp_the_profile_field_value', 'xprofile_filter_link_profile_data', 2, 2 ); 16 17 add_filter( 'bp_the_profile_field_type', 'wptexturize' ); 18 add_filter( 'bp_the_profile_field_type', 'convert_smilies' ); 19 add_filter( 'bp_the_profile_field_type', 'convert_chars' ); 9 add_filter( 'bp_get_the_profile_field_value', 'wptexturize' ); 10 add_filter( 'bp_get_the_profile_field_value', 'convert_smilies', 2 ); 11 add_filter( 'bp_get_the_profile_field_value', 'convert_chars' ); 12 add_filter( 'bp_get_the_profile_field_value', 'wpautop' ); 13 add_filter( 'bp_get_the_profile_field_value', 'make_clickable' ); 14 add_filter( 'bp_get_the_profile_field_value', 'xprofile_filter_format_field_value', 1, 2 ); 15 add_filter( 'bp_get_the_profile_field_value', 'xprofile_filter_link_profile_data', 2, 2 ); 20 16 21 17 /* Custom BuddyPress filters */ -
trunk/bp-xprofile/bp-xprofile-templatetags.php
r1366 r1408 193 193 194 194 function bp_the_profile_group_name() { 195 global $group; 196 echo apply_filters( 'bp_the_profile_group_name', $group->name ); 197 } 195 echo bp_get_the_profile_group_name(); 196 } 197 function bp_get_the_profile_group_name() { 198 global $group; 199 return apply_filters( 'bp_get_the_profile_group_name', $group->name ); 200 } 198 201 199 202 function bp_the_profile_group_description() { 200 global $group; 201 echo apply_filters( 'bp_the_profile_group_description', $group->description ); 202 } 203 203 echo bp_get_the_profile_group_description(); 204 } 205 function bp_get_the_profile_group_description() { 206 global $group; 207 echo apply_filters( 'bp_get_the_profile_group_description', $group->description ); 208 } 209 204 210 function bp_profile_fields() { 205 211 global $profile_template; … … 213 219 214 220 function bp_the_profile_field_name() { 215 global $field; 216 echo apply_filters( 'bp_the_profile_field_name', $field->name ); 217 } 221 echo bp_get_the_profile_field_name(); 222 } 223 function bp_get_the_profile_field_name() { 224 global $field; 225 return apply_filters( 'bp_get_the_profile_field_name', $field->name ); 226 } 218 227 219 228 function bp_the_profile_field_value() { 220 global $field; 221 222 $field->data->value = bp_unserialize_profile_field( $field->data->value ); 223 224 echo apply_filters( 'bp_the_profile_field_value', $field->data->value, $field->type, $field->id ); 225 } 229 echo bp_get_the_profile_field_value(); 230 } 231 function bp_get_the_profile_field_value() { 232 global $field; 233 234 $field->data->value = bp_unserialize_profile_field( $field->data->value ); 235 236 return apply_filters( 'bp_get_the_profile_field_value', $field->data->value, $field->type, $field->id ); 237 } 226 238 227 239 function bp_unserialize_profile_field( $value ) { … … 259 271 } 260 272 261 function bp_profile_group_name( $ echo= true ) {273 function bp_profile_group_name( $deprecated = true ) { 262 274 global $bp; 263 275 … … 272 284 } 273 285 274 if ( $echo) {275 echo apply_filters( 'bp_xprofile_profile_group_name', $group->name);286 if ( !$deprecated ) { 287 return bp_get_profile_group_name(); 276 288 } else { 277 return apply_filters( 'bp_xprofile_profile_group_name', $group->name ); 278 } 279 } 289 echo bp_get_profile_group_name(); 290 } 291 } 292 function bp_get_profile_group_name( $deprecated = true ) { 293 global $bp; 294 295 $group_id = $bp->action_variables[1]; 296 297 if ( !is_numeric( $group_id ) ) 298 $group_id = 1; 299 300 if ( !$group = wp_cache_get( 'xprofile_group_' . $group_id, 'bp' ) ) { 301 $group = new BP_XProfile_Group($group_id); 302 wp_cache_set( 'xprofile_group_' . $group_id, $group, 'bp' ); 303 } 304 305 return apply_filters( 'bp_get_profile_group_name', $group->name ); 306 } 280 307 281 308 function bp_edit_profile_form() { … … 302 329 global $bp; 303 330 304 $last_updated = get_usermeta( $bp->displayed_user->id, 'profile_last_updated');331 $last_updated = bp_get_profile_last_updated(); 305 332 306 333 if ( !$last_updated ) { 307 _e( 'Profile not recently updated', 'buddypress') . '.';334 _e( 'Profile not recently updated', 'buddypress' ) . '.'; 308 335 } else { 309 echo apply_filters( 'bp_wire_poster_date', sprintf( __('Profile updated %s ago', 'buddypress'), bp_core_time_since( strtotime( $last_updated ) ) ) ); 310 } 311 } 336 echo $last_updated; 337 } 338 } 339 function bp_get_profile_last_updated() { 340 global $bp; 341 342 $last_updated = get_usermeta( $bp->displayed_user->id, 'profile_last_updated' ); 343 344 if ( $last_updated ) 345 return apply_filters( 'bp_get_profile_last_updated', sprintf( __('Profile updated %s ago', 'buddypress'), bp_core_time_since( strtotime( $last_updated ) ) ) ); 346 347 return false; 348 } 349 312 350 313 351 function bp_edit_profile_button() {
Note: See TracChangeset
for help on using the changeset viewer.