BuddyPress - Version 1.0.3

Version Description

Download this release

Release Info

Developer apeatling
Plugin Icon 128x128 BuddyPress
Version 1.0.3
Comparing to
See all releases

Code changes from version 1.0.2 to 1.0.3

bp-activity/bp-activity-filters.php CHANGED
@@ -2,17 +2,12 @@
2
3
/* Apply WordPress defined filters */
4
add_filter( 'bp_get_activity_content', 'wp_filter_kses', 1 );
5
-
6
add_filter( 'bp_get_activity_content', 'wptexturize' );
7
-
8
add_filter( 'bp_get_activity_content', 'convert_smilies' );
9
-
10
add_filter( 'bp_get_activity_content', 'convert_chars' );
11
-
12
add_filter( 'bp_get_activity_content', 'wpautop' );
13
-
14
add_filter( 'bp_get_activity_content', 'make_clickable' );
15
-
16
add_filter( 'bp_get_activity_content', 'stripslashes_deep' );
17
18
function bp_activity_add_allowed_tags( $allowedtags ) {
2
3
/* Apply WordPress defined filters */
4
add_filter( 'bp_get_activity_content', 'wp_filter_kses', 1 );
5
+ add_filter( 'bp_get_activity_content', 'force_balance_tags' );
6
add_filter( 'bp_get_activity_content', 'wptexturize' );
7
add_filter( 'bp_get_activity_content', 'convert_smilies' );
8
add_filter( 'bp_get_activity_content', 'convert_chars' );
9
add_filter( 'bp_get_activity_content', 'wpautop' );
10
add_filter( 'bp_get_activity_content', 'make_clickable' );
11
add_filter( 'bp_get_activity_content', 'stripslashes_deep' );
12
13
function bp_activity_add_allowed_tags( $allowedtags ) {
bp-activity/bp-activity-widgets.php CHANGED
@@ -2,81 +2,68 @@
2
3
/* Register widgets for blogs component */
4
function bp_activity_register_widgets() {
5
- global $current_blog;
6
-
7
- /* Site Wide Activity Widget */
8
- wp_register_sidebar_widget( 'buddypress-activity', __('Site Wide Activity', 'buddypress'), 'bp_activity_widget_sitewide_activity');
9
- wp_register_widget_control( 'buddypress-activity', __('Site Wide Activity', 'buddypress'), 'bp_activity_widget_sitewide_activity_control' );
10
-
11
- if ( is_active_widget( 'bp_activity_widget_sitewide_activity' ) ) {
12
- wp_enqueue_style( 'bp-activity-widget-activity-css', BP_PLUGIN_URL . '/bp-activity/css/widget-activity.css' );
13
- }
14
}
15
add_action( 'plugins_loaded', 'bp_activity_register_widgets' );
16
17
18
- function bp_activity_widget_sitewide_activity($args) {
19
- global $bp, $current_blog;
20
-
21
- extract($args);
22
- $options = get_blog_option( $current_blog->blog_id, 'bp_activity_widget_sitewide_activity' );
23
- ?>
24
- <?php echo $before_widget; ?>
25
- <?php echo $before_title
26
- . $widget_name
27
- . $after_title; ?>
28
29
- <?php
30
- if ( !$options['max_items'] || empty( $options['max_items'] ) )
31
- $options['max_items'] = 20;
32
- ?>
33
-
34
- <?php
35
- if ( !$activity = wp_cache_get( 'sitewide_activity', 'bp' ) ) {
36
- $activity = bp_activity_get_sitewide_activity( $options['max_items'] );
37
- wp_cache_set( 'sitewide_activity', $activity, 'bp' );
38
}
39
- ?>
40
41
- <?php if ( $activity['activities'] ) : ?>
42
- <div class="item-options" id="activity-list-options">
43
- <img src="<?php echo $bp->activity->image_base; ?>/rss.png" alt="<?php _e( 'RSS Feed', 'buddypress' ) ?>" /> <a href="<?php bp_sitewide_activity_feed_link() ?>" title="<?php _e( 'Site Wide Activity RSS Feed', 'buddypress' ) ?>"><?php _e( 'RSS Feed', 'buddypress' ) ?></a>
44
- </div>
45
- <ul id="site-wide-stream" class="activity-list">
46
- <?php foreach( $activity['activities'] as $item ) : ?>
47
- <li class="<?php echo $item['component_name'] ?>">
48
- <?php echo apply_filters( 'bp_get_activity_content', bp_activity_content_filter( $item['content'], $item['date_recorded'], '', true, false, true ) ); ?>
49
- </li>
50
- <?php endforeach; ?>
51
- </ul>
52
- <?php else: ?>
53
- <div class="widget-error">
54
- <?php _e('There has been no recent site activity.', 'buddypress') ?>
55
- </div>
56
- <?php endif; ?>
57
58
- <?php echo $after_widget; ?>
59
- <?php
60
- }
61
62
- function bp_activity_widget_sitewide_activity_control() {
63
- global $current_blog;
64
-
65
- $options = $newoptions = get_blog_option( $current_blog->blog_id, 'bp_activity_widget_sitewide_activity');
66
67
- if ( $_POST['bp-activity-widget-sitewide-submit'] ) {
68
- $newoptions['max_items'] = strip_tags( stripslashes( $_POST['bp-activity-widget-sitewide-items-max'] ) );
69
}
70
-
71
- if ( $options != $newoptions ) {
72
- $options = $newoptions;
73
- update_blog_option( $current_blog->blog_id, 'bp_activity_widget_sitewide_activity', $options );
74
- }
75
-
76
- ?>
77
- <p><label for="bp-activity-widget-sitewide-items-max"><?php _e('Max Number of Items:', 'buddypress'); ?> <input class="widefat" id="bp-activity-widget-sitewide-items-max" name="bp-activity-widget-sitewide-items-max" type="text" value="<?php echo attribute_escape( $options['max_items'] ); ?>" style="width: 30%" /></label></p>
78
- <input type="hidden" id="bp-activity-widget-sitewide-submit" name="bp-activity-widget-sitewide-submit" value="1" />
79
- <?php
80
}
81
-
82
?>
2
3
/* Register widgets for blogs component */
4
function bp_activity_register_widgets() {
5
+ add_action('widgets_init', create_function('', 'return register_widget("BP_Activity_Widget");') );
6
}
7
add_action( 'plugins_loaded', 'bp_activity_register_widgets' );
8
9
+ class BP_Activity_Widget extends WP_Widget {
10
+ function bp_activity_widget() {
11
+ parent::WP_Widget( false, $name = 'Site Wide Activity' );
12
+ wp_enqueue_style( 'bp-activity-widget-activity-css', BP_PLUGIN_URL . '/bp-activity/css/widget-activity.css' );
13
+ }
14
15
+ function widget($args, $instance) {
16
+ global $bp;
17
+
18
+ extract( $args );
19
+
20
+ echo $before_widget;
21
+ echo $before_title
22
+ . $widget_name
23
+ . $after_title; ?>
24
25
+ <?php
26
+ if ( !$activity = wp_cache_get( 'sitewide_activity', 'bp' ) ) {
27
+ $activity = bp_activity_get_sitewide_activity( $instance['max_items'] );
28
+ wp_cache_set( 'sitewide_activity', $activity, 'bp' );
29
+ }
30
+ ?>
31
+
32
+ <?php if ( $activity['activities'] ) : ?>
33
+ <div class="item-options" id="activity-list-options">
34
+ <img src="<?php echo $bp->activity->image_base; ?>/rss.png" alt="<?php _e( 'RSS Feed', 'buddypress' ) ?>" /> <a href="<?php bp_sitewide_activity_feed_link() ?>" title="<?php _e( 'Site Wide Activity RSS Feed', 'buddypress' ) ?>"><?php _e( 'RSS Feed', 'buddypress' ) ?></a>
35
+ </div>
36
+ <ul id="site-wide-stream" class="activity-list">
37
+ <?php foreach( $activity['activities'] as $item ) : ?>
38
+ <li class="<?php echo $item['component_name'] ?>">
39
+ <?php echo apply_filters( 'bp_get_activity_content', bp_activity_content_filter( $item['content'], $item['date_recorded'], '', true, false, true ) ); ?>
40
+ </li>
41
+ <?php endforeach; ?>
42
+ </ul>
43
+ <?php else: ?>
44
+ <div class="widget-error">
45
+ <?php _e('There has been no recent site activity.', 'buddypress') ?>
46
+ </div>
47
+ <?php endif; ?>
48
+
49
+ <?php echo $after_widget; ?>
50
+ <?php
51
}
52
53
+ function update( $new_instance, $old_instance ) {
54
+ $instance = $old_instance;
55
+ $instance['max_items'] = strip_tags( $new_instance['max_items'] );
56
57
+ return $instance;
58
+ }
59
60
+ function form( $instance ) {
61
+ $instance = wp_parse_args( (array) $instance, array( 'max_items' => 30 ) );
62
+ $max_items = strip_tags( $instance['max_items'] );
63
+ ?>
64
65
+ <p><label for="bp-core-widget-members-max"><?php _e('Max items to show:', 'buddypress'); ?> <input class="widefat" id="<?php echo $this->get_field_id( 'max_items' ); ?>" name="<?php echo $this->get_field_name( 'max_items' ); ?>" type="text" value="<?php echo attribute_escape( $max_items ); ?>" style="width: 30%" /></label></p>
66
+ <?php
67
}
68
}
69
?>
bp-activity/css/widget-activity.css CHANGED
@@ -6,4 +6,9 @@
6
margin: 0;
7
padding: 0;
8
list-style: none;
9
}
6
margin: 0;
7
padding: 0;
8
list-style: none;
9
+ }
10
+
11
+ .widget_bp_core_recently_active_widget div.item-avatar {
12
+ display: inline;
13
+ margin: 0 5px 5x 0;
14
}
bp-blogs/bp-blogs-widgets.php CHANGED
@@ -2,86 +2,75 @@
2
3
/* Register widgets for blogs component */
4
function bp_blogs_register_widgets() {
5
- global $current_blog;
6
-
7
- /* Latest Posts Widget */
8
- wp_register_sidebar_widget( 'buddypress-blogs', __('Recent Blog Posts', 'buddypress'), 'bp_blogs_widget_recent_posts');
9
- wp_register_widget_control( 'buddypress-blogs', __('Recent Blog Posts', 'buddypress'), 'bp_blogs_widget_recent_posts_control' );
10
-
11
- if ( is_active_widget( 'bp_blogs_widget_recent_posts' ) ) {
12
- wp_enqueue_style( 'bp-blogs-widget-posts-css', BP_PLUGIN_URL . '/bp-blogs/css/widget-blogs.css' );
13
- }
14
}
15
add_action( 'plugins_loaded', 'bp_blogs_register_widgets' );
16
17
18
- function bp_blogs_widget_recent_posts($args) {
19
- global $current_blog;
20
-
21
- extract($args);
22
- $options = get_blog_option( $current_blog->blog_id, 'bp_blogs_widget_recent_posts' );
23
24
- if ( empty( $options['max_posts'] ) || !$options['max_posts'] )
25
- $options['max_posts'] = 5;
26
- ?>
27
- <?php echo $before_widget; ?>
28
- <?php echo $before_title
29
- . $widget_name
30
- . $after_title; ?>
31
-
32
- <?php $posts = bp_blogs_get_latest_posts( null, $options['max_posts'] ) ?>
33
- <?php $counter = 0; ?>
34
35
- <?php if ( $posts ) : ?>
36
- <div class="item-options" id="recent-posts-options">
37
- <?php _e("Site Wide", 'buddypress') ?>
38
- </div>
39
- <ul id="recent-posts" class="item-list">
40
- <?php foreach ( $posts as $post ) : ?>
41
- <li>
42
- <div class="item-avatar">
43
- <a href="<?php echo bp_post_get_permalink( $post, $post->blog_id ) ?>" title="<?php echo apply_filters( 'the_title', $post->post_title ) ?>"><?php echo bp_core_get_avatar( $post->post_author, 1 ) ?></a>
44
- </div>
45
-
46
- <div class="item">
47
- <h4 class="item-title"><a href="<?php echo bp_post_get_permalink( $post, $post->blog_id ) ?>" title="<?php echo apply_filters( 'the_title', $post->post_title ) ?>"><?php echo apply_filters( 'the_title', $post->post_title ) ?></a></h4>
48
- <?php if ( !$counter ) : ?>
49
- <div class="item-content"><?php echo bp_create_excerpt($post->post_content) ?></div>
50
- <?php endif; ?>
51
- <div class="item-meta"><em><?php printf( __( 'by %s from the blog <a href="%s">%s</a>', 'buddypress' ), bp_core_get_userlink( $post->post_author ), get_blog_option( $post->blog_id, 'siteurl' ), get_blog_option( $post->blog_id, 'blogname' ) ) ?></em></div>
52
- </div>
53
- </li>
54
- <?php $counter++; ?>
55
- <?php endforeach; ?>
56
- </ul>
57
- <?php else: ?>
58
- <div class="widget-error">
59
- <?php _e('There are no recent blog posts, why not write one?', 'buddypress') ?>
60
- </div>
61
- <?php endif; ?>
62
63
- <?php echo $after_widget; ?>
64
- <?php
65
- }
66
67
- function bp_blogs_widget_recent_posts_control() {
68
- global $current_blog;
69
-
70
- $options = $newoptions = get_blog_option( $current_blog->blog_id, 'bp_blogs_widget_recent_posts');
71
72
- if ( $_POST['bp-blogs-widget-recent-posts-submit'] ) {
73
- $newoptions['max_posts'] = strip_tags( stripslashes( $_POST['bp-blogs-widget-recent-posts-max'] ) );
74
- }
75
-
76
- if ( $options != $newoptions ) {
77
- $options = $newoptions;
78
- update_blog_option( $current_blog->blog_id, 'bp_blogs_widget_recent_posts', $options );
79
}
80
81
- ?>
82
- <p><label for="bp-blogs-widget-recent-posts-max"><?php _e('Max Number of Posts:', 'buddypress'); ?> <input class="widefat" id="bp-blogs-widget-recent-posts-max" name="bp-blogs-widget-recent-posts-max" type="text" value="<?php echo attribute_escape( $options['max_posts'] ); ?>" style="width: 30%" /></label></p>
83
- <input type="hidden" id="bp-blogs-widget-recent-posts-submit" name="bp-blogs-widget-recent-posts-submit" value="1" />
84
- <?php
85
- }
86
87
?>
2
3
/* Register widgets for blogs component */
4
function bp_blogs_register_widgets() {
5
+ add_action('widgets_init', create_function('', 'return register_widget("BP_Blogs_Recent_Posts_Widget");') );
6
}
7
add_action( 'plugins_loaded', 'bp_blogs_register_widgets' );
8
9
+ class BP_Blogs_Recent_Posts_Widget extends WP_Widget {
10
+ function bp_blogs_recent_posts_widget() {
11
+ parent::WP_Widget( false, $name = 'Recent Site Wide Posts' );
12
+ wp_enqueue_style( 'bp-blogs-widget-posts-css', BP_PLUGIN_URL . '/bp-blogs/css/widget-blogs.css' );
13
+ }
14
15
+ function widget($args, $instance) {
16
+ global $bp;
17
+
18
+ extract( $args );
19
+
20
+ echo $before_widget;
21
+ echo $before_title
22
+ . $widget_name
23
+ . $after_title; ?>
24
25
+ <?php $posts = bp_blogs_get_latest_posts( null, $instance['max_posts'] ) ?>
26
+ <?php $counter = 0; ?>
27
28
+ <?php if ( $posts ) : ?>
29
+ <div class="item-options" id="recent-posts-options">
30
+ <?php _e("Site Wide", 'buddypress') ?>
31
+ </div>
32
+ <ul id="recent-posts" class="item-list">
33
+ <?php foreach ( $posts as $post ) : ?>
34
+ <li>
35
+ <div class="item-avatar">
36
+ <a href="<?php echo bp_post_get_permalink( $post, $post->blog_id ) ?>" title="<?php echo apply_filters( 'the_title', $post->post_title ) ?>"><?php echo bp_core_get_avatar( $post->post_author, 1 ) ?></a>
37
+ </div>
38
39
+ <div class="item">
40
+ <h4 class="item-title"><a href="<?php echo bp_post_get_permalink( $post, $post->blog_id ) ?>" title="<?php echo apply_filters( 'the_title', $post->post_title ) ?>"><?php echo apply_filters( 'the_title', $post->post_title ) ?></a></h4>
41
+ <?php if ( !$counter ) : ?>
42
+ <div class="item-content"><?php echo bp_create_excerpt($post->post_content) ?></div>
43
+ <?php endif; ?>
44
+ <div class="item-meta"><em><?php printf( __( 'by %s from the blog <a href="%s">%s</a>', 'buddypress' ), bp_core_get_userlink( $post->post_author ), get_blog_option( $post->blog_id, 'siteurl' ), get_blog_option( $post->blog_id, 'blogname' ) ) ?></em></div>
45
+ </div>
46
+ </li>
47
+ <?php $counter++; ?>
48
+ <?php endforeach; ?>
49
+ </ul>
50
+ <?php else: ?>
51
+ <div class="widget-error">
52
+ <?php _e('There are no recent blog posts, why not write one?', 'buddypress') ?>
53
+ </div>
54
+ <?php endif; ?>
55
+
56
+ <?php echo $after_widget; ?>
57
+ <?php
58
+ }
59
60
+ function update( $new_instance, $old_instance ) {
61
+ $instance = $old_instance;
62
+ $instance['max_posts'] = strip_tags( $new_instance['max_posts'] );
63
64
+ return $instance;
65
}
66
67
+ function form( $instance ) {
68
+ $instance = wp_parse_args( (array) $instance, array( 'max_posts' => 10 ) );
69
+ $max_posts = strip_tags( $instance['max_posts'] );
70
+ ?>
71
72
+ <p><label for="bp-blogs-widget-posts-max"><?php _e('Max posts to show:', 'buddypress'); ?> <input class="widefat" id="<?php echo $this->get_field_id( 'max_posts' ); ?>" name="<?php echo $this->get_field_name( 'max_posts' ); ?>" type="text" value="<?php echo attribute_escape( $max_posts ); ?>" style="width: 30%" /></label></p>
73
+ <?php
74
+ }
75
+ }
76
?>
bp-blogs/css/widget-blogs.css CHANGED
@@ -1,29 +1,29 @@
1
- .bp_blogs_widget_recent_posts ul.item-list {
2
margin: 15px 0 0 0;
3
padding: 0;
4
list-style: none;
5
}
6
7
- .bp_blogs_widget_recent_posts ul.item-list li {
8
min-height: 60px;
9
}
10
11
- .bp_blogs_widget_recent_posts ul.item-list li .item-meta {
12
- margin-left: 35px;
13
}
14
- .bp_blogs_widget_recent_posts ul.item-list li .item h4.item-title {
15
clear: none !important;
16
}
17
18
- .bp_blogs_widget_recent_posts ul.item-list li .item-avatar {
19
float: left;
20
margin: 0 10px 0 0;
21
}
22
- .bp_blogs_widget_recent_posts ul.item-list li .item-avatar img.avatar {
23
width: 25px;
24
height: 25px;
25
}
26
27
- .bp_blogs_widget_recent_posts ul li em {
28
font-size: 11px;
29
}
1
+ .widget_bp_blogs_recent_posts_widget ul.item-list {
2
margin: 15px 0 0 0;
3
padding: 0;
4
list-style: none;
5
}
6
7
+ .widget_bp_blogs_recent_posts_widget ul.item-list li {
8
min-height: 60px;
9
}
10
11
+ .widget_bp_blogs_recent_posts_widget ul.item-list li .item-meta {
12
+ margin-left: 10px;
13
}
14
+ .widget_bp_blogs_recent_posts_widget ul.item-list li .item h4.item-title {
15
clear: none !important;
16
}
17
18
+ .widget_bp_blogs_recent_posts_widget ul.item-list li .item-avatar {
19
float: left;
20
margin: 0 10px 0 0;
21
}
22
+ .widget_bp_blogs_recent_posts_widget ul.item-list li .item-avatar img.avatar {
23
width: 25px;
24
height: 25px;
25
}
26
27
+ .widget_bp_blogs_recent_posts_widget ul li em {
28
font-size: 11px;
29
}
bp-core.php CHANGED
@@ -529,7 +529,7 @@ function bp_core_add_subnav_item( $parent_id, $slug, $name, $link, $function, $c
529
'link' => $link . $slug,
530
'css_id' => $css_id
531
);
532
-
533
if ( function_exists($function) && $user_has_access && $bp->current_action == $slug && $bp->current_component == $parent_id )
534
add_action( 'wp', $function, 3 );
535
}
@@ -847,7 +847,7 @@ function bp_core_get_user_displayname( $user_id ) {
847
wp_cache_set( 'bp_user_fullname_' . $user_id, $fullname, 'bp' );
848
}
849
850
- return apply_filters( 'bp_core_get_user_displayname', stripslashes( trim( $fullname ) ) );
851
}
852
/* DEPRECATED Use: bp_core_get_user_displayname */
853
function bp_core_global_user_fullname( $user_id ) { return bp_core_get_user_displayname( $user_id ); }
@@ -1195,7 +1195,7 @@ function bp_core_sort_nav_items( $nav_array ) {
1195
$new_nav = array_merge( $new_nav, $nav_array );
1196
}
1197
1198
- return $new_nav;
1199
}
1200
1201
/**
@@ -1222,6 +1222,12 @@ function bp_core_referrer() {
1222
* @return An array containing all of the themes.
1223
*/
1224
function bp_core_get_buddypress_themes() {
1225
add_filter( 'theme_root', 'bp_core_filter_buddypress_theme_root' );
1226
$themes = get_themes();
1227
@@ -1238,6 +1244,9 @@ function bp_core_get_buddypress_themes() {
1238
}
1239
}
1240
1241
return $member_themes;
1242
}
1243
function bp_core_get_member_themes() { return bp_core_get_buddypress_themes(); } // DEPRECATED
@@ -1370,9 +1379,6 @@ function bp_core_delete_account() {
1370
1371
// Be careful with this function!
1372
1373
- if ( !check_admin_referer( 'delete-account' ) )
1374
- return false;
1375
-
1376
/* Site admins should not be allowed to delete their accounts */
1377
if ( is_site_admin() )
1378
return false;
529
'link' => $link . $slug,
530
'css_id' => $css_id
531
);
532
+
533
if ( function_exists($function) && $user_has_access && $bp->current_action == $slug && $bp->current_component == $parent_id )
534
add_action( 'wp', $function, 3 );
535
}
847
wp_cache_set( 'bp_user_fullname_' . $user_id, $fullname, 'bp' );
848
}
849
850
+ return apply_filters( 'bp_core_get_user_displayname', stripslashes( strip_tags( trim( $fullname ) ) ) );
851
}
852
/* DEPRECATED Use: bp_core_get_user_displayname */
853
function bp_core_global_user_fullname( $user_id ) { return bp_core_get_user_displayname( $user_id ); }
1195
$new_nav = array_merge( $new_nav, $nav_array );
1196
}
1197
1198
+ return apply_filters( 'bp_core_sort_nav_items', $new_nav );
1199
}
1200
1201
/**
1222
* @return An array containing all of the themes.
1223
*/
1224
function bp_core_get_buddypress_themes() {
1225
+ global $wp_themes;
1226
+
1227
+ /* Remove the cached WP themes first */
1228
+ $wp_existing_themes = &$wp_themes;
1229
+ $wp_themes = null;
1230
+
1231
add_filter( 'theme_root', 'bp_core_filter_buddypress_theme_root' );
1232
$themes = get_themes();
1233
1244
}
1245
}
1246
1247
+ /* Restore the cached WP themes */
1248
+ $wp_themes = $wp_existing_themes;
1249
+
1250
return $member_themes;
1251
}
1252
function bp_core_get_member_themes() { return bp_core_get_buddypress_themes(); } // DEPRECATED
1379
1380
// Be careful with this function!
1381
1382
/* Site admins should not be allowed to delete their accounts */
1383
if ( is_site_admin() )
1384
return false;
bp-core/bp-core-templatetags.php CHANGED
@@ -864,12 +864,16 @@ class BP_Core_Members_Template {
864
$this->in_the_loop = true;
865
$this->member = $this->next_member();
866
$user_id = $this->member->user_id;
867
868
if ( !$this->member = wp_cache_get( 'bp_user_' . $user_id, 'bp' ) ) {
869
$this->member = new BP_Core_User( $user_id );
870
wp_cache_set( 'bp_user_' . $user_id, $this->member, 'bp' );
871
}
872
873
if ( 0 == $this->current_member ) // loop has just started
874
do_action('loop_start');
875
}
@@ -979,6 +983,15 @@ function bp_the_site_member_last_active() {
979
980
return apply_filters( 'bp_the_site_member_last_active', $site_members_template->member->last_active );
981
}
982
983
function bp_the_site_member_add_friend_button() {
984
global $site_members_template;
864
$this->in_the_loop = true;
865
$this->member = $this->next_member();
866
$user_id = $this->member->user_id;
867
+ $user_registered = $this->member->user_registered;
868
869
if ( !$this->member = wp_cache_get( 'bp_user_' . $user_id, 'bp' ) ) {
870
$this->member = new BP_Core_User( $user_id );
871
wp_cache_set( 'bp_user_' . $user_id, $this->member, 'bp' );
872
}
873
874
+ if ( $user_registered )
875
+ $this->member->user_registered = $user_registered;
876
+
877
if ( 0 == $this->current_member ) // loop has just started
878
do_action('loop_start');
879
}
983
984
return apply_filters( 'bp_the_site_member_last_active', $site_members_template->member->last_active );
985
}
986
+
987
+ function bp_the_site_member_registered() {
988
+ echo bp_get_the_site_member_registered();
989
+ }
990
+ function bp_get_the_site_member_registered() {
991
+ global $site_members_template;
992
+
993
+ return apply_filters( 'bp_the_site_member_last_active', strtotime( $site_members_template->member->user_registered ) );
994
+ }
995
996
function bp_the_site_member_add_friend_button() {
997
global $site_members_template;
bp-core/bp-core-widgets.php CHANGED
@@ -2,233 +2,250 @@
2
3
/* Register widgets for the core component */
4
function bp_core_register_widgets() {
5
- global $current_blog;
6
-
7
- /* Site welcome widget */
8
- wp_register_sidebar_widget( 'buddypress-welcome', __( 'Welcome', 'buddypress' ), 'bp_core_widget_welcome' );
9
- wp_register_widget_control( 'buddypress-welcome', __( 'Welcome', 'buddypress' ), 'bp_core_widget_welcome_control' );
10
-
11
- /* Site members widget */
12
- wp_register_sidebar_widget( 'buddypress-members', __( 'Members', 'buddypress' ), 'bp_core_widget_members' );
13
- wp_register_widget_control( 'buddypress-members', __( 'Members', 'buddypress' ), 'bp_core_widget_members_control' );
14
-
15
- /* Include the javascript needed for activated widgets only */
16
- if ( is_active_widget( 'bp_core_widget_members' ) ) {
17
- wp_enqueue_script( 'bp_core_widget_members-js', BP_PLUGIN_URL . '/bp-core/js/widget-members.js', array('jquery', 'jquery-livequery-pack') );
18
- wp_enqueue_style( 'bp_core_widget_members-css', BP_PLUGIN_URL . '/bp-core/css/widget-members.css' );
19
- }
20
-
21
- wp_register_sidebar_widget( 'buddypress-whosonline', __( "Who's Online", 'buddypress' ), 'bp_core_widget_whos_online' );
22
- wp_register_widget_control( 'buddypress-whosonline', __( "Who's Online", 'buddypress' ), 'bp_core_widget_whos_online_control' );
23
-
24
}
25
add_action( 'plugins_loaded', 'bp_core_register_widgets' );
26
27
-
28
/*** WELCOME WIDGET *****************/
29
30
- function bp_core_widget_welcome($args) {
31
- global $current_blog;
32
-
33
- extract($args);
34
- $options = get_blog_option( $current_blog->blog_id, 'bp_core_widget_welcome' );
35
- ?>
36
- <?php echo $before_widget; ?>
37
- <?php echo $before_title
38
- . $widget_name
39
- . $after_title; ?>
40
-
41
- <?php if ( $options['title'] ) : ?><h3><?php echo attribute_escape( $options['title'] ) ?></h3><?php endif; ?>
42
- <?php if ( $options['text'] ) : ?><p><?php echo attribute_escape( $options['text'] ) ?></p><?php endif; ?>
43
-
44
- <?php if ( !is_user_logged_in() ) { ?>
45
- <div class="create-account"><div class="visit generic-button"><a href="<?php bp_signup_page() ?>" title="<?php _e('Create Account', 'buddypress') ?>"><?php _e('Create Account', 'buddypress') ?></a></div></div>
46
- <?php } ?>
47
-
48
- <?php echo $after_widget; ?>
49
- <?php
50
- }
51
52
- function bp_core_widget_welcome_control() {
53
- global $current_blog;
54
55
- $options = $newoptions = get_blog_option( $current_blog->blog_id, 'bp_core_widget_welcome' );
56
57
- if ( $_POST['bp-widget-welcome-submit'] ) {
58
- $newoptions['title'] = strip_tags( stripslashes( $_POST['bp-widget-welcome-title'] ) );
59
- $newoptions['text'] = stripslashes( wp_filter_post_kses( $_POST['bp-widget-welcome-text'] ) );
60
}
61
-
62
- if ( $options != $newoptions ) {
63
- $options = $newoptions;
64
- update_blog_option( $current_blog->blog_id, 'bp_core_widget_welcome', $options );
65
- }
66
-
67
- ?>
68
- <p><label for="bp-widget-welcome-title"><?php _e('Title:', 'buddypress'); ?> <input class="widefat" id="bp-widget-welcome-title" name="bp-widget-welcome-title" type="text" value="<?php echo attribute_escape( $options['title'] ); ?>" /></label></p>
69
- <p>
70
- <label for="bp-widget-welcome-text"><?php _e( 'Welcome Text:' , 'buddypress'); ?>
71
- <textarea id="bp-widget-welcome-text" name="bp-widget-welcome-text" class="widefat" style="height: 100px"><?php echo htmlspecialchars( $options['text'] ); ?></textarea>
72
- </label>
73
- </p>
74
- <input type="hidden" id="bp-widget-welcome-submit" name="bp-widget-welcome-submit" value="1" />
75
- <?php
76
}
77
78
/*** MEMBERS WIDGET *****************/
79
80
- function bp_core_widget_members($args) {
81
- global $current_blog, $bp;
82
-
83
- extract($args);
84
- $options = get_blog_option( $current_blog->blog_id, 'bp_core_widget_members' );
85
- ?>
86
- <?php echo $before_widget; ?>
87
- <?php echo $before_title
88
- . $widget_name
89
- . $after_title; ?>
90
-
91
- <?php
92
- if ( empty( $options['max_members'] ) || !$options['max_members'] )
93
- $options['max_members'] = 5;
94
-
95
- if ( !$users = wp_cache_get( 'newest_users', 'bp' ) ) {
96
- $users = BP_Core_User::get_newest_users( $options['max_members'] );
97
- wp_cache_set( 'newest_users', $users, 'bp' );
98
}
99
- ?>
100
-
101
- <?php if ( $users['users'] ) : ?>
102
- <div class="item-options" id="members-list-options">
103
- <img id="ajax-loader-members" src="<?php echo $bp->core->image_base ?>/ajax-loader.gif" height="7" alt="<?php _e( 'Loading', 'buddypress' ) ?>" style="display: none;" />
104
- <a href="<?php echo site_url() . '/' . BP_MEMBERS_SLUG ?>" id="newest-members" class="selected"><?php _e( 'Newest', 'buddypress' ) ?></a> |
105
- <a href="<?php echo site_url() . '/' . BP_MEMBERS_SLUG ?>" id="recently-active-members"><?php _e( 'Active', 'buddypress' ) ?></a> |
106
- <a href="<?php echo site_url() . '/' . BP_MEMBERS_SLUG ?>" id="popular-members"><?php _e( 'Popular', 'buddypress' ) ?></a>
107
- </div>
108
- <ul id="members-list" class="item-list">
109
- <?php foreach ( (array) $users['users'] as $user ) : ?>
110
- <li class="vcard">
111
- <div class="item-avatar">
112
- <a href="<?php echo bp_core_get_userlink( $user->user_id, false, true ) ?>"><?php echo bp_core_get_avatar( $user->user_id, 1 ) ?></a>
113
- </div>
114
115
- <div class="item">
116
- <div class="item-title fn"><?php echo bp_core_get_userlink( $user->user_id ) ?></div>
117
- <div class="item-meta"><span class="activity"><?php echo bp_core_get_last_activity( $user->user_registered, __( 'registered %s ago', 'buddypress' ) ) ?></span></div>
118
- </div>
119
- </li>
120
- <?php $counter++; ?>
121
- <?php endforeach; ?>
122
- </ul>
123
124
- <?php
125
- if ( function_exists('wp_nonce_field') )
126
- wp_nonce_field( 'bp_core_widget_members', '_wpnonce-members' );
127
- ?>
128
129
- <input type="hidden" name="members_widget_max" id="members_widget_max" value="<?php echo attribute_escape( $options['max_members'] ); ?>" />
130
-
131
- <?php else: ?>
132
- <div class="widget-error">
133
- <?php _e('No one has signed up yet!', 'buddypress') ?>
134
- </div>
135
- <?php endif; ?>
136
-
137
- <?php echo $after_widget; ?>
138
- <?php
139
- }
140
141
- function bp_core_widget_members_control() {
142
- global $current_blog;
143
-
144
- $options = $newoptions = get_blog_option( $current_blog->blog_id, 'bp_core_widget_members');
145
146
- if ( $_POST['bp-core-widget-members-submit'] ) {
147
- $newoptions['max_members'] = strip_tags( stripslashes( $_POST['bp-core-widget-members-max'] ) );
148
}
149
-
150
- if ( $options != $newoptions ) {
151
- $options = $newoptions;
152
- update_blog_option( $current_blog->blog_id, 'bp_core_widget_members', $options );
153
}
154
155
- $max_members = attribute_escape( $options['max_members'] );
156
- ?>
157
- <p><label for="bp-core-widget-members-max"><?php _e('Max Members to show:', 'buddypress'); ?> <input class="widefat" id="bp-core-widget-members-max" name="bp-core-widget-members-max" type="text" value="<?php echo attribute_escape( $options['max_members'] ); ?>" style="width: 30%" /></label></p>
158
- <input type="hidden" id="bp-core-widget-members-submit" name="bp-core-widget-members-submit" value="1" />
159
- <?php
160
}
161
162
/*** WHO'S ONLINE WIDGET *****************/
163
164
- function bp_core_widget_whos_online($args) {
165
- global $current_blog;
166
-
167
- extract($args);
168
- $options = get_blog_option( $current_blog->blog_id, 'bp_core_widget_whos_online' );
169
- ?>
170
- <?php echo $before_widget; ?>
171
- <?php echo $before_title
172
- . $widget_name
173
- . $after_title; ?>
174
-
175
- <?php
176
- if ( empty( $options['max_members'] ) || !$options['max_members'] )
177
- $options['max_members'] = 5;
178
-
179
- if ( !$users = wp_cache_get( 'online_users', 'bp' ) ) {
180
- $users = BP_Core_User::get_online_users( $options['max_members'] );
181
- wp_cache_set( 'online_users', $users, 'bp' );
182
}
183
- ?>
184
185
- <?php $users = BP_Core_User::get_online_users($options['max_members']) ?>
186
187
- <?php if ( $users['users'] ) : ?>
188
- <div class="avatar-block">
189
- <?php foreach ( (array) $users['users'] as $user ) : ?>
190
- <div class="item-avatar">
191
- <a href="<?php echo bp_core_get_userurl($user->user_id) ?>" title="<?php echo bp_core_get_user_displayname( $user->user_id ) ?>"><?php echo bp_core_get_avatar( $user->user_id, 1 ) ?></a>
192
</div>
193
- <?php endforeach; ?>
194
- </div>
195
196
- <?php
197
- if ( function_exists('wp_nonce_field') )
198
- wp_nonce_field( 'bp_core_widget_members', '_wpnonce-members' );
199
- ?>
200
201
- <input type="hidden" name="bp_core_widget_members_max" id="bp_core_widget_members_max" value="<?php echo attribute_escape( $options['max_members'] ); ?>" />
202
203
- <?php else: ?>
204
- <div class="widget-error">
205
- <?php _e('There are no users currently online.', 'buddypress') ?>
206
- </div>
207
- <?php endif; ?>
208
209
- <?php echo $after_widget; ?>
210
-
211
- <div class="clear" style="margin-bottom: 25px"></div>
212
-
213
- <?php
214
}
215
216
- function bp_core_widget_whos_online_control() {
217
- global $current_blog;
218
-
219
- $options = $newoptions = get_blog_option( $current_blog->blog_id, 'bp_core_widget_whos_online' );
220
221
- if ( $_POST['bp-widget-whos-online-submit'] ) {
222
- $newoptions['max_members'] = strip_tags( stripslashes( $_POST['bp-widget-whos-online-max-members'] ) );
223
}
224
-
225
- if ( $options != $newoptions ) {
226
- $options = $newoptions;
227
- update_blog_option( $current_blog->blog_id, 'bp_core_widget_whos_online', $options );
228
}
229
230
- ?>
231
- <p><label for="bp-widget-whos-online-max-members"><?php _e('Maximum number of members to show:', 'buddypress'); ?><br /><input class="widefat" id="bp-widget-whos-online-max-members" name="bp-widget-whos-online-max-members" type="text" value="<?php echo attribute_escape( $options['max_members'] ); ?>" style="width: 30%" /></label></p>
232
- <input type="hidden" id="bp-widget-whos-online-submit" name="bp-widget-whos-online-submit" value="1" />
233
- <?php
234
}
2
3
/* Register widgets for the core component */
4
function bp_core_register_widgets() {
5
+ add_action('widgets_init', create_function('', 'return register_widget("BP_Core_Welcome_Widget");') );
6
+ add_action('widgets_init', create_function('', 'return register_widget("BP_Core_Members_Widget");') );
7
+ add_action('widgets_init', create_function('', 'return register_widget("BP_Core_Whos_Online_Widget");') );
8
+ add_action('widgets_init', create_function('', 'return register_widget("BP_Core_Recently_Active_Widget");') );
9
}
10
add_action( 'plugins_loaded', 'bp_core_register_widgets' );
11
12
/*** WELCOME WIDGET *****************/
13
14
+ class BP_Core_Welcome_Widget extends WP_Widget {
15
+ function bp_core_welcome_widget() {
16
+ parent::WP_Widget( false, $name = 'Welcome' );
17
+ }
18
+
19
+ function widget($args, $instance) {
20
+ extract( $args );
21
+ ?>
22
+ <?php echo $before_widget; ?>
23
+ <?php echo $before_title
24
+ . $instance['title']
25
+ . $after_title; ?>
26
+
27
+ <?php if ( $instance['title'] ) : ?><h3><?php echo attribute_escape( stripslashes( $instance['title'] ) ) ?></h3><?php endif; ?>
28
+ <?php if ( $instance['text'] ) : ?><p><?php echo apply_filters( 'bp_core_welcome_widget_text', $instance['text'] ) ?></p><?php endif; ?>
29
30
+ <?php if ( !is_user_logged_in() ) { ?>
31
+ <div class="create-account"><div class="visit generic-button"><a href="<?php bp_signup_page() ?>" title="<?php _e('Create Account', 'buddypress') ?>"><?php _e('Create Account', 'buddypress') ?></a></div></div>
32
+ <?php } ?>
33
34
+ <?php echo $after_widget; ?>
35
+ <?php
36
+ }
37
+
38
+ function update( $new_instance, $old_instance ) {
39
+ $instance = $old_instance;
40
+ $instance['title'] = strip_tags( $new_instance['title'] );
41
+ $instance['text'] = strip_tags( wp_filter_post_kses( $new_instance['text'] ) );
42
43
+ return $instance;
44
+ }
45
+
46
+ function form( $instance ) {
47
+ $instance = wp_parse_args( (array) $instance, array( 'title' => '', 'text' => '' ) );
48
+ $title = strip_tags( $instance['title'] );
49
+ $text = strip_tags( $instance['text'] );
50
+ ?>
51
+ <p><label for="bp-widget-welcome-title"><?php _e('Title:', 'buddypress'); ?> <input class="widefat" id="<?php echo $this->get_field_id( 'title' ); ?>" name="<?php echo $this->get_field_name( 'title' ); ?>" type="text" value="<?php echo attribute_escape( stripslashes( $title ) ); ?>" /></label></p>
52
+ <p>
53
+ <label for="bp-widget-welcome-text"><?php _e( 'Welcome Text:' , 'buddypress'); ?>
54
+ <textarea id="<?php echo $this->get_field_id( 'text' ); ?>" name="<?php echo $this->get_field_name( 'text' ); ?>" class="widefat" style="height: 100px"><?php echo attribute_escape( stripslashes( $text ) ); ?></textarea>
55
+ </label>
56
+ </p>
57
+ <?php
58
}
59
}
60
+ add_filter( 'bp_core_welcome_widget_text', 'attribute_escape' );
61
+ add_filter( 'bp_core_welcome_widget_text', 'wptexturize' );
62
+ add_filter( 'bp_core_welcome_widget_text', 'convert_smilies' );
63
+ add_filter( 'bp_core_welcome_widget_text', 'convert_chars' );
64
+ add_filter( 'bp_core_welcome_widget_text', 'stripslashes' );
65
+ add_filter( 'bp_core_welcome_widget_text', 'wpautop' );
66
+ add_filter( 'bp_core_welcome_widget_text', 'force_balance_tags' );
67
+
68
69
/*** MEMBERS WIDGET *****************/
70
71
+ class BP_Core_Members_Widget extends WP_Widget {
72
+ function bp_core_members_widget() {
73
+ parent::WP_Widget( false, $name = 'Members' );
74
+ wp_enqueue_script( 'bp_core_widget_members-js', BP_PLUGIN_URL . '/bp-core/js/widget-members.js', array('jquery', 'jquery-livequery-pack') );
75
+ wp_enqueue_style( 'bp_core_widget_members-css', BP_PLUGIN_URL . '/bp-core/css/widget-members.css' );
76
}
77
78
+ function widget($args, $instance) {
79
+ global $bp;
80
81
+ extract( $args );
82
83
+ echo $before_widget;
84
+ echo $before_title
85
+ . $widget_name
86
+ . $after_title; ?>
87
+
88
+ <?php if ( bp_has_site_members( 'type=newest&max=' . $instance['max_members'] ) ) : ?>
89
+ <div class="item-options" id="members-list-options">
90
+ <img id="ajax-loader-members" src="<?php echo $bp->core->image_base ?>/ajax-loader.gif" height="7" alt="<?php _e( 'Loading', 'buddypress' ) ?>" style="display: none;" />
91
+ <a href="<?php echo site_url() . '/' . BP_MEMBERS_SLUG ?>" id="newest-members" class="selected"><?php _e( 'Newest', 'buddypress' ) ?></a> |
92
+ <a href="<?php echo site_url() . '/' . BP_MEMBERS_SLUG ?>" id="recently-active-members"><?php _e( 'Active', 'buddypress' ) ?></a> |
93
+ <a href="<?php echo site_url() . '/' . BP_MEMBERS_SLUG ?>" id="popular-members"><?php _e( 'Popular', 'buddypress' ) ?></a>
94
+ </div>
95
+
96
+ <ul id="members-list" class="item-list">
97
+ <?php while ( bp_site_members() ) : bp_the_site_member(); ?>
98
+ <li class="vcard">
99
+ <div class="item-avatar">
100
+ <a href="<?php bp_the_site_member_link() ?>"><?php bp_the_site_member_avatar() ?></a>
101
+ </div>
102
+
103
+ <div class="item">
104
+ <div class="item-title fn"><a href="<?php bp_the_site_member_link() ?>" title="<?php bp_the_site_member_name() ?>"><?php bp_the_site_member_name() ?></a></div>
105
+ <div class="item-meta"><span class="activity"><?php echo bp_core_get_last_activity( bp_get_the_site_member_registered(), __( 'registered %s ago', 'buddypress' ) ) ?></span></div>
106
+ </div>
107
+ </li>
108
+
109
+ <?php endwhile; ?>
110
+ </ul>
111
+ <?php wp_nonce_field( 'bp_core_widget_members', '_wpnonce-members' ); ?>
112
+ <input type="hidden" name="members_widget_max" id="members_widget_max" value="<?php echo attribute_escape( $instance['max_members'] ); ?>" />
113
+
114
+ <?php else: ?>
115
116
+ <div class="widget-error">
117
+ <?php _e('No one has signed up yet!', 'buddypress') ?>
118
+ </div>
119
120
+ <?php endif; ?>
121
+
122
+ <?php echo $after_widget; ?>
123
+ <?php
124
}
125
+
126
+ function update( $new_instance, $old_instance ) {
127
+ $instance = $old_instance;
128
+ $instance['max_members'] = strip_tags( $new_instance['max_members'] );
129
+
130
+ return $instance;
131
}
132
133
+ function form( $instance ) {
134
+ $instance = wp_parse_args( (array) $instance, array( 'max_members' => 5 ) );
135
+ $max_members = strip_tags( $instance['max_members'] );
136
+ ?>
137
+
138
+ <p><label for="bp-core-widget-members-max"><?php _e('Max Members to show:', 'buddypress'); ?> <input class="widefat" id="<?php echo $this->get_field_id( 'max_members' ); ?>" name="<?php echo $this->get_field_name( 'max_members' ); ?>" type="text" value="<?php echo attribute_escape( $max_members ); ?>" style="width: 30%" /></label></p>
139
+ <?php
140
+ }
141
}
142
143
/*** WHO'S ONLINE WIDGET *****************/
144
145
+ class BP_Core_Whos_Online_Widget extends WP_Widget {
146
+ function bp_core_whos_online_widget() {
147
+ parent::WP_Widget( false, $name = 'Who\'s Online Avatars' );
148
}
149
150
+ function widget($args, $instance) {
151
+ global $bp;
152
+
153
+ extract( $args );
154
+
155
+ echo $before_widget;
156
+ echo $before_title
157
+ . $widget_name
158
+ . $after_title; ?>
159
+
160
+ <?php if ( bp_has_site_members( 'type=online&per_page=' . $instance['max_members'] . '&max=' . $instance['max_members'] ) ) : ?>
161
+ <div class="avatar-block">
162
+ <?php while ( bp_site_members() ) : bp_the_site_member(); ?>
163
+ <div class="item-avatar">
164
+ <a href="<?php bp_the_site_member_link() ?>" title="<?php bp_the_site_member_name() ?>"><?php bp_the_site_member_avatar() ?></a>
165
+ </div>
166
+ <?php endwhile; ?>
167
+ </div>
168
+ <?php else: ?>
169
170
+ <div class="widget-error">
171
+ <?php _e( 'There are no users currently online', 'buddypress' ) ?>
172
</div>
173
+
174
+ <?php endif; ?>
175
176
+ <?php echo $after_widget; ?>
177
+ <?php
178
+ }
179
180
+ function update( $new_instance, $old_instance ) {
181
+ $instance = $old_instance;
182
+ $instance['max_members'] = strip_tags( $new_instance['max_members'] );
183
184
+ return $instance;
185
+ }
186
187
+ function form( $instance ) {
188
+ $instance = wp_parse_args( (array) $instance, array( 'max_members' => 15 ) );
189
+ $max_members = strip_tags( $instance['max_members'] );
190
+ ?>
191
+
192
+ <p><label for="bp-core-widget-members-max"><?php _e('Max Members to show:', 'buddypress'); ?> <input class="widefat" id="<?php echo $this->get_field_id( 'max_members' ); ?>" name="<?php echo $this->get_field_name( 'max_members' ); ?>" type="text" value="<?php echo attribute_escape( $max_members ); ?>" style="width: 30%" /></label></p>
193
+ <?php
194
+ }
195
}
196
197
+ /*** RECENTLY ACTIVE WIDGET *****************/
198
199
+ class BP_Core_Recently_Active_Widget extends WP_Widget {
200
+ function bp_core_recently_active_widget() {
201
+ parent::WP_Widget( false, $name = 'Recently Active Member Avatars' );
202
}
203
+
204
+ function widget($args, $instance) {
205
+ global $bp;
206
+
207
+ extract( $args );
208
+
209
+ echo $before_widget;
210
+ echo $before_title
211
+ . $widget_name
212
+ . $after_title; ?>
213
+
214
+ <?php if ( bp_has_site_members( 'type=active&per_page=' . $instance['max_members'] . '&max=' . $instance['max_members'] ) ) : ?>
215
+ <div class="avatar-block">
216
+ <?php while ( bp_site_members() ) : bp_the_site_member(); ?>
217
+ <div class="item-avatar">
218
+ <a href="<?php bp_the_site_member_link() ?>" title="<?php bp_the_site_member_name() ?>"><?php bp_the_site_member_avatar() ?></a>
219
+ </div>
220
+ <?php endwhile; ?>
221
+ </div>
222
+ <?php else: ?>
223
+
224
+ <div class="widget-error">
225
+ <?php _e( 'There are no recently active members', 'buddypress' ) ?>
226
+ </div>
227
+
228
+ <?php endif; ?>
229
+
230
+ <?php echo $after_widget; ?>
231
+ <?php
232
}
233
234
+ function update( $new_instance, $old_instance ) {
235
+ $instance = $old_instance;
236
+ $instance['max_members'] = strip_tags( $new_instance['max_members'] );
237
+
238
+ return $instance;
239
+ }
240
+
241
+ function form( $instance ) {
242
+ $instance = wp_parse_args( (array) $instance, array( 'max_members' => 15 ) );
243
+ $max_members = strip_tags( $instance['max_members'] );
244
+ ?>
245
+
246
+ <p><label for="bp-core-widget-members-max"><?php _e('Max Members to show:', 'buddypress'); ?> <input class="widefat" id="<?php echo $this->get_field_id( 'max_members' ); ?>" name="<?php echo $this->get_field_name( 'max_members' ); ?>" type="text" value="<?php echo attribute_escape( $max_members ); ?>" style="width: 30%" /></label></p>
247
+ <?php
248
+ }
249
}
250
+
251
+ ?>
bp-core/css/widget-members.css CHANGED
@@ -1,22 +1,22 @@
1
- .bp_core_widget_members ul#members-list {
2
margin: 15px 0 0 0;
3
padding: 0;
4
list-style: none;
5
}
6
7
- .bp_core_widget_members ul#members-list li {
8
min-height: 60px;
9
}
10
11
- .bp_core_widget_members ul#members-list li img.avatar {
12
float: left;
13
margin: 0 10px 0 0;
14
}
15
16
- .bp_core_widget_members ul#members-list li span.activity {
17
font-size: 11px;
18
}
19
20
- .bp_core_widget_members img#ajax-loader-members {
21
float: right;
22
}
1
+ .widget_bp_core_members_widget ul#members-list {
2
margin: 15px 0 0 0;
3
padding: 0;
4
list-style: none;
5
}
6
7
+ .widget_bp_core_members_widget ul#members-list li {
8
min-height: 60px;
9
}
10
11
+ .widget_bp_core_members_widget ul#members-list li img.avatar {
12
float: left;
13
margin: 0 10px 0 0;
14
}
15
16
+ .widget_bp_core_members_widget ul#members-list li span.activity {
17
font-size: 11px;
18
}
19
20
+ .widget_bp_core_members_widget img#ajax-loader-members {
21
float: right;
22
}
bp-forums/bp-forums-filters.php CHANGED
@@ -27,6 +27,12 @@ add_filter( 'bp_get_the_topic_latest_post_excerpt', 'stripslashes_deep' );
27
28
add_filter( 'bp_get_the_topic_post_content', 'make_clickable' );
29
30
function bp_forums_add_allowed_tags( $allowedtags ) {
31
$allowedtags['p'] = array();
32
$allowedtags['br'] = array();
@@ -35,4 +41,21 @@ function bp_forums_add_allowed_tags( $allowedtags ) {
35
}
36
add_filter( 'edit_allowedtags', 'bp_forums_add_allowed_tags' );
37
38
?>
27
28
add_filter( 'bp_get_the_topic_post_content', 'make_clickable' );
29
30
+ add_filter( 'bp_get_activity_content', 'bp_forums_filter_decode' );
31
+ add_filter( 'bp_forums_new_post_text', 'bp_forums_filter_encode' );
32
+
33
+ add_filter( 'bp_get_the_topic_post_content', 'bp_forums_filter_decode' );
34
+ add_filter( 'bp_get_the_topic_latest_post_excerpt', 'bp_forums_filter_decode' );
35
+
36
function bp_forums_add_allowed_tags( $allowedtags ) {
37
$allowedtags['p'] = array();
38
$allowedtags['br'] = array();
41
}
42
add_filter( 'edit_allowedtags', 'bp_forums_add_allowed_tags' );
43
44
+ function bp_forums_filter_encode( $content ) {
45
+ $content = htmlentities( $content, ENT_COMPAT, "UTF-8" );
46
+ $content = str_replace( '&', '/amp/', $content );
47
+
48
+ return $content;
49
+ }
50
+
51
+ function bp_forums_filter_decode( $content ) {
52
+ $content = str_replace( '/amp/', '&', $content );
53
+ $content = @html_entity_decode( $content, ENT_COMPAT, "UTF-8" );
54
+ $content = str_replace( '[', '<', $content );
55
+ $content = str_replace( ']', '>', $content );
56
+ $content = stripslashes( wp_filter_kses( $content ) );
57
+
58
+ return $content;
59
+ }
60
+
61
?>
bp-groups/bp-groups-filters.php CHANGED
@@ -41,9 +41,9 @@ add_filter( 'bp_get_group_news', 'wp_filter_kses', 1 );
41
add_filter( 'bp_get_the_site_group_name', 'wp_filter_kses', 1 );
42
add_filter( 'bp_get_the_site_group_description', 'wp_filter_kses', 1 );
43
add_filter( 'bp_get_the_site_group_description_excerpt', 'wp_filter_kses', 1 );
44
- add_filter( 'groups_details_name_pre_save', 'wp_filter_kses', 1 );
45
- add_filter( 'groups_details_description_pre_save', 'wp_filter_kses', 1 );
46
- add_filter( 'groups_details_news_pre_save', 'wp_filter_kses', 1 );
47
48
add_filter( 'bp_get_group_description', 'stripslashes' );
49
add_filter( 'bp_get_group_description_excerpt', 'stripslashes' );
@@ -52,4 +52,8 @@ add_filter( 'bp_get_group_name', 'stripslashes' );
52
53
add_filter( 'groups_new_group_forum_desc', 'bp_create_excerpt' );
54
55
?>
41
add_filter( 'bp_get_the_site_group_name', 'wp_filter_kses', 1 );
42
add_filter( 'bp_get_the_site_group_description', 'wp_filter_kses', 1 );
43
add_filter( 'bp_get_the_site_group_description_excerpt', 'wp_filter_kses', 1 );
44
+ add_filter( 'groups_group_name_before_save', 'wp_filter_kses', 1 );
45
+ add_filter( 'groups_group_description_before_save', 'wp_filter_kses', 1 );
46
+ add_filter( 'groups_group_news_before_save', 'wp_filter_kses', 1 );
47
48
add_filter( 'bp_get_group_description', 'stripslashes' );
49
add_filter( 'bp_get_group_description_excerpt', 'stripslashes' );
52
53
add_filter( 'groups_new_group_forum_desc', 'bp_create_excerpt' );
54
55
+ add_filter( 'groups_group_name_before_save', 'force_balance_tags' );
56
+ add_filter( 'groups_group_description_before_save', 'force_balance_tags' );
57
+ add_filter( 'groups_group_news_before_save', 'force_balance_tags' );
58
+
59
?>
bp-groups/bp-groups-widgets.php CHANGED
@@ -2,114 +2,82 @@
2
3
/* Register widgets for groups component */
4
function groups_register_widgets() {
5
- global $current_blog;
6
-
7
- /* Site welcome widget */
8
- wp_register_sidebar_widget( 'buddypress-groups', __( 'Groups', 'buddypress' ), 'groups_widget_groups_list' );
9
- wp_register_widget_control( 'buddypress-groups', __( 'Groups', 'buddypress' ), 'groups_widget_groups_list_control' );
10
-
11
- /* Include the javascript needed for activated widgets only */
12
- if ( is_active_widget( 'groups_widget_groups_list' ) ) {
13
- wp_enqueue_script( 'groups_widget_groups_list-js', BP_PLUGIN_URL . '/bp-groups/js/widget-groups.js', array('jquery', 'jquery-livequery-pack') );
14
- wp_enqueue_style( 'groups_widget_members-css', BP_PLUGIN_URL . '/bp-groups/css/widget-groups.css' );
15
- }
16
}
17
add_action( 'plugins_loaded', 'groups_register_widgets' );
18
19
20
/*** GROUPS WIDGET *****************/
21
22
- function groups_widget_groups_list($args) {
23
- global $current_blog, $bp;
24
-
25
- extract($args);
26
- $options = get_blog_option( $current_blog->blog_id, 'groups_widget_groups_list' );
27
- ?>
28
- <?php echo $before_widget; ?>
29
- <?php echo $before_title
30
- . $widget_name
31
- . $after_title; ?>
32
-
33
- <?php
34
- if ( empty( $options['max_groups'] ) || !$options['max_groups'] )
35
- $options['max_groups'] = 5;
36
-
37
- if ( !$groups = wp_cache_get( 'popular_groups', 'bp' ) ) {
38
- $groups = groups_get_popular( $options['max_groups'], 1 );
39
- wp_cache_set( 'popular_groups', $groups, 'bp' );
40
}
41
- ?>
42
-
43
- <?php if ( $groups['groups'] ) : ?>
44
- <div class="item-options" id="groups-list-options">
45
- <img id="ajax-loader-groups" src="<?php echo $bp->groups->image_base ?>/ajax-loader.gif" height="7" alt="<?php _e( 'Loading', 'buddypress' ) ?>" style="display: none;" />
46
- <a href="<?php echo site_url() . '/' . $bp->groups->slug ?>" id="newest-groups"><?php _e("Newest", 'buddypress') ?></a> |
47
- <a href="<?php echo site_url() . '/' . $bp->groups->slug ?>" id="recently-active-groups"><?php _e("Active", 'buddypress') ?></a> |
48
- <a href="<?php echo site_url() . '/' . $bp->groups->slug ?>" id="popular-groups" class="selected"><?php _e("Popular", 'buddypress') ?></a>
49
- </div>
50
- <ul id="groups-list" class="item-list">
51
- <?php foreach ( $groups['groups'] as $group_id ) : ?>
52
- <?php
53
- if ( !$group = wp_cache_get( 'groups_group_nouserdata_' . $group_id->group_id, 'bp' ) ) {
54
- $group = new BP_Groups_Group( $group_id->group_id, false, false );
55
- wp_cache_set( 'groups_group_nouserdata_' . $group_id->group_id, $group, 'bp' );
56
- }
57
- ?>
58
- <li>
59
- <div class="item-avatar">
60
- <a href="<?php echo bp_get_group_permalink( $group ) ?>" title="<?php echo bp_get_group_name( $group ) ?>"><?php echo bp_get_group_avatar_thumb( $group ); ?></a>
61
- </div>
62
63
- <div class="item">
64
- <div class="item-title"><a href="<?php echo bp_get_group_permalink( $group ) ?>" title="<?php echo bp_get_group_name( $group ) ?>"><?php echo bp_get_group_name( $group ) ?></a></div>
65
- <div class="item-meta">
66
- <span class="activity">
67
- <?php
68
- if ( 1 == $group->total_member_count )
69
- echo $group->total_member_count . __(' member', 'buddypress');
70
- else
71
- echo $group->total_member_count . __(' members', 'buddypress');
72
- ?>
73
- </span></div>
74
- </div>
75
- </li>
76
- <?php $counter++; ?>
77
- <?php endforeach; ?>
78
- </ul>
79
80
- <?php
81
- if ( function_exists('wp_nonce_field') )
82
- wp_nonce_field( 'groups_widget_groups_list', '_wpnonce-groups' );
83
- ?>
84
85
- <input type="hidden" name="groups_widget_max" id="groups_widget_max" value="<?php echo attribute_escape( $options['max_groups'] ); ?>" />
86
87
- <?php else: ?>
88
- <div class="widget-error">
89
- <?php _e('There are no groups to display.', 'buddypress') ?>
90
- </div>
91
- <?php endif; ?>
92
-
93
- <?php echo $after_widget; ?>
94
- <?php
95
- }
96
97
- function groups_widget_groups_list_control() {
98
- global $current_blog;
99
-
100
- $options = $newoptions = get_blog_option( $current_blog->blog_id, 'groups_widget_groups_list');
101
102
- if ( $_POST['groups-widget-groups-list-submit'] ) {
103
- $newoptions['max_groups'] = strip_tags( stripslashes( $_POST['groups-widget-groups-list-max'] ) );
104
}
105
-
106
- if ( $options != $newoptions ) {
107
- $options = $newoptions;
108
- update_blog_option( $current_blog->blog_id, 'groups_widget_groups_list', $options );
109
}
110
111
- ?>
112
- <p><label for="groups-widget-groups-list-max"><?php _e('Maximum number of groups to show:', 'buddypress'); ?><br /> <input class="widefat" id="groups-widget-groups-list-max" name="groups-widget-groups-list-max" type="text" value="<?php echo attribute_escape( $options['max_groups'] ); ?>" style="width: 30%" /></label></p>
113
- <input type="hidden" id="groups-widget-groups-list-submit" name="groups-widget-groups-list-submit" value="1" />
114
- <?php
115
}
2
3
/* Register widgets for groups component */
4
function groups_register_widgets() {
5
+ add_action('widgets_init', create_function('', 'return register_widget("BP_Groups_Widget");') );
6
}
7
add_action( 'plugins_loaded', 'groups_register_widgets' );
8
9
10
/*** GROUPS WIDGET *****************/
11
12
+ class BP_Groups_Widget extends WP_Widget {
13
+ function bp_groups_widget() {
14
+ parent::WP_Widget( false, $name = 'Groups' );
15
+ wp_enqueue_script( 'groups_widget_groups_list-js', BP_PLUGIN_URL . '/bp-groups/js/widget-groups.js', array('jquery', 'jquery-livequery-pack') );
16
+ wp_enqueue_style( 'groups_widget_members-css', BP_PLUGIN_URL . '/bp-groups/css/widget-groups.css' );
17
}
18
19
+ function widget($args, $instance) {
20
+ global $bp;
21
22
+ extract( $args );
23
24
+ echo $before_widget;
25
+ echo $before_title
26
+ . $widget_name
27
+ . $after_title; ?>
28
29
+ <?php if ( bp_has_site_groups( 'type=popular&max=' . $instance['max_groups'] ) ) : ?>
30
+ <div class="item-options" id="groups-list-options">
31
+ <img id="ajax-loader-groups" src="<?php echo $bp->groups->image_base ?>/ajax-loader.gif" height="7" alt="<?php _e( 'Loading', 'buddypress' ) ?>" style="display: none;" />
32
+ <a href="<?php echo site_url() . '/' . $bp->groups->slug ?>" id="newest-groups"><?php _e("Newest", 'buddypress') ?></a> |
33
+ <a href="<?php echo site_url() . '/' . $bp->groups->slug ?>" id="recently-active-groups"><?php _e("Active", 'buddypress') ?></a> |
34
+ <a href="<?php echo site_url() . '/' . $bp->groups->slug ?>" id="popular-groups" class="selected"><?php _e("Popular", 'buddypress') ?></a>
35
+ </div>
36
+
37
+ <ul id="groups-list" class="item-list">
38
+ <?php while ( bp_site_groups() ) : bp_the_site_group(); ?>
39
+ <li>
40
+ <div class="item-avatar">
41
+ <a href="<?php bp_the_site_group_link() ?>"><?php bp_the_site_group_avatar_thumb() ?></a>
42
+ </div>
43
+
44
+ <div class="item">
45
+ <div class="item-title"><a href="<?php bp_the_site_group_link() ?>" title="<?php bp_the_site_group_name() ?>"><?php bp_the_site_group_name() ?></a></div>
46
+ <div class="item-meta"><span class="activity"><?php bp_the_site_group_member_count() ?></span></div>
47
+ </div>
48
+ </li>
49
+
50
+ <?php endwhile; ?>
51
+ </ul>
52
+ <?php wp_nonce_field( 'groups_widget_groups_list', '_wpnonce-groups' ); ?>
53
+ <input type="hidden" name="groups_widget_max" id="groups_widget_max" value="<?php echo attribute_escape( $instance['max_groups'] ); ?>" />
54
+
55
+ <?php else: ?>
56
57
+ <div class="widget-error">
58
+ <?php _e('There are no groups to display.', 'buddypress') ?>
59
+ </div>
60
61
+ <?php endif; ?>
62
+
63
+ <?php echo $after_widget; ?>
64
+ <?php
65
}
66
+
67
+ function update( $new_instance, $old_instance ) {
68
+ $instance = $old_instance;
69
+ $instance['max_groups'] = strip_tags( $new_instance['max_groups'] );
70
+
71
+ return $instance;
72
}
73
74
+ function form( $instance ) {
75
+ $instance = wp_parse_args( (array) $instance, array( 'max_groups' => 5 ) );
76
+ $max_groups = strip_tags( $instance['max_groups'] );
77
+ ?>
78
+
79
+ <p><label for="bp-groups-widget-groups-max"><?php _e('Max groups to show:', 'buddypress'); ?> <input class="widefat" id="<?php echo $this->get_field_id( 'max_groups' ); ?>" name="<?php echo $this->get_field_name( 'max_groups' ); ?>" type="text" value="<?php echo attribute_escape( $max_groups ); ?>" style="width: 30%" /></label></p>
80
+ <?php
81
+ }
82
}
83
+ ?>
bp-groups/css/widget-groups.css CHANGED
@@ -1,22 +1,21 @@
1
- .groups_widget_groups_list ul#groups-list {
2
margin: 15px 0 0 0;
3
padding: 0;
4
list-style: none;
5
}
6
-
7
- .groups_widget_groups_list ul#groups-list li {
8
min-height: 60px;
9
}
10
11
- .groups_widget_groups_list ul#groups-list li img.avatar {
12
float: left;
13
margin: 0 10px 0 0;
14
}
15
16
- .groups_widget_groups_list ul#groups-list li span.activity {
17
font-size: 11px;
18
}
19
20
- .groups_widget_groups_list img#ajax-loader-groups {
21
float: right;
22
}
1
+ .widget_bp_groups_widget ul#groups-list {
2
margin: 15px 0 0 0;
3
padding: 0;
4
list-style: none;
5
}
6
+ .widget_bp_groups_widget ul#groups-list li {
7
min-height: 60px;
8
}
9
10
+ .widget_bp_groups_widget ul#groups-list li img.avatar {
11
float: left;
12
margin: 0 10px 0 0;
13
}
14
15
+ .widget_bp_groups_widget ul#groups-list li span.activity {
16
font-size: 11px;
17
}
18
19
+ .widget_bp_groups_widget img#ajax-loader-groups {
20
float: right;
21
}
bp-loader.php CHANGED
@@ -4,12 +4,12 @@ Plugin Name: BuddyPress
4
Plugin URI: http://buddypress.org/download/
5
Description: BuddyPress will add social networking features to a new or existing WordPress MU installation.
6
Author: The BuddyPress Community
7
- Version: 1.0.2
8
Author URI: http://buddypress.org/developers/
9
Site Wide Only: true
10
*/
11
12
- define( 'BP_VERSION', '1.0.2' );
13
14
/***
15
* This file will load in each BuddyPress component based on which
4
Plugin URI: http://buddypress.org/download/
5
Description: BuddyPress will add social networking features to a new or existing WordPress MU installation.
6
Author: The BuddyPress Community
7
+ Version: 1.0.3
8
Author URI: http://buddypress.org/developers/
9
Site Wide Only: true
10
*/
11
12
+ define( 'BP_VERSION', '1.0.3' );
13
14
/***
15
* This file will load in each BuddyPress component based on which
bp-messages/bp-messages-filters.php CHANGED
@@ -13,6 +13,11 @@ add_filter( 'messages_message_subject_before_save', 'wp_filter_kses', 1 );
13
add_filter( 'messages_notice_message_before_save', 'wp_filter_kses', 1 );
14
add_filter( 'messages_notice_subject_before_save', 'wp_filter_kses', 1 );
15
16
add_filter( 'bp_get_message_notice_subject', 'wptexturize' );
17
add_filter( 'bp_get_message_notice_text', 'wptexturize' );
18
add_filter( 'bp_get_message_thread_subject', 'wptexturize' );
13
add_filter( 'messages_notice_message_before_save', 'wp_filter_kses', 1 );
14
add_filter( 'messages_notice_subject_before_save', 'wp_filter_kses', 1 );
15
16
+ add_filter( 'messages_message_content_before_save', 'force_balance_tags' );
17
+ add_filter( 'messages_message_subject_before_save', 'force_balance_tags' );
18
+ add_filter( 'messages_notice_message_before_save', 'force_balance_tags' );
19
+ add_filter( 'messages_notice_subject_before_save', 'force_balance_tags' );
20
+
21
add_filter( 'bp_get_message_notice_subject', 'wptexturize' );
22
add_filter( 'bp_get_message_notice_text', 'wptexturize' );
23
add_filter( 'bp_get_message_thread_subject', 'wptexturize' );
bp-themes/bphome/css/base.css CHANGED
@@ -155,7 +155,7 @@ h2.widgettitle {
155
margin-right: 4px;
156
}
157
158
- .bp_core_widget_welcome h2 {
159
background: url(../images/welcome_header_back.gif) top left no-repeat !important;
160
color: #fff !important;
161
}
@@ -179,7 +179,7 @@ h2.widgettitle {
179
margin: 0 0 7px 0;
180
}
181
182
- .bp_blogs_widget_recent_posts img.avatar {
183
width: 50px !important;
184
height: 50px !important;
185
}
@@ -187,8 +187,8 @@ h2.widgettitle {
187
.widget ul.item-list li .item {
188
margin-left: 71px;
189
}
190
- .bp_blogs_widget_recent_posts ul.item-list li .item {
191
- margin-left: 31px;
192
}
193
194
.widget ul.item-list li .item-meta {
@@ -202,7 +202,7 @@ h2.widgettitle {
202
margin: -15px 0 0 0;
203
}
204
205
- .bp_core_widget_whos_online .item-avatar {
206
float: left;
207
margin-right: 10px;
208
}
155
margin-right: 4px;
156
}
157
158
+ .widget_bp_core_welcome_widget h2 {
159
background: url(../images/welcome_header_back.gif) top left no-repeat !important;
160
color: #fff !important;
161
}
179
margin: 0 0 7px 0;
180
}
181
182
+ .widget_bp_blogs_widget_recent_posts img.avatar {
183
width: 50px !important;
184
height: 50px !important;
185
}
187
.widget ul.item-list li .item {
188
margin-left: 71px;
189
}
190
+ .widget_bp_blogs_recent_posts_widget ul.item-list li .item {
191
+ margin-left: 31px !important;
192
}
193
194
.widget ul.item-list li .item-meta {
202
margin: -15px 0 0 0;
203
}
204
205
+ .widget_bp_core_widget_whos_online .item-avatar {
206
float: left;
207
margin-right: 10px;
208
}
bp-themes/bphome/style.css CHANGED
@@ -2,7 +2,7 @@
2
Theme Name: BuddyPress Default Home Theme
3
Theme URI: http://buddypress.com/
4
Description: A widget framework theme for the home of a BuddyPress enabled installation. This theme is not required to use BuddyPress.
5
- Version: 1.0.2
6
Author: Andy Peatling
7
Author URI: http://apeatling.wordpress.com
8
*/
2
Theme Name: BuddyPress Default Home Theme
3
Theme URI: http://buddypress.com/
4
Description: A widget framework theme for the home of a BuddyPress enabled installation. This theme is not required to use BuddyPress.
5
+ Version: 1.0.3
6
Author: Andy Peatling
7
Author URI: http://apeatling.wordpress.com
8
*/
bp-themes/bpmember/style.css CHANGED
@@ -2,7 +2,7 @@
2
Theme Name: BuddyPress Default Member Theme
3
Theme URI: http://buddypress.org
4
Description: The default member theme for BuddyPress. This theme handles all non-blog pages.
5
- Version: 1.0.2
6
Author: Andy Peatling
7
Author URI: http://apeatling.wordpress.com
8
*/
2
Theme Name: BuddyPress Default Member Theme
3
Theme URI: http://buddypress.org
4
Description: The default member theme for BuddyPress. This theme handles all non-blog pages.
5
+ Version: 1.0.3
6
Author: Andy Peatling
7
Author URI: http://apeatling.wordpress.com
8
*/
bp-wire/bp-wire-filters.php CHANGED
@@ -2,18 +2,14 @@
2
3
/* Apply WordPress defined filters */
4
add_filter( 'bp_get_wire_post_content', 'wp_filter_kses', 1 );
5
- add_filter( 'bp_wire_post_content_before_save', 'wp_filter_kses', 1 );
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
?>
2
3
/* Apply WordPress defined filters */
4
add_filter( 'bp_get_wire_post_content', 'wp_filter_kses', 1 );
5
add_filter( 'bp_get_wire_post_content', 'wptexturize' );
6
add_filter( 'bp_get_wire_post_content', 'convert_smilies', 2 );
7
add_filter( 'bp_get_wire_post_content', 'convert_chars' );
8
add_filter( 'bp_get_wire_post_content', 'wpautop' );
9
add_filter( 'bp_get_wire_post_content', 'stripslashes_deep' );
10
add_filter( 'bp_get_wire_post_content', 'make_clickable' );
11
12
+ add_filter( 'bp_wire_post_content_before_save', 'wp_filter_kses', 1 );
13
+ add_filter( 'bp_wire_post_content_before_save', 'force_balance_tags' );
14
+
15
?>
bp-xprofile/bp-xprofile-filters.php CHANGED
@@ -6,6 +6,9 @@ add_filter( 'xprofile_get_field_data', 'wp_filter_kses', 1 );
6
add_filter( 'xprofile_field_name_before_save', 'wp_filter_kses', 1 );
7
add_filter( 'xprofile_field_description_before_save', 'wp_filter_kses', 1 );
8
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' );
6
add_filter( 'xprofile_field_name_before_save', 'wp_filter_kses', 1 );
7
add_filter( 'xprofile_field_description_before_save', 'wp_filter_kses', 1 );
8
9
+ add_filter( 'xprofile_field_name_before_save', 'force_balance_tags' );
10
+ add_filter( 'xprofile_field_description_before_save', 'force_balance_tags' );
11
+
12
add_filter( 'bp_get_the_profile_field_value', 'wptexturize' );
13
add_filter( 'bp_get_the_profile_field_value', 'convert_smilies', 2 );
14
add_filter( 'bp_get_the_profile_field_value', 'convert_chars' );
bp-xprofile/bp-xprofile-templatetags.php CHANGED
@@ -111,18 +111,23 @@ Class BP_XProfile_Template {
111
112
function has_fields() {
113
$has_data = false;
114
-
115
- if ( count($this->group->fields) > 0 ) {
116
- for ( $i = 0; $i < count($this->group->fields); $i++ ) {
117
- $field = $this->group->fields[$i];
118
-
119
- if ( $field->data->value != null ) {
120
- $has_data = true;
121
- }
122
}
123
}
124
125
- if($has_data)
126
return true;
127
128
return false;
@@ -143,6 +148,11 @@ Class BP_XProfile_Template {
143
global $field;
144
145
$field = $this->next_field();
146
$this->is_public = $field->is_public;
147
if ( $field->data->value != '' ) {
148
$this->field_has_data = true;
111
112
function has_fields() {
113
$has_data = false;
114
+ $just_name = true;
115
+
116
+ for ( $i = 0; $i < count( $this->group->fields ); $i++ ) {
117
+ $field = &$this->group->fields[$i];
118
+
119
+ if ( $field->data->value != null ) {
120
+ $has_data = true;
121
+
122
+ if ( 1 != $field->id )
123
+ $just_name = false;
124
}
125
}
126
+
127
+ if ( 1 == $this->group->id && $just_name )
128
+ return false;
129
130
+ if ( $has_data )
131
return true;
132
133
return false;
148
global $field;
149
150
$field = $this->next_field();
151
+
152
+ /* Skip the name field */
153
+ if ( 1 == $field->id )
154
+ $field = $this->next_field();
155
+
156
$this->is_public = $field->is_public;
157
if ( $field->data->value != '' ) {
158
$this->field_has_data = true;
readme.txt CHANGED
@@ -1,9 +1,9 @@
1
=== Plugin Name ===
2
Contributors: apeatling
3
Tags: wpmu, buddypress, social, networking, profiles, messaging, friends, groups, forums, activity
4
- Requires at least: 2.7.1
5
- Tested up to: 2.7.1
6
- Stable tag: 1.0.2
7
8
BuddyPress is a suite of WordPress MU social networking plugins and themes.
9
1
=== Plugin Name ===
2
Contributors: apeatling
3
Tags: wpmu, buddypress, social, networking, profiles, messaging, friends, groups, forums, activity
4
+ Requires at least: WordPress MU 2.8.1
5
+ Tested up to: 2.8.1
6
+ Stable tag: 1.0.3
7
8
BuddyPress is a suite of WordPress MU social networking plugins and themes.
9