Version Description
Compatibility with WordPress 3.5
Download this release
Release Info
Developer | johnjamesjacoby |
Plugin | BuddyPress |
Version | 1.6.2 |
Comparing to | |
See all releases |
Code changes from version 1.6.1 to 1.6.2
- bp-activity/bp-activity-classes.php +20 -18
- bp-activity/bp-activity-functions.php +2 -2
- bp-blogs/bp-blogs-classes.php +7 -7
- bp-blogs/bp-blogs-functions.php +1 -1
- bp-core/admin/bp-core-functions.php +1 -1
- bp-core/admin/css/wizard.dev.css +1 -0
- bp-core/bp-core-avatars.php +28 -10
- bp-core/bp-core-cache.php +1 -1
- bp-core/bp-core-catchuri.php +3 -0
- bp-core/bp-core-classes.php +7 -7
- bp-core/bp-core-cssjs.php +8 -6
- bp-core/bp-core-filters.php +1 -1
- bp-core/bp-core-functions.php +1 -1
- bp-core/bp-core-options.php +1 -1
- bp-core/bp-core-widgets.php +1 -0
- bp-core/deprecated/1.5.php +14 -0
- bp-forums/bp-forums-filters.php +3 -5
- bp-forums/bp-forums-functions.php +5 -5
- bp-friends/bp-friends-classes.php +12 -12
- bp-groups/bp-groups-classes.php +16 -16
- bp-groups/bp-groups-functions.php +8 -8
- bp-groups/bp-groups-loader.php +3 -3
- bp-groups/bp-groups-widgets.php +1 -0
- bp-languages/buddypress.pot +58 -58
- bp-loader.php +2 -4
- bp-members/bp-members-functions.php +60 -10
- bp-members/bp-members-template.php +3 -2
- bp-messages/bp-messages-classes.php +9 -9
- bp-messages/js/autocomplete/license.bgiframe.txt +19 -19
- bp-settings/bp-settings-actions.php +11 -17
- bp-themes/bp-default/blogs/create.php +1 -2
- bp-themes/bp-default/groups/index.php +1 -2
- bp-themes/bp-default/groups/single/forum.php +1 -2
- bp-themes/bp-default/license.txt +280 -280
- bp-themes/bp-default/readme.txt +21 -21
- bp-themes/bp-default/rtl.css +2 -2
- bp-themes/bp-default/style.css +2 -2
- bp-xprofile/bp-xprofile-classes.php +7 -7
- bp-xprofile/bp-xprofile-functions.php +8 -8
- readme.txt +4 -1
bp-activity/bp-activity-classes.php
CHANGED
@@ -56,7 +56,7 @@ class BP_Activity_Activity {
|
|
56 |
}
|
57 |
|
58 |
function save() {
|
59 |
-
global $wpdb, $bp
|
60 |
|
61 |
$this->id = apply_filters_ref_array( 'bp_activity_id_before_save', array( $this->id, &$this ) );
|
62 |
$this->item_id = apply_filters_ref_array( 'bp_activity_item_id_before_save', array( $this->item_id, &$this ) );
|
@@ -83,21 +83,23 @@ class BP_Activity_Activity {
|
|
83 |
$this->primary_link = bp_loggedin_user_domain();
|
84 |
|
85 |
// If we have an existing ID, update the activity item, otherwise insert it.
|
86 |
-
if ( $this->id )
|
87 |
-
$q = $wpdb->prepare( "UPDATE {$bp->activity->table_name} SET user_id = %d, component = %s, type = %s, action = %s, content = %s, primary_link = %s, date_recorded = %s, item_id = %
|
88 |
-
else
|
89 |
-
$q = $wpdb->prepare( "INSERT INTO {$bp->activity->table_name} ( user_id, component, type, action, content, primary_link, date_recorded, item_id, secondary_item_id, hide_sitewide, is_spam ) VALUES ( %d, %s, %s, %s, %s, %s, %s, %
|
|
|
90 |
|
91 |
if ( false === $wpdb->query( $q ) )
|
92 |
return false;
|
93 |
|
94 |
// If this is a new activity item, set the $id property
|
95 |
-
if ( empty( $this->id ) )
|
96 |
$this->id = $wpdb->insert_id;
|
97 |
|
98 |
// If an existing activity item, prevent any changes to the content generating new @mention notifications.
|
99 |
-
else
|
100 |
add_filter( 'bp_activity_at_name_do_notifications', '__return_false' );
|
|
|
101 |
|
102 |
do_action_ref_array( 'bp_activity_after_save', array( &$this ) );
|
103 |
|
@@ -216,7 +218,7 @@ class BP_Activity_Activity {
|
|
216 |
}
|
217 |
|
218 |
if ( !empty( $the_index ) ) {
|
219 |
-
$index_hint_sql =
|
220 |
} else {
|
221 |
$index_hint_sql = '';
|
222 |
}
|
@@ -228,12 +230,12 @@ class BP_Activity_Activity {
|
|
228 |
$per_page = absint( $per_page );
|
229 |
|
230 |
$pag_sql = $wpdb->prepare( "LIMIT %d, %d", absint( ( $page - 1 ) * $per_page ), $per_page );
|
231 |
-
$activities = $wpdb->get_results( apply_filters( 'bp_activity_get_user_join_filter',
|
232 |
} else {
|
233 |
-
$activities = $wpdb->get_results( apply_filters( 'bp_activity_get_user_join_filter',
|
234 |
}
|
235 |
|
236 |
-
$total_activities_sql = apply_filters( 'bp_activity_total_activities_sql',
|
237 |
|
238 |
$total_activities = $wpdb->get_var( $total_activities_sql );
|
239 |
|
@@ -247,7 +249,7 @@ class BP_Activity_Activity {
|
|
247 |
|
248 |
$activity_user_ids = implode( ',', array_unique( (array) $activity_user_ids ) );
|
249 |
if ( !empty( $activity_user_ids ) ) {
|
250 |
-
if ( $names = $wpdb->get_results(
|
251 |
foreach ( (array) $names as $name )
|
252 |
$tmp_names[$name->user_id] = $name->user_fullname;
|
253 |
|
@@ -401,9 +403,9 @@ class BP_Activity_Activity {
|
|
401 |
return false;
|
402 |
|
403 |
// Fetch the activity IDs so we can delete any comments for this activity item
|
404 |
-
$activity_ids = $wpdb->get_col(
|
405 |
|
406 |
-
if ( !$wpdb->query(
|
407 |
return false;
|
408 |
|
409 |
if ( $activity_ids ) {
|
@@ -424,7 +426,7 @@ class BP_Activity_Activity {
|
|
424 |
else
|
425 |
$activity_ids = implode ( ',', array_map( 'absint', explode ( ',', $activity_ids ) ) );
|
426 |
|
427 |
-
return $wpdb->query(
|
428 |
}
|
429 |
|
430 |
function delete_activity_meta_entries( $activity_ids ) {
|
@@ -435,7 +437,7 @@ class BP_Activity_Activity {
|
|
435 |
else
|
436 |
$activity_ids = implode ( ',', array_map( 'absint', explode ( ',', $activity_ids ) ) );
|
437 |
|
438 |
-
return $wpdb->query(
|
439 |
}
|
440 |
|
441 |
/**
|
@@ -560,7 +562,7 @@ class BP_Activity_Activity {
|
|
560 |
function get_recorded_components() {
|
561 |
global $wpdb, $bp;
|
562 |
|
563 |
-
return $wpdb->get_col(
|
564 |
}
|
565 |
|
566 |
function get_sitewide_items_for_feed( $limit = 35 ) {
|
@@ -647,7 +649,7 @@ class BP_Activity_Activity {
|
|
647 |
function get_last_updated() {
|
648 |
global $bp, $wpdb;
|
649 |
|
650 |
-
return $wpdb->get_var(
|
651 |
}
|
652 |
|
653 |
function total_favorite_count( $user_id ) {
|
56 |
}
|
57 |
|
58 |
function save() {
|
59 |
+
global $wpdb, $bp;
|
60 |
|
61 |
$this->id = apply_filters_ref_array( 'bp_activity_id_before_save', array( $this->id, &$this ) );
|
62 |
$this->item_id = apply_filters_ref_array( 'bp_activity_item_id_before_save', array( $this->item_id, &$this ) );
|
83 |
$this->primary_link = bp_loggedin_user_domain();
|
84 |
|
85 |
// If we have an existing ID, update the activity item, otherwise insert it.
|
86 |
+
if ( $this->id ) {
|
87 |
+
$q = $wpdb->prepare( "UPDATE {$bp->activity->table_name} SET user_id = %d, component = %s, type = %s, action = %s, content = %s, primary_link = %s, date_recorded = %s, item_id = %d, secondary_item_id = %d, hide_sitewide = %d, is_spam = %d WHERE id = %d", $this->user_id, $this->component, $this->type, $this->action, $this->content, $this->primary_link, $this->date_recorded, $this->item_id, $this->secondary_item_id, $this->hide_sitewide, $this->is_spam, $this->id );
|
88 |
+
} else {
|
89 |
+
$q = $wpdb->prepare( "INSERT INTO {$bp->activity->table_name} ( user_id, component, type, action, content, primary_link, date_recorded, item_id, secondary_item_id, hide_sitewide, is_spam ) VALUES ( %d, %s, %s, %s, %s, %s, %s, %d, %d, %d, %d )", $this->user_id, $this->component, $this->type, $this->action, $this->content, $this->primary_link, $this->date_recorded, $this->item_id, $this->secondary_item_id, $this->hide_sitewide, $this->is_spam );
|
90 |
+
}
|
91 |
|
92 |
if ( false === $wpdb->query( $q ) )
|
93 |
return false;
|
94 |
|
95 |
// If this is a new activity item, set the $id property
|
96 |
+
if ( empty( $this->id ) ) {
|
97 |
$this->id = $wpdb->insert_id;
|
98 |
|
99 |
// If an existing activity item, prevent any changes to the content generating new @mention notifications.
|
100 |
+
} else {
|
101 |
add_filter( 'bp_activity_at_name_do_notifications', '__return_false' );
|
102 |
+
}
|
103 |
|
104 |
do_action_ref_array( 'bp_activity_after_save', array( &$this ) );
|
105 |
|
218 |
}
|
219 |
|
220 |
if ( !empty( $the_index ) ) {
|
221 |
+
$index_hint_sql = "USE INDEX ({$the_index})";
|
222 |
} else {
|
223 |
$index_hint_sql = '';
|
224 |
}
|
230 |
$per_page = absint( $per_page );
|
231 |
|
232 |
$pag_sql = $wpdb->prepare( "LIMIT %d, %d", absint( ( $page - 1 ) * $per_page ), $per_page );
|
233 |
+
$activities = $wpdb->get_results( apply_filters( 'bp_activity_get_user_join_filter', "{$select_sql} {$from_sql} {$where_sql} ORDER BY a.date_recorded {$sort} {$pag_sql}", $select_sql, $from_sql, $where_sql, $sort, $pag_sql ) );
|
234 |
} else {
|
235 |
+
$activities = $wpdb->get_results( apply_filters( 'bp_activity_get_user_join_filter', "{$select_sql} {$from_sql} {$where_sql} ORDER BY a.date_recorded {$sort}", $select_sql, $from_sql, $where_sql, $sort ) );
|
236 |
}
|
237 |
|
238 |
+
$total_activities_sql = apply_filters( 'bp_activity_total_activities_sql', "SELECT count(a.id) FROM {$bp->activity->table_name} a {$index_hint_sql} {$where_sql} ORDER BY a.date_recorded {$sort}", $where_sql, $sort );
|
239 |
|
240 |
$total_activities = $wpdb->get_var( $total_activities_sql );
|
241 |
|
249 |
|
250 |
$activity_user_ids = implode( ',', array_unique( (array) $activity_user_ids ) );
|
251 |
if ( !empty( $activity_user_ids ) ) {
|
252 |
+
if ( $names = $wpdb->get_results( "SELECT user_id, value AS user_fullname FROM {$bp->profile->table_name_data} WHERE field_id = 1 AND user_id IN ({$activity_user_ids})" ) ) {
|
253 |
foreach ( (array) $names as $name )
|
254 |
$tmp_names[$name->user_id] = $name->user_fullname;
|
255 |
|
403 |
return false;
|
404 |
|
405 |
// Fetch the activity IDs so we can delete any comments for this activity item
|
406 |
+
$activity_ids = $wpdb->get_col( "SELECT id FROM {$bp->activity->table_name} {$where_sql}" );
|
407 |
|
408 |
+
if ( !$wpdb->query( "DELETE FROM {$bp->activity->table_name} {$where_sql}" ) )
|
409 |
return false;
|
410 |
|
411 |
if ( $activity_ids ) {
|
426 |
else
|
427 |
$activity_ids = implode ( ',', array_map( 'absint', explode ( ',', $activity_ids ) ) );
|
428 |
|
429 |
+
return $wpdb->query( "DELETE FROM {$bp->activity->table_name} WHERE type = 'activity_comment' AND item_id IN ({$activity_ids})" );
|
430 |
}
|
431 |
|
432 |
function delete_activity_meta_entries( $activity_ids ) {
|
437 |
else
|
438 |
$activity_ids = implode ( ',', array_map( 'absint', explode ( ',', $activity_ids ) ) );
|
439 |
|
440 |
+
return $wpdb->query( "DELETE FROM {$bp->activity->table_name_meta} WHERE activity_id IN ({$activity_ids})" );
|
441 |
}
|
442 |
|
443 |
/**
|
562 |
function get_recorded_components() {
|
563 |
global $wpdb, $bp;
|
564 |
|
565 |
+
return $wpdb->get_col( "SELECT DISTINCT component FROM {$bp->activity->table_name} ORDER BY component ASC" );
|
566 |
}
|
567 |
|
568 |
function get_sitewide_items_for_feed( $limit = 35 ) {
|
649 |
function get_last_updated() {
|
650 |
global $bp, $wpdb;
|
651 |
|
652 |
+
return $wpdb->get_var( "SELECT date_recorded FROM {$bp->activity->table_name} ORDER BY date_recorded DESC LIMIT 1" );
|
653 |
}
|
654 |
|
655 |
function total_favorite_count( $user_id ) {
|
bp-activity/bp-activity-functions.php
CHANGED
@@ -1182,6 +1182,8 @@ function bp_activity_delete( $args = '' ) {
|
|
1182 |
|
1183 |
$args = wp_parse_args( $args, $defaults );
|
1184 |
|
|
|
|
|
1185 |
// Adjust the new mention count of any mentioned member
|
1186 |
bp_activity_adjust_mention_count( $args['id'], 'delete' );
|
1187 |
|
@@ -1194,8 +1196,6 @@ function bp_activity_delete( $args = '' ) {
|
|
1194 |
else
|
1195 |
$user_id = $args['user_id'];
|
1196 |
|
1197 |
-
do_action( 'bp_before_activity_delete', $args );
|
1198 |
-
|
1199 |
$latest_update = bp_get_user_meta( $user_id, 'bp_latest_update', true );
|
1200 |
if ( !empty( $latest_update ) ) {
|
1201 |
if ( in_array( (int) $latest_update['id'], (array) $activity_ids_deleted ) ) {
|
1182 |
|
1183 |
$args = wp_parse_args( $args, $defaults );
|
1184 |
|
1185 |
+
do_action( 'bp_before_activity_delete', $args );
|
1186 |
+
|
1187 |
// Adjust the new mention count of any mentioned member
|
1188 |
bp_activity_adjust_mention_count( $args['id'], 'delete' );
|
1189 |
|
1196 |
else
|
1197 |
$user_id = $args['user_id'];
|
1198 |
|
|
|
|
|
1199 |
$latest_update = bp_get_user_meta( $user_id, 'bp_latest_update', true );
|
1200 |
if ( !empty( $latest_update ) ) {
|
1201 |
if ( in_array( (int) $latest_update['id'], (array) $activity_ids_deleted ) ) {
|
bp-blogs/bp-blogs-classes.php
CHANGED
@@ -113,8 +113,8 @@ class BP_Blogs_Blog {
|
|
113 |
$paged_blogs = $wpdb->get_results( "SELECT b.blog_id, b.user_id as admin_user_id, u.user_email as admin_user_email, wb.domain, wb.path, bm.meta_value as last_activity, bm2.meta_value as name FROM {$bp->blogs->table_name} b, {$bp->blogs->table_name_blogmeta} bm, {$bp->blogs->table_name_blogmeta} bm2, {$wpdb->base_prefix}blogs wb, {$wpdb->users} u WHERE b.blog_id = wb.blog_id AND b.user_id = u.ID AND b.blog_id = bm.blog_id AND b.blog_id = bm2.blog_id AND wb.archived = '0' AND wb.spam = 0 AND wb.mature = 0 AND wb.deleted = 0 {$hidden_sql} AND bm.meta_key = 'last_activity' AND bm2.meta_key = 'name' AND bm2.meta_value LIKE '%%$filter%%' {$user_sql} GROUP BY b.blog_id {$order_sql} {$pag_sql}" );
|
114 |
$total_blogs = $wpdb->get_var( "SELECT COUNT(DISTINCT b.blog_id) FROM {$bp->blogs->table_name} b, {$wpdb->base_prefix}blogs wb, {$bp->blogs->table_name_blogmeta} bm, {$bp->blogs->table_name_blogmeta} bm2 WHERE b.blog_id = wb.blog_id AND bm.blog_id = b.blog_id AND bm2.blog_id = b.blog_id AND wb.archived = '0' AND wb.spam = 0 AND wb.mature = 0 AND wb.deleted = 0 {$hidden_sql} AND bm.meta_key = 'name' AND bm2.meta_key = 'description' AND ( bm.meta_value LIKE '%%$filter%%' || bm2.meta_value LIKE '%%$filter%%' ) {$user_sql}" );
|
115 |
} else {
|
116 |
-
$paged_blogs = $wpdb->get_results(
|
117 |
-
$total_blogs = $wpdb->get_var(
|
118 |
}
|
119 |
|
120 |
$blog_ids = array();
|
@@ -230,8 +230,8 @@ class BP_Blogs_Blog {
|
|
230 |
$hidden_sql = !bp_current_user_can( 'bp_moderate' ) ? "AND wb.public = 1" : '';
|
231 |
$pag_sql = ( $limit && $page ) ? $wpdb->prepare( " LIMIT %d, %d", intval( ( $page - 1 ) * $limit), intval( $limit ) ) : '';
|
232 |
|
233 |
-
$paged_blogs = $wpdb->get_results(
|
234 |
-
$total_blogs = $wpdb->get_var(
|
235 |
|
236 |
return array( 'blogs' => $paged_blogs, 'total' => $total_blogs );
|
237 |
}
|
@@ -247,8 +247,8 @@ class BP_Blogs_Blog {
|
|
247 |
if ( $limit && $page )
|
248 |
$pag_sql = $wpdb->prepare( " LIMIT %d, %d", intval( ( $page - 1 ) * $limit), intval( $limit ) );
|
249 |
|
250 |
-
$paged_blogs = $wpdb->get_results(
|
251 |
-
$total_blogs = $wpdb->get_var(
|
252 |
|
253 |
return array( 'blogs' => $paged_blogs, 'total' => $total_blogs );
|
254 |
}
|
@@ -265,7 +265,7 @@ class BP_Blogs_Blog {
|
|
265 |
}
|
266 |
|
267 |
/* Fetch the blog description for each blog (as it may be empty we can't fetch it in the main query). */
|
268 |
-
$blog_descs = $wpdb->get_results(
|
269 |
|
270 |
for ( $i = 0, $count = count( $paged_blogs ); $i < $count; ++$i ) {
|
271 |
foreach ( (array) $blog_descs as $desc ) {
|
113 |
$paged_blogs = $wpdb->get_results( "SELECT b.blog_id, b.user_id as admin_user_id, u.user_email as admin_user_email, wb.domain, wb.path, bm.meta_value as last_activity, bm2.meta_value as name FROM {$bp->blogs->table_name} b, {$bp->blogs->table_name_blogmeta} bm, {$bp->blogs->table_name_blogmeta} bm2, {$wpdb->base_prefix}blogs wb, {$wpdb->users} u WHERE b.blog_id = wb.blog_id AND b.user_id = u.ID AND b.blog_id = bm.blog_id AND b.blog_id = bm2.blog_id AND wb.archived = '0' AND wb.spam = 0 AND wb.mature = 0 AND wb.deleted = 0 {$hidden_sql} AND bm.meta_key = 'last_activity' AND bm2.meta_key = 'name' AND bm2.meta_value LIKE '%%$filter%%' {$user_sql} GROUP BY b.blog_id {$order_sql} {$pag_sql}" );
|
114 |
$total_blogs = $wpdb->get_var( "SELECT COUNT(DISTINCT b.blog_id) FROM {$bp->blogs->table_name} b, {$wpdb->base_prefix}blogs wb, {$bp->blogs->table_name_blogmeta} bm, {$bp->blogs->table_name_blogmeta} bm2 WHERE b.blog_id = wb.blog_id AND bm.blog_id = b.blog_id AND bm2.blog_id = b.blog_id AND wb.archived = '0' AND wb.spam = 0 AND wb.mature = 0 AND wb.deleted = 0 {$hidden_sql} AND bm.meta_key = 'name' AND bm2.meta_key = 'description' AND ( bm.meta_value LIKE '%%$filter%%' || bm2.meta_value LIKE '%%$filter%%' ) {$user_sql}" );
|
115 |
} else {
|
116 |
+
$paged_blogs = $wpdb->get_results( "SELECT b.blog_id, b.user_id as admin_user_id, u.user_email as admin_user_email, wb.domain, wb.path, bm.meta_value as last_activity, bm2.meta_value as name FROM {$bp->blogs->table_name} b, {$bp->blogs->table_name_blogmeta} bm, {$bp->blogs->table_name_blogmeta} bm2, {$wpdb->base_prefix}blogs wb, {$wpdb->users} u WHERE b.blog_id = wb.blog_id AND b.user_id = u.ID AND b.blog_id = bm.blog_id AND b.blog_id = bm2.blog_id {$user_sql} AND wb.archived = '0' AND wb.spam = 0 AND wb.mature = 0 AND wb.deleted = 0 {$hidden_sql} AND bm.meta_key = 'last_activity' AND bm2.meta_key = 'name' GROUP BY b.blog_id {$order_sql} {$pag_sql}" );
|
117 |
+
$total_blogs = $wpdb->get_var( "SELECT COUNT(DISTINCT b.blog_id) FROM {$bp->blogs->table_name} b, {$wpdb->base_prefix}blogs wb WHERE b.blog_id = wb.blog_id {$user_sql} AND wb.archived = '0' AND wb.spam = 0 AND wb.mature = 0 AND wb.deleted = 0 {$hidden_sql}" );
|
118 |
}
|
119 |
|
120 |
$blog_ids = array();
|
230 |
$hidden_sql = !bp_current_user_can( 'bp_moderate' ) ? "AND wb.public = 1" : '';
|
231 |
$pag_sql = ( $limit && $page ) ? $wpdb->prepare( " LIMIT %d, %d", intval( ( $page - 1 ) * $limit), intval( $limit ) ) : '';
|
232 |
|
233 |
+
$paged_blogs = $wpdb->get_results( "SELECT DISTINCT b.blog_id FROM {$bp->blogs->table_name} b LEFT JOIN {$wpdb->base_prefix}blogs wb ON b.blog_id = wb.blog_id WHERE wb.mature = 0 AND wb.spam = 0 AND wb.archived = '0' AND wb.deleted = 0 {$hidden_sql} {$pag_sql}" );
|
234 |
+
$total_blogs = $wpdb->get_var( "SELECT COUNT(DISTINCT b.blog_id) FROM {$bp->blogs->table_name} b LEFT JOIN {$wpdb->base_prefix}blogs wb ON b.blog_id = wb.blog_id WHERE wb.mature = 0 AND wb.spam = 0 AND wb.archived = '0' AND wb.deleted = 0 {$hidden_sql}" );
|
235 |
|
236 |
return array( 'blogs' => $paged_blogs, 'total' => $total_blogs );
|
237 |
}
|
247 |
if ( $limit && $page )
|
248 |
$pag_sql = $wpdb->prepare( " LIMIT %d, %d", intval( ( $page - 1 ) * $limit), intval( $limit ) );
|
249 |
|
250 |
+
$paged_blogs = $wpdb->get_results( "SELECT DISTINCT bm.blog_id FROM {$bp->blogs->table_name_blogmeta} bm LEFT JOIN {$wpdb->base_prefix}blogs wb ON bm.blog_id = wb.blog_id WHERE bm.meta_key = 'name' AND bm.meta_value LIKE '$letter%%' {$hidden_sql} AND wb.mature = 0 AND wb.spam = 0 AND wb.archived = '0' AND wb.deleted = 0 ORDER BY bm.meta_value ASC{$pag_sql}" );
|
251 |
+
$total_blogs = $wpdb->get_var( "SELECT COUNT(DISTINCT bm.blog_id) FROM {$bp->blogs->table_name_blogmeta} bm LEFT JOIN {$wpdb->base_prefix}blogs wb ON bm.blog_id = wb.blog_id WHERE bm.meta_key = 'name' AND bm.meta_value LIKE '$letter%%' {$hidden_sql} AND wb.mature = 0 AND wb.spam = 0 AND wb.archived = '0' AND wb.deleted = 0 ORDER BY bm.meta_value ASC" );
|
252 |
|
253 |
return array( 'blogs' => $paged_blogs, 'total' => $total_blogs );
|
254 |
}
|
265 |
}
|
266 |
|
267 |
/* Fetch the blog description for each blog (as it may be empty we can't fetch it in the main query). */
|
268 |
+
$blog_descs = $wpdb->get_results( "SELECT blog_id, meta_value as description FROM {$bp->blogs->table_name_blogmeta} WHERE meta_key = 'description' AND blog_id IN ( {$blog_ids} )" );
|
269 |
|
270 |
for ( $i = 0, $count = count( $paged_blogs ); $i < $count; ++$i ) {
|
271 |
foreach ( (array) $blog_descs as $desc ) {
|
bp-blogs/bp-blogs-functions.php
CHANGED
@@ -49,7 +49,7 @@ function bp_blogs_record_existing_blogs() {
|
|
49 |
$wpdb->query( "TRUNCATE TABLE {$bp->blogs->table_name}" );
|
50 |
|
51 |
if ( is_multisite() )
|
52 |
-
$blog_ids = $wpdb->get_col(
|
53 |
else
|
54 |
$blog_ids = 1;
|
55 |
|
49 |
$wpdb->query( "TRUNCATE TABLE {$bp->blogs->table_name}" );
|
50 |
|
51 |
if ( is_multisite() )
|
52 |
+
$blog_ids = $wpdb->get_col( "SELECT blog_id FROM {$wpdb->base_prefix}blogs WHERE mature = 0 AND spam = 0 AND deleted = 0" );
|
53 |
else
|
54 |
$blog_ids = 1;
|
55 |
|
bp-core/admin/bp-core-functions.php
CHANGED
@@ -217,7 +217,7 @@ function bp_core_activation_notice() {
|
|
217 |
* on the off chance that someone has activated the blogs component and then disabled MS
|
218 |
*/
|
219 |
if ( bp_is_active( 'blogs' ) ) {
|
220 |
-
$count = $wpdb->get_var(
|
221 |
|
222 |
if ( empty( $count ) ) {
|
223 |
bp_blogs_record_existing_blogs();
|
217 |
* on the off chance that someone has activated the blogs component and then disabled MS
|
218 |
*/
|
219 |
if ( bp_is_active( 'blogs' ) ) {
|
220 |
+
$count = $wpdb->get_var( "SELECT COUNT(*) FROM {$bp->blogs->table_name}" );
|
221 |
|
222 |
if ( empty( $count ) ) {
|
223 |
bp_blogs_record_existing_blogs();
|
bp-core/admin/css/wizard.dev.css
CHANGED
@@ -140,6 +140,7 @@ div#bp-wizard table.form-table th {
|
|
140 |
|
141 |
div#bp-wizard table.form-table th img {
|
142 |
margin-top: 5px;
|
|
|
143 |
}
|
144 |
|
145 |
div#bp-wizard table.form-table th p {
|
140 |
|
141 |
div#bp-wizard table.form-table th img {
|
142 |
margin-top: 5px;
|
143 |
+
width: 300px;
|
144 |
}
|
145 |
|
146 |
div#bp-wizard table.form-table th p {
|
bp-core/bp-core-avatars.php
CHANGED
@@ -475,7 +475,6 @@ function bp_core_avatar_handle_upload( $file, $upload_dir_filter ) {
|
|
475 |
if ( !apply_filters( 'bp_core_pre_avatar_handle_upload', true, $file, $upload_dir_filter ) )
|
476 |
return true;
|
477 |
|
478 |
-
require_once( ABSPATH . '/wp-admin/includes/image.php' );
|
479 |
require_once( ABSPATH . '/wp-admin/includes/file.php' );
|
480 |
|
481 |
$uploadErrors = array(
|
@@ -514,27 +513,46 @@ function bp_core_avatar_handle_upload( $file, $upload_dir_filter ) {
|
|
514 |
}
|
515 |
|
516 |
// Get image size
|
517 |
-
$size
|
|
|
518 |
|
519 |
// Check image size and shrink if too large
|
520 |
if ( $size[0] > bp_core_avatar_original_max_width() ) {
|
521 |
-
$
|
522 |
|
523 |
-
|
524 |
-
|
525 |
-
|
526 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
527 |
}
|
528 |
|
529 |
-
|
530 |
-
|
|
|
|
|
531 |
}
|
532 |
|
533 |
// We only want to handle one image after resize.
|
534 |
if ( empty( $bp->avatar_admin->resized ) )
|
535 |
$bp->avatar_admin->image->dir = str_replace( bp_core_avatar_upload_path(), '', $bp->avatar_admin->original['file'] );
|
536 |
else {
|
537 |
-
$bp->avatar_admin->image->dir = str_replace( bp_core_avatar_upload_path(), '', $bp->avatar_admin->resized );
|
538 |
@unlink( $bp->avatar_admin->original['file'] );
|
539 |
}
|
540 |
|
475 |
if ( !apply_filters( 'bp_core_pre_avatar_handle_upload', true, $file, $upload_dir_filter ) )
|
476 |
return true;
|
477 |
|
|
|
478 |
require_once( ABSPATH . '/wp-admin/includes/file.php' );
|
479 |
|
480 |
$uploadErrors = array(
|
513 |
}
|
514 |
|
515 |
// Get image size
|
516 |
+
$size = @getimagesize( $bp->avatar_admin->original['file'] );
|
517 |
+
$error = false;
|
518 |
|
519 |
// Check image size and shrink if too large
|
520 |
if ( $size[0] > bp_core_avatar_original_max_width() ) {
|
521 |
+
$editor = wp_get_image_editor( $bp->avatar_admin->original['file'] );
|
522 |
|
523 |
+
if ( ! is_wp_error( $editor ) ) {
|
524 |
+
$editor->set_quality( 100 );
|
525 |
+
|
526 |
+
$resized = $editor->resize( bp_core_avatar_original_max_width(), bp_core_avatar_original_max_width(), false );
|
527 |
+
if ( ! is_wp_error( $resized ) )
|
528 |
+
$thumb = $editor->save( $editor->generate_filename() );
|
529 |
+
else
|
530 |
+
$error = $resized;
|
531 |
+
|
532 |
+
// Check for thumbnail creation errors
|
533 |
+
if ( false === $error && is_wp_error( $thumb ) )
|
534 |
+
$error = $thumb;
|
535 |
+
|
536 |
+
if ( false === $error ) {
|
537 |
+
// Thumbnail is good so proceed
|
538 |
+
$bp->avatar_admin->resized = $thumb;
|
539 |
+
}
|
540 |
+
|
541 |
+
} else {
|
542 |
+
$error = $editor;
|
543 |
}
|
544 |
|
545 |
+
if ( false !== $error ) {
|
546 |
+
bp_core_add_message( sprintf( __( 'Upload Failed! Error was: %s', 'buddypress' ), $error->get_error_message() ), 'error' );
|
547 |
+
return false;
|
548 |
+
}
|
549 |
}
|
550 |
|
551 |
// We only want to handle one image after resize.
|
552 |
if ( empty( $bp->avatar_admin->resized ) )
|
553 |
$bp->avatar_admin->image->dir = str_replace( bp_core_avatar_upload_path(), '', $bp->avatar_admin->original['file'] );
|
554 |
else {
|
555 |
+
$bp->avatar_admin->image->dir = str_replace( bp_core_avatar_upload_path(), '', $bp->avatar_admin->resized['path'] );
|
556 |
@unlink( $bp->avatar_admin->original['file'] );
|
557 |
}
|
558 |
|
bp-core/bp-core-cache.php
CHANGED
@@ -102,7 +102,7 @@ function bp_update_meta_cache( $args = array() ) {
|
|
102 |
|
103 |
// Get meta info
|
104 |
$id_list = join( ',', $object_ids );
|
105 |
-
$meta_list = $wpdb->get_results(
|
106 |
|
107 |
if ( !empty( $meta_list ) ) {
|
108 |
foreach ( $meta_list as $metarow ) {
|
102 |
|
103 |
// Get meta info
|
104 |
$id_list = join( ',', $object_ids );
|
105 |
+
$meta_list = $wpdb->get_results( "SELECT $object_column, meta_key, meta_value FROM $meta_table WHERE $object_column IN ($id_list)", ARRAY_A );
|
106 |
|
107 |
if ( !empty( $meta_list ) ) {
|
108 |
foreach ( $meta_list as $metarow ) {
|
bp-core/bp-core-catchuri.php
CHANGED
@@ -136,6 +136,9 @@ function bp_core_set_uri_globals() {
|
|
136 |
// Keep the unfiltered URI safe
|
137 |
$bp->unfiltered_uri = $bp_uri;
|
138 |
|
|
|
|
|
|
|
139 |
// Get slugs of pages into array
|
140 |
foreach ( (array) $bp->pages as $page_key => $bp_page )
|
141 |
$key_slugs[$page_key] = trailingslashit( '/' . $bp_page->slug );
|
136 |
// Keep the unfiltered URI safe
|
137 |
$bp->unfiltered_uri = $bp_uri;
|
138 |
|
139 |
+
// Don't use $bp_unfiltered_uri, this is only for backpat with old plugins. Use $bp->unfiltered_uri.
|
140 |
+
$GLOBALS['bp_unfiltered_uri'] = &$bp->unfiltered_uri;
|
141 |
+
|
142 |
// Get slugs of pages into array
|
143 |
foreach ( (array) $bp->pages as $page_key => $bp_page )
|
144 |
$key_slugs[$page_key] = trailingslashit( '/' . $bp_page->slug );
|
bp-core/bp-core-classes.php
CHANGED
@@ -415,8 +415,8 @@ class BP_Core_User {
|
|
415 |
|
416 |
$exclude_sql = ( !empty( $exclude ) ) ? " AND u.ID NOT IN ({$exclude})" : "";
|
417 |
|
418 |
-
$total_users_sql = apply_filters( 'bp_core_users_by_letter_count_sql', $wpdb->prepare( "SELECT COUNT(DISTINCT u.ID) FROM {$wpdb->users} u LEFT JOIN {$bp->profile->table_name_data} pd ON u.ID = pd.user_id LEFT JOIN {$bp->profile->table_name_fields} pf ON pd.field_id = pf.id WHERE {$status_sql} AND pf.name = %s {$exclude_sql} AND pd.value LIKE '$letter%%' ORDER BY pd.value ASC", bp_xprofile_fullname_field_name() ), $letter );
|
419 |
-
$paged_users_sql = apply_filters( 'bp_core_users_by_letter_sql',
|
420 |
|
421 |
$total_users = $wpdb->get_var( $total_users_sql );
|
422 |
$paged_users = $wpdb->get_results( $paged_users_sql );
|
@@ -464,8 +464,8 @@ class BP_Core_User {
|
|
464 |
$user_sql = " AND user_id IN ( " . $wpdb->escape( $user_ids ) . " ) ";
|
465 |
$status_sql = bp_core_get_status_sql();
|
466 |
|
467 |
-
$total_users_sql = apply_filters( 'bp_core_get_specific_users_count_sql',
|
468 |
-
$paged_users_sql = apply_filters( 'bp_core_get_specific_users_count_sql',
|
469 |
|
470 |
$total_users = $wpdb->get_var( $total_users_sql );
|
471 |
$paged_users = $wpdb->get_results( $paged_users_sql );
|
@@ -507,8 +507,8 @@ class BP_Core_User {
|
|
507 |
$search_terms = like_escape( $wpdb->escape( $search_terms ) );
|
508 |
$status_sql = bp_core_get_status_sql( 'u.' );
|
509 |
|
510 |
-
$total_users_sql = apply_filters( 'bp_core_search_users_count_sql', "SELECT COUNT(DISTINCT u.ID) as id FROM {$wpdb->users} u LEFT JOIN {$bp->profile->table_name_data} pd ON u.ID = pd.user_id WHERE {$status_sql} AND pd.value LIKE '
|
511 |
-
$paged_users_sql = apply_filters( 'bp_core_search_users_sql',
|
512 |
|
513 |
$total_users = $wpdb->get_var( $total_users_sql );
|
514 |
$paged_users = $wpdb->get_results( $paged_users_sql );
|
@@ -625,7 +625,7 @@ class BP_Core_User {
|
|
625 |
function get_core_userdata( $user_id ) {
|
626 |
global $wpdb;
|
627 |
|
628 |
-
if ( !$user = $wpdb->get_row( $wpdb->prepare( "SELECT * FROM $wpdb->users WHERE ID = %d LIMIT 1", $user_id ) ) )
|
629 |
return false;
|
630 |
|
631 |
return $user;
|
415 |
|
416 |
$exclude_sql = ( !empty( $exclude ) ) ? " AND u.ID NOT IN ({$exclude})" : "";
|
417 |
|
418 |
+
$total_users_sql = apply_filters( 'bp_core_users_by_letter_count_sql', $wpdb->prepare( "SELECT COUNT(DISTINCT u.ID) FROM {$wpdb->users} u LEFT JOIN {$bp->profile->table_name_data} pd ON u.ID = pd.user_id LEFT JOIN {$bp->profile->table_name_fields} pf ON pd.field_id = pf.id WHERE {$status_sql} AND pf.name = %s {$exclude_sql} AND pd.value LIKE '{$letter}%%' ORDER BY pd.value ASC", bp_xprofile_fullname_field_name() ), $letter );
|
419 |
+
$paged_users_sql = apply_filters( 'bp_core_users_by_letter_sql', $wpdb->prepare( "SELECT DISTINCT u.ID as id, u.user_registered, u.user_nicename, u.user_login, u.user_email FROM {$wpdb->users} u LEFT JOIN {$bp->profile->table_name_data} pd ON u.ID = pd.user_id LEFT JOIN {$bp->profile->table_name_fields} pf ON pd.field_id = pf.id WHERE {$status_sql} AND pf.name = %s {$exclude_sql} AND pd.value LIKE '{$letter}%%' ORDER BY pd.value ASC{$pag_sql}", bp_xprofile_fullname_field_name() ), $letter, $pag_sql );
|
420 |
|
421 |
$total_users = $wpdb->get_var( $total_users_sql );
|
422 |
$paged_users = $wpdb->get_results( $paged_users_sql );
|
464 |
$user_sql = " AND user_id IN ( " . $wpdb->escape( $user_ids ) . " ) ";
|
465 |
$status_sql = bp_core_get_status_sql();
|
466 |
|
467 |
+
$total_users_sql = apply_filters( 'bp_core_get_specific_users_count_sql', "SELECT COUNT(DISTINCT ID) FROM {$wpdb->users} WHERE {$status_sql} AND ID IN ( " . $wpdb->escape( $user_ids ) . " ) ", $wpdb->escape( $user_ids ) );
|
468 |
+
$paged_users_sql = apply_filters( 'bp_core_get_specific_users_count_sql', "SELECT DISTINCT ID as id, user_registered, user_nicename, user_login, user_email FROM {$wpdb->users} WHERE {$status_sql} AND ID IN ( " . $wpdb->escape( $user_ids ) . " ) {$pag_sql}", $wpdb->escape( $user_ids ) );
|
469 |
|
470 |
$total_users = $wpdb->get_var( $total_users_sql );
|
471 |
$paged_users = $wpdb->get_results( $paged_users_sql );
|
507 |
$search_terms = like_escape( $wpdb->escape( $search_terms ) );
|
508 |
$status_sql = bp_core_get_status_sql( 'u.' );
|
509 |
|
510 |
+
$total_users_sql = apply_filters( 'bp_core_search_users_count_sql', "SELECT COUNT(DISTINCT u.ID) as id FROM {$wpdb->users} u LEFT JOIN {$bp->profile->table_name_data} pd ON u.ID = pd.user_id WHERE {$status_sql} AND pd.value LIKE '%%{$search_terms}%%' ORDER BY pd.value ASC", $search_terms );
|
511 |
+
$paged_users_sql = apply_filters( 'bp_core_search_users_sql', "SELECT DISTINCT u.ID as id, u.user_registered, u.user_nicename, u.user_login, u.user_email FROM {$wpdb->users} u LEFT JOIN {$bp->profile->table_name_data} pd ON u.ID = pd.user_id WHERE {$status_sql} AND pd.value LIKE '%%{$search_terms}%%' ORDER BY pd.value ASC{$pag_sql}", $search_terms, $pag_sql );
|
512 |
|
513 |
$total_users = $wpdb->get_var( $total_users_sql );
|
514 |
$paged_users = $wpdb->get_results( $paged_users_sql );
|
625 |
function get_core_userdata( $user_id ) {
|
626 |
global $wpdb;
|
627 |
|
628 |
+
if ( !$user = $wpdb->get_row( $wpdb->prepare( "SELECT * FROM {$wpdb->users} WHERE ID = %d LIMIT 1", $user_id ) ) )
|
629 |
return false;
|
630 |
|
631 |
return $user;
|
bp-core/bp-core-cssjs.php
CHANGED
@@ -54,8 +54,7 @@ function bp_core_add_cropper_inline_js() {
|
|
54 |
$aspect_ratio = $full_width / $full_height;
|
55 |
|
56 |
$width = $image[0] / 2;
|
57 |
-
$height = $image[1] / 2;
|
58 |
-
?>
|
59 |
|
60 |
<script type="text/javascript">
|
61 |
jQuery(window).load( function(){
|
@@ -80,11 +79,15 @@ function bp_core_add_cropper_inline_js() {
|
|
80 |
if ( parseInt(coords.w) > 0 ) {
|
81 |
var rx = <?php echo $full_width; ?> / coords.w;
|
82 |
var ry = <?php echo $full_height; ?> / coords.h;
|
|
|
|
|
|
|
|
|
83 |
|
84 |
jQuery('#avatar-crop-preview').css({
|
85 |
<?php if ( $image ) : ?>
|
86 |
-
width: Math.round(rx *
|
87 |
-
height: Math.round(ry *
|
88 |
<?php endif; ?>
|
89 |
marginLeft: '-' + Math.round(rx * coords.x) + 'px',
|
90 |
marginTop: '-' + Math.round(ry * coords.y) + 'px'
|
@@ -104,12 +107,11 @@ function bp_core_add_cropper_inline_js() {
|
|
104 |
* @package BuddyPress Core
|
105 |
*/
|
106 |
function bp_core_add_cropper_inline_css() {
|
107 |
-
global $bp;
|
108 |
?>
|
109 |
|
110 |
<style type="text/css">
|
111 |
.jcrop-holder { float: left; margin: 0 20px 20px 0; text-align: left; }
|
112 |
-
.jcrop-vline, .jcrop-hline { font-size: 0; position: absolute; background: white top left repeat url(
|
113 |
.jcrop-vline { height: 100%; width: 1px !important; }
|
114 |
.jcrop-hline { width: 100%; height: 1px !important; }
|
115 |
.jcrop-handle { font-size: 1px; width: 7px !important; height: 7px !important; border: 1px #eee solid; background-color: #333; *width: 9px; *height: 9px; }
|
54 |
$aspect_ratio = $full_width / $full_height;
|
55 |
|
56 |
$width = $image[0] / 2;
|
57 |
+
$height = $image[1] / 2; ?>
|
|
|
58 |
|
59 |
<script type="text/javascript">
|
60 |
jQuery(window).load( function(){
|
79 |
if ( parseInt(coords.w) > 0 ) {
|
80 |
var rx = <?php echo $full_width; ?> / coords.w;
|
81 |
var ry = <?php echo $full_height; ?> / coords.h;
|
82 |
+
<?php if ( $image ) : ?>
|
83 |
+
var w = <?php echo $image[0]; ?>;
|
84 |
+
var h = <?php echo $image[1]; ?>;
|
85 |
+
<?php endif; ?>
|
86 |
|
87 |
jQuery('#avatar-crop-preview').css({
|
88 |
<?php if ( $image ) : ?>
|
89 |
+
width: Math.round(rx * w) + 'px',
|
90 |
+
height: Math.round(ry * h) + 'px',
|
91 |
<?php endif; ?>
|
92 |
marginLeft: '-' + Math.round(rx * coords.x) + 'px',
|
93 |
marginTop: '-' + Math.round(ry * coords.y) + 'px'
|
107 |
* @package BuddyPress Core
|
108 |
*/
|
109 |
function bp_core_add_cropper_inline_css() {
|
|
|
110 |
?>
|
111 |
|
112 |
<style type="text/css">
|
113 |
.jcrop-holder { float: left; margin: 0 20px 20px 0; text-align: left; }
|
114 |
+
.jcrop-vline, .jcrop-hline { font-size: 0; position: absolute; background: white top left repeat url('<?php echo BP_PLUGIN_URL ?>/bp-core/images/Jcrop.gif'); }
|
115 |
.jcrop-vline { height: 100%; width: 1px !important; }
|
116 |
.jcrop-hline { width: 100%; height: 1px !important; }
|
117 |
.jcrop-handle { font-size: 1px; width: 7px !important; height: 7px !important; border: 1px #eee solid; background-color: #333; *width: 9px; *height: 9px; }
|
bp-core/bp-core-filters.php
CHANGED
@@ -95,7 +95,7 @@ function bp_core_filter_comments( $comments, $post_id ) {
|
|
95 |
|
96 |
$user_ids = implode( ',', $user_ids );
|
97 |
|
98 |
-
if ( !$userdata = $wpdb->get_results(
|
99 |
return $comments;
|
100 |
|
101 |
foreach( (array) $userdata as $user )
|
95 |
|
96 |
$user_ids = implode( ',', $user_ids );
|
97 |
|
98 |
+
if ( !$userdata = $wpdb->get_results( "SELECT ID as user_id, user_login, user_nicename FROM {$wpdb->users} WHERE ID IN ({$user_ids})" ) )
|
99 |
return $comments;
|
100 |
|
101 |
foreach( (array) $userdata as $user )
|
bp-core/bp-core-functions.php
CHANGED
@@ -173,7 +173,7 @@ function bp_core_get_directory_pages() {
|
|
173 |
// from the current blog
|
174 |
$posts_table_name = bp_is_multiblog_mode() ? $wpdb->posts : $wpdb->get_blog_prefix( bp_get_root_blog_id() ) . 'posts';
|
175 |
$page_ids_sql = implode( ',', (array) $page_ids );
|
176 |
-
$page_names = $wpdb->get_results(
|
177 |
|
178 |
foreach ( (array) $page_ids as $component_id => $page_id ) {
|
179 |
foreach ( (array) $page_names as $page_name ) {
|
173 |
// from the current blog
|
174 |
$posts_table_name = bp_is_multiblog_mode() ? $wpdb->posts : $wpdb->get_blog_prefix( bp_get_root_blog_id() ) . 'posts';
|
175 |
$page_ids_sql = implode( ',', (array) $page_ids );
|
176 |
+
$page_names = $wpdb->get_results( "SELECT ID, post_name, post_parent, post_title FROM {$posts_table_name} WHERE ID IN ({$page_ids_sql}) AND post_status = 'publish' " );
|
177 |
|
178 |
foreach ( (array) $page_ids as $component_id => $page_id ) {
|
179 |
foreach ( (array) $page_names as $page_name ) {
|
bp-core/bp-core-options.php
CHANGED
@@ -290,7 +290,7 @@ function bp_core_get_root_options() {
|
|
290 |
// Do some magic to get all the root blog options in 1 swoop
|
291 |
$blog_options_keys = "'" . join( "', '", (array) $root_blog_option_keys ) . "'";
|
292 |
$blog_options_table = bp_is_multiblog_mode() ? $wpdb->options : $wpdb->get_blog_prefix( bp_get_root_blog_id() ) . 'options';
|
293 |
-
$blog_options_query =
|
294 |
$root_blog_options_meta = $wpdb->get_results( $blog_options_query );
|
295 |
|
296 |
// On Multisite installations, some options must always be fetched from sitemeta
|
290 |
// Do some magic to get all the root blog options in 1 swoop
|
291 |
$blog_options_keys = "'" . join( "', '", (array) $root_blog_option_keys ) . "'";
|
292 |
$blog_options_table = bp_is_multiblog_mode() ? $wpdb->options : $wpdb->get_blog_prefix( bp_get_root_blog_id() ) . 'options';
|
293 |
+
$blog_options_query = "SELECT option_name AS name, option_value AS value FROM {$blog_options_table} WHERE option_name IN ( {$blog_options_keys} )";
|
294 |
$root_blog_options_meta = $wpdb->get_results( $blog_options_query );
|
295 |
|
296 |
// On Multisite installations, some options must always be fetched from sitemeta
|
bp-core/bp-core-widgets.php
CHANGED
@@ -324,5 +324,6 @@ function bp_core_ajax_widget_members() {
|
|
324 |
<?php endif;
|
325 |
}
|
326 |
add_action( 'wp_ajax_widget_members', 'bp_core_ajax_widget_members' );
|
|
|
327 |
|
328 |
?>
|
324 |
<?php endif;
|
325 |
}
|
326 |
add_action( 'wp_ajax_widget_members', 'bp_core_ajax_widget_members' );
|
327 |
+
add_action( 'wp_ajax_nopriv_widget_members', 'bp_core_ajax_widget_members' );
|
328 |
|
329 |
?>
|
bp-core/deprecated/1.5.php
CHANGED
@@ -420,6 +420,20 @@ function bp_is_friend_requests() {
|
|
420 |
return bp_is_user_friend_requests();
|
421 |
}
|
422 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
423 |
/** Theme *********************************************************************/
|
424 |
|
425 |
/**
|
420 |
return bp_is_user_friend_requests();
|
421 |
}
|
422 |
|
423 |
+
/**
|
424 |
+
* Checks to see if a component's URL should be in the root, not under a member page:
|
425 |
+
* eg: http://domain.com/groups/the-group NOT http://domain.com/members/andy/groups/the-group
|
426 |
+
* You should be using bp_is_root_component().
|
427 |
+
*
|
428 |
+
* @deprecated 1.5
|
429 |
+
* @deprecated bp_is_root_component()
|
430 |
+
* @return true if root component, else false.
|
431 |
+
*/
|
432 |
+
function bp_core_is_root_component( $component_name ) {
|
433 |
+
_deprecated_function( __FUNCTION__, '1.5', 'bp_is_root_component()' );
|
434 |
+
return bp_is_root_component( $component_name );
|
435 |
+
}
|
436 |
+
|
437 |
/** Theme *********************************************************************/
|
438 |
|
439 |
/**
|
bp-forums/bp-forums-filters.php
CHANGED
@@ -155,9 +155,7 @@ add_filter( 'bp_get_the_topic_text', 'bp_forums_strip_mentions_on_post_edit' );
|
|
155 |
* @return string $sql
|
156 |
*/
|
157 |
function bp_forums_add_replied_distinct_sql( $sql ) {
|
158 |
-
|
159 |
-
|
160 |
-
$sql = $wpdb->prepare( "DISTINCT t.topic_id, " );
|
161 |
|
162 |
return $sql;
|
163 |
}
|
@@ -176,9 +174,9 @@ function bp_forums_add_replied_distinct_sql( $sql ) {
|
|
176 |
* @return string $sql
|
177 |
*/
|
178 |
function bp_forums_add_replied_join_sql( $sql ) {
|
179 |
-
global $bbdb
|
180 |
|
181 |
-
$sql .=
|
182 |
|
183 |
return $sql;
|
184 |
}
|
155 |
* @return string $sql
|
156 |
*/
|
157 |
function bp_forums_add_replied_distinct_sql( $sql ) {
|
158 |
+
$sql = "DISTINCT t.topic_id, ";
|
|
|
|
|
159 |
|
160 |
return $sql;
|
161 |
}
|
174 |
* @return string $sql
|
175 |
*/
|
176 |
function bp_forums_add_replied_join_sql( $sql ) {
|
177 |
+
global $bbdb;
|
178 |
|
179 |
+
$sql .= " LEFT JOIN $bbdb->posts p ON p.topic_id = t.topic_id ";
|
180 |
|
181 |
return $sql;
|
182 |
}
|
bp-forums/bp-forums-functions.php
CHANGED
@@ -332,7 +332,7 @@ function bp_forums_total_topic_count() {
|
|
332 |
$groups_table_sql = '';
|
333 |
$groups_where_sql = "t.topic_status = 0";
|
334 |
}
|
335 |
-
$count = $bbdb->get_results(
|
336 |
$count = count( (array) $count );
|
337 |
} else {
|
338 |
$count = 0;
|
@@ -470,7 +470,7 @@ function bp_forums_get_topic_extras( $topics ) {
|
|
470 |
$topic_ids = $wpdb->escape( join( ',', (array) $topic_ids ) );
|
471 |
|
472 |
// Fetch the topic's last poster details
|
473 |
-
$poster_details = $wpdb->get_results(
|
474 |
for ( $i = 0, $count = count( $topics ); $i < $count; ++$i ) {
|
475 |
foreach ( (array) $poster_details as $poster ) {
|
476 |
if ( $poster->topic_id == $topics[$i]->topic_id ) {
|
@@ -484,7 +484,7 @@ function bp_forums_get_topic_extras( $topics ) {
|
|
484 |
|
485 |
// Fetch fullname for the topic's last poster
|
486 |
if ( bp_is_active( 'xprofile' ) ) {
|
487 |
-
$poster_names = $wpdb->get_results(
|
488 |
for ( $i = 0, $count = count( $topics ); $i < $count; ++$i ) {
|
489 |
foreach ( (array) $poster_names as $name ) {
|
490 |
if ( $name->topic_id == $topics[$i]->topic_id )
|
@@ -609,7 +609,7 @@ function bp_forums_get_post_extras( $posts ) {
|
|
609 |
$user_ids = $wpdb->escape( join( ',', (array) $user_ids ) );
|
610 |
|
611 |
// Fetch the poster's user_email, user_nicename and user_login
|
612 |
-
$poster_details = $wpdb->get_results(
|
613 |
|
614 |
for ( $i = 0, $count = count( $posts ); $i < $count; ++$i ) {
|
615 |
foreach ( (array) $poster_details as $poster ) {
|
@@ -624,7 +624,7 @@ function bp_forums_get_post_extras( $posts ) {
|
|
624 |
|
625 |
// Fetch fullname for each poster.
|
626 |
if ( bp_is_active( 'xprofile' ) ) {
|
627 |
-
$poster_names = $wpdb->get_results(
|
628 |
for ( $i = 0, $count = count( $posts ); $i < $count; ++$i ) {
|
629 |
foreach ( (array) $poster_names as $name ) {
|
630 |
if ( isset( $topics[$i] ) && $name->user_id == $topics[$i]->user_id )
|
332 |
$groups_table_sql = '';
|
333 |
$groups_where_sql = "t.topic_status = 0";
|
334 |
}
|
335 |
+
$count = $bbdb->get_results( "SELECT t.topic_id FROM {$bbdb->topics} AS t {$groups_table_sql} WHERE {$groups_where_sql}" );
|
336 |
$count = count( (array) $count );
|
337 |
} else {
|
338 |
$count = 0;
|
470 |
$topic_ids = $wpdb->escape( join( ',', (array) $topic_ids ) );
|
471 |
|
472 |
// Fetch the topic's last poster details
|
473 |
+
$poster_details = $wpdb->get_results( "SELECT t.topic_id, t.topic_last_poster, u.user_login, u.user_nicename, u.user_email, u.display_name FROM {$wpdb->users} u, {$bbdb->topics} t WHERE u.ID = t.topic_last_poster AND t.topic_id IN ( {$topic_ids} )" );
|
474 |
for ( $i = 0, $count = count( $topics ); $i < $count; ++$i ) {
|
475 |
foreach ( (array) $poster_details as $poster ) {
|
476 |
if ( $poster->topic_id == $topics[$i]->topic_id ) {
|
484 |
|
485 |
// Fetch fullname for the topic's last poster
|
486 |
if ( bp_is_active( 'xprofile' ) ) {
|
487 |
+
$poster_names = $wpdb->get_results( "SELECT t.topic_id, pd.value FROM {$bp->profile->table_name_data} pd, {$bbdb->topics} t WHERE pd.user_id = t.topic_last_poster AND pd.field_id = 1 AND t.topic_id IN ( {$topic_ids} )" );
|
488 |
for ( $i = 0, $count = count( $topics ); $i < $count; ++$i ) {
|
489 |
foreach ( (array) $poster_names as $name ) {
|
490 |
if ( $name->topic_id == $topics[$i]->topic_id )
|
609 |
$user_ids = $wpdb->escape( join( ',', (array) $user_ids ) );
|
610 |
|
611 |
// Fetch the poster's user_email, user_nicename and user_login
|
612 |
+
$poster_details = $wpdb->get_results( "SELECT u.ID as user_id, u.user_login, u.user_nicename, u.user_email, u.display_name FROM {$wpdb->users} u WHERE u.ID IN ( {$user_ids} )" );
|
613 |
|
614 |
for ( $i = 0, $count = count( $posts ); $i < $count; ++$i ) {
|
615 |
foreach ( (array) $poster_details as $poster ) {
|
624 |
|
625 |
// Fetch fullname for each poster.
|
626 |
if ( bp_is_active( 'xprofile' ) ) {
|
627 |
+
$poster_names = $wpdb->get_results( "SELECT pd.user_id, pd.value FROM {$bp->profile->table_name_data} pd WHERE pd.user_id IN ( {$user_ids} )" );
|
628 |
for ( $i = 0, $count = count( $posts ); $i < $count; ++$i ) {
|
629 |
foreach ( (array) $poster_names as $name ) {
|
630 |
if ( isset( $topics[$i] ) && $name->user_id == $topics[$i]->user_id )
|
bp-friends/bp-friends-classes.php
CHANGED
@@ -84,14 +84,14 @@ class BP_Friends_Friendship {
|
|
84 |
global $wpdb, $bp;
|
85 |
|
86 |
if ( !empty( $friend_requests_only ) ) {
|
87 |
-
$oc_sql =
|
88 |
$friend_sql = $wpdb->prepare ( " WHERE friend_user_id = %d", $user_id );
|
89 |
} else {
|
90 |
-
$oc_sql =
|
91 |
$friend_sql = $wpdb->prepare ( " WHERE (initiator_user_id = %d OR friend_user_id = %d)", $user_id, $user_id );
|
92 |
}
|
93 |
|
94 |
-
$friends = $wpdb->get_results(
|
95 |
$fids = array();
|
96 |
|
97 |
for ( $i = 0, $count = count( $friends ); $i < $count; ++$i ) {
|
@@ -160,11 +160,11 @@ class BP_Friends_Friendship {
|
|
160 |
|
161 |
// filter the user_ids based on the search criteria.
|
162 |
if ( bp_is_active( 'xprofile' ) ) {
|
163 |
-
$sql = "SELECT DISTINCT user_id FROM {$bp->profile->table_name_data} WHERE user_id IN ($fids) AND value LIKE '$filter%%' {$pag_sql}";
|
164 |
-
$total_sql = "SELECT COUNT(DISTINCT user_id) FROM {$bp->profile->table_name_data} WHERE user_id IN ($fids) AND value LIKE '$filter%%'";
|
165 |
} else {
|
166 |
-
$sql = "SELECT DISTINCT user_id FROM {$wpdb->usermeta} WHERE user_id IN ($fids) AND meta_key = 'nickname' AND meta_value LIKE '$filter%%' {$pag_sql}";
|
167 |
-
$total_sql = "SELECT COUNT(DISTINCT user_id) FROM {$wpdb->usermeta} WHERE user_id IN ($fids) AND meta_key = 'nickname' AND meta_value LIKE '$filter%%'";
|
168 |
}
|
169 |
|
170 |
$filtered_friend_ids = $wpdb->get_col( $sql );
|
@@ -220,7 +220,7 @@ class BP_Friends_Friendship {
|
|
220 |
}
|
221 |
|
222 |
function search_users( $filter, $user_id, $limit = null, $page = null ) {
|
223 |
-
global $wpdb;
|
224 |
|
225 |
$filter = like_escape( $wpdb->escape( $filter ) );
|
226 |
|
@@ -232,9 +232,9 @@ class BP_Friends_Friendship {
|
|
232 |
|
233 |
// filter the user_ids based on the search criteria.
|
234 |
if ( bp_is_active( 'xprofile' ) ) {
|
235 |
-
$sql =
|
236 |
} else {
|
237 |
-
$sql =
|
238 |
}
|
239 |
|
240 |
$filtered_fids = $wpdb->get_col($sql);
|
@@ -255,9 +255,9 @@ class BP_Friends_Friendship {
|
|
255 |
|
256 |
// filter the user_ids based on the search criteria.
|
257 |
if ( bp_is_active( 'xprofile' ) ) {
|
258 |
-
$sql =
|
259 |
} else {
|
260 |
-
$sql =
|
261 |
}
|
262 |
|
263 |
$user_count = $wpdb->get_col($sql);
|
84 |
global $wpdb, $bp;
|
85 |
|
86 |
if ( !empty( $friend_requests_only ) ) {
|
87 |
+
$oc_sql = "AND is_confirmed = 0";
|
88 |
$friend_sql = $wpdb->prepare ( " WHERE friend_user_id = %d", $user_id );
|
89 |
} else {
|
90 |
+
$oc_sql = "AND is_confirmed = 1";
|
91 |
$friend_sql = $wpdb->prepare ( " WHERE (initiator_user_id = %d OR friend_user_id = %d)", $user_id, $user_id );
|
92 |
}
|
93 |
|
94 |
+
$friends = $wpdb->get_results( "SELECT friend_user_id, initiator_user_id FROM {$bp->friends->table_name} {$friend_sql} {$oc_sql} ORDER BY date_created DESC" );
|
95 |
$fids = array();
|
96 |
|
97 |
for ( $i = 0, $count = count( $friends ); $i < $count; ++$i ) {
|
160 |
|
161 |
// filter the user_ids based on the search criteria.
|
162 |
if ( bp_is_active( 'xprofile' ) ) {
|
163 |
+
$sql = "SELECT DISTINCT user_id FROM {$bp->profile->table_name_data} WHERE user_id IN ({$fids}) AND value LIKE '{$filter}%%' {$pag_sql}";
|
164 |
+
$total_sql = "SELECT COUNT(DISTINCT user_id) FROM {$bp->profile->table_name_data} WHERE user_id IN ({$fids}) AND value LIKE '{$filter}%%'";
|
165 |
} else {
|
166 |
+
$sql = "SELECT DISTINCT user_id FROM {$wpdb->usermeta} WHERE user_id IN ({$fids}) AND meta_key = 'nickname' AND meta_value LIKE '{$filter}%%' {$pag_sql}";
|
167 |
+
$total_sql = "SELECT COUNT(DISTINCT user_id) FROM {$wpdb->usermeta} WHERE user_id IN ({$fids}) AND meta_key = 'nickname' AND meta_value LIKE '{$filter}%%'";
|
168 |
}
|
169 |
|
170 |
$filtered_friend_ids = $wpdb->get_col( $sql );
|
220 |
}
|
221 |
|
222 |
function search_users( $filter, $user_id, $limit = null, $page = null ) {
|
223 |
+
global $wpdb, $bp;
|
224 |
|
225 |
$filter = like_escape( $wpdb->escape( $filter ) );
|
226 |
|
232 |
|
233 |
// filter the user_ids based on the search criteria.
|
234 |
if ( bp_is_active( 'xprofile' ) ) {
|
235 |
+
$sql = "SELECT DISTINCT d.user_id as id FROM {$bp->profile->table_name_data} d, {$users_table} u WHERE d.user_id = u.id AND d.value LIKE '{$filter}%%' ORDER BY d.value DESC {$pag_sql}";
|
236 |
} else {
|
237 |
+
$sql = "SELECT DISTINCT user_id as id FROM {$usermeta_table} WHERE meta_value LIKE '{$filter}%%' ORDER BY d.value DESC {$pag_sql}";
|
238 |
}
|
239 |
|
240 |
$filtered_fids = $wpdb->get_col($sql);
|
255 |
|
256 |
// filter the user_ids based on the search criteria.
|
257 |
if ( bp_is_active( 'xprofile' ) ) {
|
258 |
+
$sql = "SELECT COUNT(DISTINCT d.user_id) FROM {$bp->profile->table_name_data} d, {$users_table} u WHERE d.user_id = u.id AND d.value LIKE '{$filter}%%'";
|
259 |
} else {
|
260 |
+
$sql = "SELECT COUNT(DISTINCT user_id) FROM {$usermeta_table} WHERE meta_value LIKE '{$filter}%%'";
|
261 |
}
|
262 |
|
263 |
$user_count = $wpdb->get_col($sql);
|
bp-groups/bp-groups-classes.php
CHANGED
@@ -176,7 +176,7 @@ class BP_Groups_Group {
|
|
176 |
$user_id_str = implode( ',', (array) $user_ids );
|
177 |
|
178 |
// Modify group count usermeta for members
|
179 |
-
$wpdb->query(
|
180 |
|
181 |
// Now delete all group member entries
|
182 |
BP_Groups_Member::delete_all( $this->id );
|
@@ -234,8 +234,8 @@ class BP_Groups_Group {
|
|
234 |
|
235 |
$gids = implode( ',', $gids['groups'] );
|
236 |
|
237 |
-
$paged_groups = $wpdb->get_results(
|
238 |
-
$total_groups = $wpdb->get_var(
|
239 |
|
240 |
return array( 'groups' => $paged_groups, 'total' => $total_groups );
|
241 |
}
|
@@ -532,16 +532,16 @@ class BP_Groups_Group {
|
|
532 |
}
|
533 |
|
534 |
if ( !bp_current_user_can( 'bp_moderate' ) )
|
535 |
-
$hidden_sql =
|
536 |
|
537 |
$letter = like_escape( $wpdb->escape( $letter ) );
|
538 |
|
539 |
if ( !empty( $limit ) && !empty( $page ) ) {
|
540 |
$pag_sql = $wpdb->prepare( " LIMIT %d, %d", intval( ( $page - 1 ) * $limit), intval( $limit ) );
|
541 |
-
$total_groups = $wpdb->get_var(
|
542 |
}
|
543 |
|
544 |
-
$paged_groups = $wpdb->get_results(
|
545 |
|
546 |
if ( !empty( $populate_extras ) ) {
|
547 |
foreach ( (array) $paged_groups as $group ) $group_ids[] = $group->id;
|
@@ -636,7 +636,7 @@ class BP_Groups_Group {
|
|
636 |
if ( !bp_current_user_can( 'bp_moderate' ) )
|
637 |
$hidden_sql = "WHERE status != 'hidden'";
|
638 |
|
639 |
-
return $wpdb->get_var(
|
640 |
}
|
641 |
|
642 |
function get_global_forum_topic_count( $type ) {
|
@@ -691,16 +691,16 @@ class BP_Groups_Group {
|
|
691 |
break;
|
692 |
|
693 |
case 'hidden' :
|
694 |
-
$status_sql =
|
695 |
break;
|
696 |
|
697 |
case 'private' :
|
698 |
-
$status_sql =
|
699 |
break;
|
700 |
|
701 |
case 'public' :
|
702 |
default :
|
703 |
-
$status_sql =
|
704 |
break;
|
705 |
}
|
706 |
|
@@ -808,7 +808,7 @@ class BP_Groups_Member {
|
|
808 |
$sql = $wpdb->prepare( "UPDATE {$bp->groups->table_name_members} SET inviter_id = %d, is_admin = %d, is_mod = %d, is_banned = %d, user_title = %s, date_modified = %s, is_confirmed = %d, comments = %s, invite_sent = %d WHERE id = %d", $this->inviter_id, $this->is_admin, $this->is_mod, $this->is_banned, $this->user_title, $this->date_modified, $this->is_confirmed, $this->comments, $this->invite_sent, $this->id );
|
809 |
} else {
|
810 |
// Ensure that user is not already a member of the group before inserting
|
811 |
-
if ( $wpdb->get_var( $wpdb->prepare( "SELECT id FROM {$bp->groups->table_name_members} WHERE user_id = %d AND group_id = %d LIMIT 1", $this->user_id, $this->group_id ) ) ) {
|
812 |
return false;
|
813 |
}
|
814 |
|
@@ -1134,9 +1134,9 @@ class BP_Groups_Member {
|
|
1134 |
|
1135 |
// If the user is logged in and viewing their random groups, we can show hidden and private groups
|
1136 |
if ( bp_is_my_profile() ) {
|
1137 |
-
return $wpdb->get_col( $wpdb->prepare( "SELECT DISTINCT group_id FROM {$bp->groups->table_name_members} WHERE user_id = %d AND is_confirmed = 1 AND is_banned = 0 ORDER BY rand() LIMIT $total_groups", $user_id ) );
|
1138 |
} else {
|
1139 |
-
return $wpdb->get_col( $wpdb->prepare( "SELECT DISTINCT m.group_id FROM {$bp->groups->table_name_members} m, {$bp->groups->table_name} g WHERE m.group_id = g.id AND g.status != 'hidden' AND m.user_id = %d AND m.is_confirmed = 1 AND m.is_banned = 0 ORDER BY rand() LIMIT $total_groups", $user_id ) );
|
1140 |
}
|
1141 |
}
|
1142 |
|
@@ -1173,15 +1173,15 @@ class BP_Groups_Member {
|
|
1173 |
|
1174 |
$exclude_admins_sql = '';
|
1175 |
if ( !empty( $exclude_admins_mods ) )
|
1176 |
-
$exclude_admins_sql =
|
1177 |
|
1178 |
$banned_sql = '';
|
1179 |
if ( !empty( $exclude_banned ) )
|
1180 |
-
$banned_sql =
|
1181 |
|
1182 |
$exclude_sql = '';
|
1183 |
if ( !empty( $exclude ) )
|
1184 |
-
$exclude_sql =
|
1185 |
|
1186 |
if ( bp_is_active( 'xprofile' ) )
|
1187 |
$members = $wpdb->get_results( apply_filters( 'bp_group_members_user_join_filter', $wpdb->prepare( "SELECT m.user_id, m.date_modified, m.is_banned, u.user_login, u.user_nicename, u.user_email, pd.value as display_name FROM {$bp->groups->table_name_members} m, {$wpdb->users} u, {$bp->profile->table_name_data} pd WHERE u.ID = m.user_id AND u.ID = pd.user_id AND pd.field_id = 1 AND group_id = %d AND is_confirmed = 1 {$banned_sql} {$exclude_admins_sql} {$exclude_sql} ORDER BY m.date_modified DESC {$pag_sql}", $group_id ) ) );
|
176 |
$user_id_str = implode( ',', (array) $user_ids );
|
177 |
|
178 |
// Modify group count usermeta for members
|
179 |
+
$wpdb->query( "UPDATE {$wpdb->usermeta} SET meta_value = meta_value - 1 WHERE meta_key = 'total_group_count' AND user_id IN ( {$user_id_str} )" );
|
180 |
|
181 |
// Now delete all group member entries
|
182 |
BP_Groups_Member::delete_all( $this->id );
|
234 |
|
235 |
$gids = implode( ',', $gids['groups'] );
|
236 |
|
237 |
+
$paged_groups = $wpdb->get_results( "SELECT id as group_id FROM {$bp->groups->table_name} WHERE ( name LIKE '{$filter}%%' OR description LIKE '{$filter}%%' ) AND id IN ({$gids}) {$pag_sql}" );
|
238 |
+
$total_groups = $wpdb->get_var( "SELECT COUNT(id) FROM {$bp->groups->table_name} WHERE ( name LIKE '{$filter}%%' OR description LIKE '{$filter}%%' ) AND id IN ({$gids})" );
|
239 |
|
240 |
return array( 'groups' => $paged_groups, 'total' => $total_groups );
|
241 |
}
|
532 |
}
|
533 |
|
534 |
if ( !bp_current_user_can( 'bp_moderate' ) )
|
535 |
+
$hidden_sql = " AND status != 'hidden'";
|
536 |
|
537 |
$letter = like_escape( $wpdb->escape( $letter ) );
|
538 |
|
539 |
if ( !empty( $limit ) && !empty( $page ) ) {
|
540 |
$pag_sql = $wpdb->prepare( " LIMIT %d, %d", intval( ( $page - 1 ) * $limit), intval( $limit ) );
|
541 |
+
$total_groups = $wpdb->get_var( "SELECT COUNT(DISTINCT g.id) FROM {$bp->groups->table_name_groupmeta} gm1, {$bp->groups->table_name_groupmeta} gm2, {$bp->groups->table_name} g WHERE g.id = gm1.group_id AND g.id = gm2.group_id AND gm2.meta_key = 'last_activity' AND gm1.meta_key = 'total_member_count' AND g.name LIKE '$letter%%' {$hidden_sql} {$search_sql} {$exclude_sql}" );
|
542 |
}
|
543 |
|
544 |
+
$paged_groups = $wpdb->get_results( "SELECT g.*, gm1.meta_value as total_member_count, gm2.meta_value as last_activity FROM {$bp->groups->table_name_groupmeta} gm1, {$bp->groups->table_name_groupmeta} gm2, {$bp->groups->table_name} g WHERE g.id = gm1.group_id AND g.id = gm2.group_id AND gm2.meta_key = 'last_activity' AND gm1.meta_key = 'total_member_count' AND g.name LIKE '$letter%%' {$hidden_sql} {$search_sql} {$exclude_sql} ORDER BY g.name ASC {$pag_sql}" );
|
545 |
|
546 |
if ( !empty( $populate_extras ) ) {
|
547 |
foreach ( (array) $paged_groups as $group ) $group_ids[] = $group->id;
|
636 |
if ( !bp_current_user_can( 'bp_moderate' ) )
|
637 |
$hidden_sql = "WHERE status != 'hidden'";
|
638 |
|
639 |
+
return $wpdb->get_var( "SELECT COUNT(id) FROM {$bp->groups->table_name} {$hidden_sql}" );
|
640 |
}
|
641 |
|
642 |
function get_global_forum_topic_count( $type ) {
|
691 |
break;
|
692 |
|
693 |
case 'hidden' :
|
694 |
+
$status_sql = "AND g.status = 'hidden'";
|
695 |
break;
|
696 |
|
697 |
case 'private' :
|
698 |
+
$status_sql = "AND g.status = 'private'";
|
699 |
break;
|
700 |
|
701 |
case 'public' :
|
702 |
default :
|
703 |
+
$status_sql = "AND g.status = 'public'";
|
704 |
break;
|
705 |
}
|
706 |
|
808 |
$sql = $wpdb->prepare( "UPDATE {$bp->groups->table_name_members} SET inviter_id = %d, is_admin = %d, is_mod = %d, is_banned = %d, user_title = %s, date_modified = %s, is_confirmed = %d, comments = %s, invite_sent = %d WHERE id = %d", $this->inviter_id, $this->is_admin, $this->is_mod, $this->is_banned, $this->user_title, $this->date_modified, $this->is_confirmed, $this->comments, $this->invite_sent, $this->id );
|
809 |
} else {
|
810 |
// Ensure that user is not already a member of the group before inserting
|
811 |
+
if ( $wpdb->get_var( $wpdb->prepare( "SELECT id FROM {$bp->groups->table_name_members} WHERE user_id = %d AND group_id = %d AND is_confirmed = 1 LIMIT 1", $this->user_id, $this->group_id ) ) ) {
|
812 |
return false;
|
813 |
}
|
814 |
|
1134 |
|
1135 |
// If the user is logged in and viewing their random groups, we can show hidden and private groups
|
1136 |
if ( bp_is_my_profile() ) {
|
1137 |
+
return $wpdb->get_col( $wpdb->prepare( "SELECT DISTINCT group_id FROM {$bp->groups->table_name_members} WHERE user_id = %d AND is_confirmed = 1 AND is_banned = 0 ORDER BY rand() LIMIT {$total_groups}", $user_id ) );
|
1138 |
} else {
|
1139 |
+
return $wpdb->get_col( $wpdb->prepare( "SELECT DISTINCT m.group_id FROM {$bp->groups->table_name_members} m, {$bp->groups->table_name} g WHERE m.group_id = g.id AND g.status != 'hidden' AND m.user_id = %d AND m.is_confirmed = 1 AND m.is_banned = 0 ORDER BY rand() LIMIT {$total_groups}", $user_id ) );
|
1140 |
}
|
1141 |
}
|
1142 |
|
1173 |
|
1174 |
$exclude_admins_sql = '';
|
1175 |
if ( !empty( $exclude_admins_mods ) )
|
1176 |
+
$exclude_admins_sql = "AND is_admin = 0 AND is_mod = 0";
|
1177 |
|
1178 |
$banned_sql = '';
|
1179 |
if ( !empty( $exclude_banned ) )
|
1180 |
+
$banned_sql = " AND is_banned = 0";
|
1181 |
|
1182 |
$exclude_sql = '';
|
1183 |
if ( !empty( $exclude ) )
|
1184 |
+
$exclude_sql = " AND m.user_id NOT IN ({$exclude})";
|
1185 |
|
1186 |
if ( bp_is_active( 'xprofile' ) )
|
1187 |
$members = $wpdb->get_results( apply_filters( 'bp_group_members_user_join_filter', $wpdb->prepare( "SELECT m.user_id, m.date_modified, m.is_banned, u.user_login, u.user_nicename, u.user_email, pd.value as display_name FROM {$bp->groups->table_name_members} m, {$wpdb->users} u, {$bp->profile->table_name_data} pd WHERE u.ID = m.user_id AND u.ID = pd.user_id AND pd.field_id = 1 AND group_id = %d AND is_confirmed = 1 {$banned_sql} {$exclude_admins_sql} {$exclude_sql} ORDER BY m.date_modified DESC {$pag_sql}", $group_id ) ) );
|
bp-groups/bp-groups-functions.php
CHANGED
@@ -917,11 +917,11 @@ function groups_delete_groupmeta( $group_id, $meta_key = false, $meta_value = fa
|
|
917 |
$meta_value = trim( $meta_value );
|
918 |
|
919 |
if ( !$meta_key )
|
920 |
-
$wpdb->query( $wpdb->prepare( "DELETE FROM
|
921 |
else if ( $meta_value )
|
922 |
-
$wpdb->query( $wpdb->prepare( "DELETE FROM
|
923 |
else
|
924 |
-
$wpdb->query( $wpdb->prepare( "DELETE FROM
|
925 |
|
926 |
// Delete the cached object
|
927 |
wp_cache_delete( 'bp_groups_groupmeta_' . $group_id . '_' . $meta_key, 'bp' );
|
@@ -942,11 +942,11 @@ function groups_get_groupmeta( $group_id, $meta_key = '') {
|
|
942 |
|
943 |
$metas = wp_cache_get( 'bp_groups_groupmeta_' . $group_id . '_' . $meta_key, 'bp' );
|
944 |
if ( false === $metas ) {
|
945 |
-
$metas = $wpdb->get_col( $wpdb->prepare("SELECT meta_value FROM
|
946 |
wp_cache_set( 'bp_groups_groupmeta_' . $group_id . '_' . $meta_key, $metas, 'bp' );
|
947 |
}
|
948 |
} else {
|
949 |
-
$metas = $wpdb->get_col( $wpdb->prepare("SELECT meta_value FROM
|
950 |
}
|
951 |
|
952 |
if ( empty( $metas ) ) {
|
@@ -977,12 +977,12 @@ function groups_update_groupmeta( $group_id, $meta_key, $meta_value ) {
|
|
977 |
|
978 |
$meta_value = maybe_serialize( $meta_value );
|
979 |
|
980 |
-
$cur = $wpdb->get_row( $wpdb->prepare( "SELECT * FROM
|
981 |
|
982 |
if ( !$cur )
|
983 |
-
$wpdb->query( $wpdb->prepare( "INSERT INTO
|
984 |
else if ( $cur->meta_value != $meta_value )
|
985 |
-
$wpdb->query( $wpdb->prepare( "UPDATE
|
986 |
else
|
987 |
return false;
|
988 |
|
917 |
$meta_value = trim( $meta_value );
|
918 |
|
919 |
if ( !$meta_key )
|
920 |
+
$wpdb->query( $wpdb->prepare( "DELETE FROM {$bp->groups->table_name_groupmeta} WHERE group_id = %d", $group_id ) );
|
921 |
else if ( $meta_value )
|
922 |
+
$wpdb->query( $wpdb->prepare( "DELETE FROM {$bp->groups->table_name_groupmeta} WHERE group_id = %d AND meta_key = %s AND meta_value = %s", $group_id, $meta_key, $meta_value ) );
|
923 |
else
|
924 |
+
$wpdb->query( $wpdb->prepare( "DELETE FROM {$bp->groups->table_name_groupmeta} WHERE group_id = %d AND meta_key = %s", $group_id, $meta_key ) );
|
925 |
|
926 |
// Delete the cached object
|
927 |
wp_cache_delete( 'bp_groups_groupmeta_' . $group_id . '_' . $meta_key, 'bp' );
|
942 |
|
943 |
$metas = wp_cache_get( 'bp_groups_groupmeta_' . $group_id . '_' . $meta_key, 'bp' );
|
944 |
if ( false === $metas ) {
|
945 |
+
$metas = $wpdb->get_col( $wpdb->prepare("SELECT meta_value FROM {$bp->groups->table_name_groupmeta} WHERE group_id = %d AND meta_key = %s", $group_id, $meta_key) );
|
946 |
wp_cache_set( 'bp_groups_groupmeta_' . $group_id . '_' . $meta_key, $metas, 'bp' );
|
947 |
}
|
948 |
} else {
|
949 |
+
$metas = $wpdb->get_col( $wpdb->prepare("SELECT meta_value FROM {$bp->groups->table_name_groupmeta} WHERE group_id = %d", $group_id) );
|
950 |
}
|
951 |
|
952 |
if ( empty( $metas ) ) {
|
977 |
|
978 |
$meta_value = maybe_serialize( $meta_value );
|
979 |
|
980 |
+
$cur = $wpdb->get_row( $wpdb->prepare( "SELECT * FROM {$bp->groups->table_name_groupmeta} WHERE group_id = %d AND meta_key = %s", $group_id, $meta_key ) );
|
981 |
|
982 |
if ( !$cur )
|
983 |
+
$wpdb->query( $wpdb->prepare( "INSERT INTO {$bp->groups->table_name_groupmeta} ( group_id, meta_key, meta_value ) VALUES ( %d, %s, %s )", $group_id, $meta_key, $meta_value ) );
|
984 |
else if ( $cur->meta_value != $meta_value )
|
985 |
+
$wpdb->query( $wpdb->prepare( "UPDATE {$bp->groups->table_name_groupmeta} SET meta_value = %s WHERE group_id = %d AND meta_key = %s", $meta_value, $group_id, $meta_key ) );
|
986 |
else
|
987 |
return false;
|
988 |
|
bp-groups/bp-groups-loader.php
CHANGED
@@ -502,9 +502,9 @@ class BP_Groups_Component extends BP_Component {
|
|
502 |
$title = __( 'Groups', 'buddypress' );
|
503 |
$pending = __( 'No Pending Invites', 'buddypress' );
|
504 |
|
505 |
-
if ( !empty( $count
|
506 |
-
$title = sprintf( __( 'Groups <span class="count">%s</span>', 'buddypress' ), $count
|
507 |
-
$pending = sprintf( __( 'Pending Invites <span class="count">%s</span>', 'buddypress' ), $count
|
508 |
}
|
509 |
|
510 |
// Add the "My Account" sub menus
|
502 |
$title = __( 'Groups', 'buddypress' );
|
503 |
$pending = __( 'No Pending Invites', 'buddypress' );
|
504 |
|
505 |
+
if ( !empty( $count['total'] ) ) {
|
506 |
+
$title = sprintf( __( 'Groups <span class="count">%s</span>', 'buddypress' ), $count['total'] );
|
507 |
+
$pending = sprintf( __( 'Pending Invites <span class="count">%s</span>', 'buddypress' ), $count['total'] );
|
508 |
}
|
509 |
|
510 |
// Add the "My Account" sub menus
|
bp-groups/bp-groups-widgets.php
CHANGED
@@ -205,5 +205,6 @@ function groups_ajax_widget_groups_list() {
|
|
205 |
|
206 |
}
|
207 |
add_action( 'wp_ajax_widget_groups_list', 'groups_ajax_widget_groups_list' );
|
|
|
208 |
|
209 |
?>
|
205 |
|
206 |
}
|
207 |
add_action( 'wp_ajax_widget_groups_list', 'groups_ajax_widget_groups_list' );
|
208 |
+
add_action( 'wp_ajax_nopriv_widget_groups_list', 'groups_ajax_widget_groups_list' );
|
209 |
|
210 |
?>
|
bp-languages/buddypress.pot
CHANGED
@@ -4,7 +4,7 @@ msgid ""
|
|
4 |
msgstr ""
|
5 |
"Project-Id-Version: BuddyPress \n"
|
6 |
"Report-Msgid-Bugs-To: http://wppolyglots.wordpress.com\n"
|
7 |
-
"POT-Creation-Date: 2012-
|
8 |
"MIME-Version: 1.0\n"
|
9 |
"Content-Type: text/plain; charset=UTF-8\n"
|
10 |
"Content-Transfer-Encoding: 8bit\n"
|
@@ -437,7 +437,7 @@ msgctxt "x hours ago - akismet cleared this item"
|
|
437 |
msgid "<span>%1$s</span> — %2$s"
|
438 |
msgstr ""
|
439 |
|
440 |
-
#: bp-activity/bp-activity-classes.php:
|
441 |
#: bp-activity/bp-activity-template.php:120
|
442 |
msgid "Arguments passed to %1$s should be in an associative array. See the inline documentation at %2$s for more details."
|
443 |
msgstr ""
|
@@ -549,8 +549,8 @@ msgstr ""
|
|
549 |
#: bp-groups/bp-groups-template.php:1819 bp-groups/bp-groups-template.php:2567
|
550 |
#: bp-members/bp-members-buddybar.php:90 bp-members/bp-members-loader.php:197
|
551 |
#: bp-members/bp-members-template.php:478
|
552 |
-
#: bp-members/bp-members-template.php:
|
553 |
-
#: bp-members/bp-members-template.php:
|
554 |
#: bp-messages/bp-messages-loader.php:255
|
555 |
#: bp-messages/bp-messages-template.php:326
|
556 |
#: bp-themes/bp-default/groups/single/admin.php:185
|
@@ -703,7 +703,7 @@ msgstr ""
|
|
703 |
|
704 |
#: bp-activity/bp-activity-template.php:2112
|
705 |
#: bp-core/admin/bp-core-slugs.php:112 bp-core/admin/bp-core-slugs.php:173
|
706 |
-
#: bp-members/bp-members-template.php:
|
707 |
#: bp-themes/bp-default/activity/entry.php:37
|
708 |
#: bp-themes/bp-default/functions.php:165
|
709 |
#: bp-xprofile/bp-xprofile-loader.php:222
|
@@ -909,8 +909,8 @@ msgstr ""
|
|
909 |
|
910 |
#: bp-blogs/bp-blogs-template.php:350 bp-core/bp-core-classes.php:177
|
911 |
#: bp-groups/bp-groups-widgets.php:80 bp-groups/bp-groups-widgets.php:185
|
912 |
-
#: bp-members/bp-members-template.php:
|
913 |
-
#: bp-members/bp-members-template.php:
|
914 |
#: bp-themes/bp-default/groups/groups-loop.php:47
|
915 |
#: bp-themes/bp-default/groups/single/group-header.php:42
|
916 |
msgid "active %s"
|
@@ -1001,7 +1001,7 @@ msgstr ""
|
|
1001 |
|
1002 |
#: bp-blogs/bp-blogs-template.php:617 bp-core/deprecated/1.5.php:397
|
1003 |
#: bp-forums/bp-forums-template.php:1321 bp-groups/bp-groups-template.php:2292
|
1004 |
-
#: bp-members/bp-members-template.php:
|
1005 |
#: bp-messages/bp-messages-template.php:373 bp-themes/bp-default/header.php:30
|
1006 |
#: bp-themes/bp-default/searchform.php:5
|
1007 |
msgid "Search"
|
@@ -1631,7 +1631,7 @@ msgid "Update BuddyPress"
|
|
1631 |
msgstr ""
|
1632 |
|
1633 |
#: bp-core/bp-core-admin.php:216 bp-core/bp-core-admin.php:217
|
1634 |
-
#: bp-core/bp-core-admin.php:237 bp-members/bp-members-functions.php:
|
1635 |
msgid "BuddyPress"
|
1636 |
msgstr ""
|
1637 |
|
@@ -1719,47 +1719,47 @@ msgstr ""
|
|
1719 |
msgid "Avatar Image"
|
1720 |
msgstr ""
|
1721 |
|
1722 |
-
#: bp-core/bp-core-avatars.php:
|
1723 |
msgid "There is no error, the file uploaded with success"
|
1724 |
msgstr ""
|
1725 |
|
1726 |
-
#: bp-core/bp-core-avatars.php:
|
1727 |
msgid "Your image was bigger than the maximum allowed file size of: "
|
1728 |
msgstr ""
|
1729 |
|
1730 |
-
#: bp-core/bp-core-avatars.php:
|
1731 |
msgid "The uploaded file was only partially uploaded"
|
1732 |
msgstr ""
|
1733 |
|
1734 |
-
#: bp-core/bp-core-avatars.php:
|
1735 |
msgid "No file was uploaded"
|
1736 |
msgstr ""
|
1737 |
|
1738 |
-
#: bp-core/bp-core-avatars.php:
|
1739 |
msgid "Missing a temporary folder"
|
1740 |
msgstr ""
|
1741 |
|
1742 |
-
#: bp-core/bp-core-avatars.php:
|
1743 |
msgid "Your upload failed, please try again. Error was: %s"
|
1744 |
msgstr ""
|
1745 |
|
1746 |
-
#: bp-core/bp-core-avatars.php:
|
1747 |
msgid "The file you uploaded is too big. Please upload a file under %s"
|
1748 |
msgstr ""
|
1749 |
|
1750 |
-
#: bp-core/bp-core-avatars.php:
|
1751 |
msgid "Please upload only JPG, GIF or PNG photos."
|
1752 |
msgstr ""
|
1753 |
|
1754 |
-
#: bp-core/bp-core-avatars.php:
|
1755 |
msgid "Upload Failed! Error was: %s"
|
1756 |
msgstr ""
|
1757 |
|
1758 |
-
#: bp-core/bp-core-avatars.php:
|
1759 |
msgid "Upload failed! Error was: %s"
|
1760 |
msgstr ""
|
1761 |
|
1762 |
-
#: bp-core/bp-core-avatars.php:
|
1763 |
#: bp-core/bp-core-classes.php:175 bp-core/bp-core-classes.php:176
|
1764 |
#: bp-core/bp-core-template.php:98 bp-core/bp-core-template.php:107
|
1765 |
msgid "Avatar of %s"
|
@@ -1778,7 +1778,7 @@ msgid "Sign Up"
|
|
1778 |
msgstr ""
|
1779 |
|
1780 |
#: bp-core/bp-core-buddybar.php:537 bp-core/deprecated/1.5.php:287
|
1781 |
-
#: bp-members/bp-members-template.php:
|
1782 |
msgid "Log Out"
|
1783 |
msgstr ""
|
1784 |
|
@@ -1798,11 +1798,11 @@ msgstr ""
|
|
1798 |
msgid "Random Site"
|
1799 |
msgstr ""
|
1800 |
|
1801 |
-
#: bp-core/bp-core-catchuri.php:
|
1802 |
msgid "This user has been marked as a spammer. Only site admins can view this profile."
|
1803 |
msgstr ""
|
1804 |
|
1805 |
-
#: bp-core/bp-core-catchuri.php:
|
1806 |
msgid "You must log in to access the page you requested."
|
1807 |
msgstr ""
|
1808 |
|
@@ -1833,7 +1833,7 @@ msgstr ""
|
|
1833 |
msgid "Activate %s"
|
1834 |
msgstr ""
|
1835 |
|
1836 |
-
#: bp-core/bp-core-filters.php:255 bp-members/bp-members-functions.php:
|
1837 |
msgid ""
|
1838 |
"Thanks for registering! To complete the activation of your account please click the following link:\n"
|
1839 |
"\n"
|
@@ -1841,7 +1841,7 @@ msgid ""
|
|
1841 |
"\n"
|
1842 |
msgstr ""
|
1843 |
|
1844 |
-
#: bp-core/bp-core-filters.php:256 bp-members/bp-members-functions.php:
|
1845 |
msgid "Activate Your Account"
|
1846 |
msgstr ""
|
1847 |
|
@@ -3479,57 +3479,57 @@ msgstr ""
|
|
3479 |
msgid "<strong>ERROR</strong>: Your account has been marked as a spammer."
|
3480 |
msgstr ""
|
3481 |
|
3482 |
-
#: bp-members/bp-members-functions.php:
|
3483 |
msgid "Please enter a username"
|
3484 |
msgstr ""
|
3485 |
|
3486 |
-
#: bp-members/bp-members-functions.php:
|
3487 |
msgid "Only lowercase letters and numbers allowed"
|
3488 |
msgstr ""
|
3489 |
|
3490 |
-
#: bp-members/bp-members-functions.php:
|
3491 |
msgid "Username must be at least 4 characters"
|
3492 |
msgstr ""
|
3493 |
|
3494 |
-
#: bp-members/bp-members-functions.php:
|
3495 |
msgid "Sorry, usernames may not contain the character \"_\"!"
|
3496 |
msgstr ""
|
3497 |
|
3498 |
-
#: bp-members/bp-members-functions.php:
|
3499 |
msgid "Sorry, usernames must have letters too!"
|
3500 |
msgstr ""
|
3501 |
|
3502 |
-
#: bp-members/bp-members-functions.php:
|
3503 |
msgid "Please check your email address."
|
3504 |
msgstr ""
|
3505 |
|
3506 |
-
#: bp-members/bp-members-functions.php:
|
3507 |
-
#: bp-members/bp-members-functions.php:
|
3508 |
msgid "Sorry, that email address is not allowed!"
|
3509 |
msgstr ""
|
3510 |
|
3511 |
-
#: bp-members/bp-members-functions.php:
|
3512 |
msgid "Sorry, that username already exists!"
|
3513 |
msgstr ""
|
3514 |
|
3515 |
-
#: bp-members/bp-members-functions.php:
|
3516 |
msgid "Sorry, that email address is already used!"
|
3517 |
msgstr ""
|
3518 |
|
3519 |
-
#: bp-members/bp-members-functions.php:
|
3520 |
msgid "<strong>ERROR</strong>: Couldn’t register you... please contact the <a href=\"mailto:%s\">webmaster</a> !"
|
3521 |
msgstr ""
|
3522 |
|
3523 |
-
#: bp-members/bp-members-functions.php:
|
3524 |
-
#: bp-members/bp-members-functions.php:
|
3525 |
msgid "Invalid activation key"
|
3526 |
msgstr ""
|
3527 |
|
3528 |
-
#: bp-members/bp-members-functions.php:
|
3529 |
msgid "%s became a registered member"
|
3530 |
msgstr ""
|
3531 |
|
3532 |
-
#: bp-members/bp-members-functions.php:
|
3533 |
msgid "<strong>ERROR</strong>: Your account has not been activated. Check your email for the activation link."
|
3534 |
msgstr ""
|
3535 |
|
@@ -3583,24 +3583,24 @@ msgstr ""
|
|
3583 |
msgid "Viewing member %1$s to %2$s (of %3$s members)"
|
3584 |
msgstr ""
|
3585 |
|
3586 |
-
#: bp-members/bp-members-template.php:
|
3587 |
msgid "Never active"
|
3588 |
msgstr ""
|
3589 |
|
3590 |
-
#: bp-members/bp-members-template.php:
|
3591 |
msgctxt "member latest update in member directory"
|
3592 |
msgid "- "%s ""
|
3593 |
msgstr ""
|
3594 |
|
3595 |
-
#: bp-members/bp-members-template.php:
|
3596 |
msgid "registered %s"
|
3597 |
msgstr ""
|
3598 |
|
3599 |
-
#: bp-members/bp-members-template.php:
|
3600 |
msgid "Your Avatar"
|
3601 |
msgstr ""
|
3602 |
|
3603 |
-
#: bp-members/bp-members-template.php:
|
3604 |
msgid "Activity RSS Feed"
|
3605 |
msgstr ""
|
3606 |
|
@@ -3843,55 +3843,55 @@ msgstr ""
|
|
3843 |
msgid "Sent %s"
|
3844 |
msgstr ""
|
3845 |
|
3846 |
-
#: bp-settings/bp-settings-actions.php:
|
3847 |
msgid "That email address is invalid. Check the formatting and try again."
|
3848 |
msgstr ""
|
3849 |
|
3850 |
-
#: bp-settings/bp-settings-actions.php:
|
3851 |
msgid "That email address is currently unavailable for use."
|
3852 |
msgstr ""
|
3853 |
|
3854 |
-
#: bp-settings/bp-settings-actions.php:
|
3855 |
msgid "That email address is already taken."
|
3856 |
msgstr ""
|
3857 |
|
3858 |
-
#: bp-settings/bp-settings-actions.php:
|
3859 |
msgid "Email address cannot be empty."
|
3860 |
msgstr ""
|
3861 |
|
3862 |
-
#: bp-settings/bp-settings-actions.php:
|
3863 |
msgid "Your current password is invalid."
|
3864 |
msgstr ""
|
3865 |
|
3866 |
-
#: bp-settings/bp-settings-actions.php:
|
3867 |
msgid "The new password fields did not match."
|
3868 |
msgstr ""
|
3869 |
|
3870 |
-
#: bp-settings/bp-settings-actions.php:
|
3871 |
msgid "One of the password fields was empty."
|
3872 |
msgstr ""
|
3873 |
|
3874 |
-
#: bp-settings/bp-settings-actions.php:
|
3875 |
msgid "Your settings have been saved."
|
3876 |
msgstr ""
|
3877 |
|
3878 |
-
#: bp-settings/bp-settings-actions.php:
|
3879 |
msgid "No changes were made to your account."
|
3880 |
msgstr ""
|
3881 |
|
3882 |
-
#: bp-settings/bp-settings-actions.php:
|
3883 |
msgid "No changes were made to this account."
|
3884 |
msgstr ""
|
3885 |
|
3886 |
-
#: bp-settings/bp-settings-actions.php:
|
3887 |
msgid "Your notification settings have been saved."
|
3888 |
msgstr ""
|
3889 |
|
3890 |
-
#: bp-settings/bp-settings-actions.php:
|
3891 |
msgid "This user's notification settings have been saved."
|
3892 |
msgstr ""
|
3893 |
|
3894 |
-
#: bp-settings/bp-settings-actions.php:
|
3895 |
msgid "%s was successfully deleted."
|
3896 |
msgstr ""
|
3897 |
|
4 |
msgstr ""
|
5 |
"Project-Id-Version: BuddyPress \n"
|
6 |
"Report-Msgid-Bugs-To: http://wppolyglots.wordpress.com\n"
|
7 |
+
"POT-Creation-Date: 2012-12-10 06:36:53+00:00\n"
|
8 |
"MIME-Version: 1.0\n"
|
9 |
"Content-Type: text/plain; charset=UTF-8\n"
|
10 |
"Content-Transfer-Encoding: 8bit\n"
|
437 |
msgid "<span>%1$s</span> — %2$s"
|
438 |
msgstr ""
|
439 |
|
440 |
+
#: bp-activity/bp-activity-classes.php:122
|
441 |
#: bp-activity/bp-activity-template.php:120
|
442 |
msgid "Arguments passed to %1$s should be in an associative array. See the inline documentation at %2$s for more details."
|
443 |
msgstr ""
|
549 |
#: bp-groups/bp-groups-template.php:1819 bp-groups/bp-groups-template.php:2567
|
550 |
#: bp-members/bp-members-buddybar.php:90 bp-members/bp-members-loader.php:197
|
551 |
#: bp-members/bp-members-template.php:478
|
552 |
+
#: bp-members/bp-members-template.php:778
|
553 |
+
#: bp-members/bp-members-template.php:797
|
554 |
#: bp-messages/bp-messages-loader.php:255
|
555 |
#: bp-messages/bp-messages-template.php:326
|
556 |
#: bp-themes/bp-default/groups/single/admin.php:185
|
703 |
|
704 |
#: bp-activity/bp-activity-template.php:2112
|
705 |
#: bp-core/admin/bp-core-slugs.php:112 bp-core/admin/bp-core-slugs.php:173
|
706 |
+
#: bp-members/bp-members-template.php:583
|
707 |
#: bp-themes/bp-default/activity/entry.php:37
|
708 |
#: bp-themes/bp-default/functions.php:165
|
709 |
#: bp-xprofile/bp-xprofile-loader.php:222
|
909 |
|
910 |
#: bp-blogs/bp-blogs-template.php:350 bp-core/bp-core-classes.php:177
|
911 |
#: bp-groups/bp-groups-widgets.php:80 bp-groups/bp-groups-widgets.php:185
|
912 |
+
#: bp-members/bp-members-template.php:554
|
913 |
+
#: bp-members/bp-members-template.php:829
|
914 |
#: bp-themes/bp-default/groups/groups-loop.php:47
|
915 |
#: bp-themes/bp-default/groups/single/group-header.php:42
|
916 |
msgid "active %s"
|
1001 |
|
1002 |
#: bp-blogs/bp-blogs-template.php:617 bp-core/deprecated/1.5.php:397
|
1003 |
#: bp-forums/bp-forums-template.php:1321 bp-groups/bp-groups-template.php:2292
|
1004 |
+
#: bp-members/bp-members-template.php:668
|
1005 |
#: bp-messages/bp-messages-template.php:373 bp-themes/bp-default/header.php:30
|
1006 |
#: bp-themes/bp-default/searchform.php:5
|
1007 |
msgid "Search"
|
1631 |
msgstr ""
|
1632 |
|
1633 |
#: bp-core/bp-core-admin.php:216 bp-core/bp-core-admin.php:217
|
1634 |
+
#: bp-core/bp-core-admin.php:237 bp-members/bp-members-functions.php:1310
|
1635 |
msgid "BuddyPress"
|
1636 |
msgstr ""
|
1637 |
|
1719 |
msgid "Avatar Image"
|
1720 |
msgstr ""
|
1721 |
|
1722 |
+
#: bp-core/bp-core-avatars.php:481
|
1723 |
msgid "There is no error, the file uploaded with success"
|
1724 |
msgstr ""
|
1725 |
|
1726 |
+
#: bp-core/bp-core-avatars.php:482 bp-core/bp-core-avatars.php:483
|
1727 |
msgid "Your image was bigger than the maximum allowed file size of: "
|
1728 |
msgstr ""
|
1729 |
|
1730 |
+
#: bp-core/bp-core-avatars.php:484
|
1731 |
msgid "The uploaded file was only partially uploaded"
|
1732 |
msgstr ""
|
1733 |
|
1734 |
+
#: bp-core/bp-core-avatars.php:485
|
1735 |
msgid "No file was uploaded"
|
1736 |
msgstr ""
|
1737 |
|
1738 |
+
#: bp-core/bp-core-avatars.php:486
|
1739 |
msgid "Missing a temporary folder"
|
1740 |
msgstr ""
|
1741 |
|
1742 |
+
#: bp-core/bp-core-avatars.php:490
|
1743 |
msgid "Your upload failed, please try again. Error was: %s"
|
1744 |
msgstr ""
|
1745 |
|
1746 |
+
#: bp-core/bp-core-avatars.php:495
|
1747 |
msgid "The file you uploaded is too big. Please upload a file under %s"
|
1748 |
msgstr ""
|
1749 |
|
1750 |
+
#: bp-core/bp-core-avatars.php:500
|
1751 |
msgid "Please upload only JPG, GIF or PNG photos."
|
1752 |
msgstr ""
|
1753 |
|
1754 |
+
#: bp-core/bp-core-avatars.php:511 bp-core/bp-core-avatars.php:546
|
1755 |
msgid "Upload Failed! Error was: %s"
|
1756 |
msgstr ""
|
1757 |
|
1758 |
+
#: bp-core/bp-core-avatars.php:561
|
1759 |
msgid "Upload failed! Error was: %s"
|
1760 |
msgstr ""
|
1761 |
|
1762 |
+
#: bp-core/bp-core-avatars.php:696 bp-core/bp-core-classes.php:174
|
1763 |
#: bp-core/bp-core-classes.php:175 bp-core/bp-core-classes.php:176
|
1764 |
#: bp-core/bp-core-template.php:98 bp-core/bp-core-template.php:107
|
1765 |
msgid "Avatar of %s"
|
1778 |
msgstr ""
|
1779 |
|
1780 |
#: bp-core/bp-core-buddybar.php:537 bp-core/deprecated/1.5.php:287
|
1781 |
+
#: bp-members/bp-members-template.php:732 bp-themes/bp-default/sidebar.php:18
|
1782 |
msgid "Log Out"
|
1783 |
msgstr ""
|
1784 |
|
1798 |
msgid "Random Site"
|
1799 |
msgstr ""
|
1800 |
|
1801 |
+
#: bp-core/bp-core-catchuri.php:281
|
1802 |
msgid "This user has been marked as a spammer. Only site admins can view this profile."
|
1803 |
msgstr ""
|
1804 |
|
1805 |
+
#: bp-core/bp-core-catchuri.php:455 bp-core/bp-core-catchuri.php:514
|
1806 |
msgid "You must log in to access the page you requested."
|
1807 |
msgstr ""
|
1808 |
|
1833 |
msgid "Activate %s"
|
1834 |
msgstr ""
|
1835 |
|
1836 |
+
#: bp-core/bp-core-filters.php:255 bp-members/bp-members-functions.php:1312
|
1837 |
msgid ""
|
1838 |
"Thanks for registering! To complete the activation of your account please click the following link:\n"
|
1839 |
"\n"
|
1841 |
"\n"
|
1842 |
msgstr ""
|
1843 |
|
1844 |
+
#: bp-core/bp-core-filters.php:256 bp-members/bp-members-functions.php:1313
|
1845 |
msgid "Activate Your Account"
|
1846 |
msgstr ""
|
1847 |
|
3479 |
msgid "<strong>ERROR</strong>: Your account has been marked as a spammer."
|
3480 |
msgstr ""
|
3481 |
|
3482 |
+
#: bp-members/bp-members-functions.php:1038
|
3483 |
msgid "Please enter a username"
|
3484 |
msgstr ""
|
3485 |
|
3486 |
+
#: bp-members/bp-members-functions.php:1046
|
3487 |
msgid "Only lowercase letters and numbers allowed"
|
3488 |
msgstr ""
|
3489 |
|
3490 |
+
#: bp-members/bp-members-functions.php:1049
|
3491 |
msgid "Username must be at least 4 characters"
|
3492 |
msgstr ""
|
3493 |
|
3494 |
+
#: bp-members/bp-members-functions.php:1052
|
3495 |
msgid "Sorry, usernames may not contain the character \"_\"!"
|
3496 |
msgstr ""
|
3497 |
|
3498 |
+
#: bp-members/bp-members-functions.php:1059
|
3499 |
msgid "Sorry, usernames must have letters too!"
|
3500 |
msgstr ""
|
3501 |
|
3502 |
+
#: bp-members/bp-members-functions.php:1062
|
3503 |
msgid "Please check your email address."
|
3504 |
msgstr ""
|
3505 |
|
3506 |
+
#: bp-members/bp-members-functions.php:1065
|
3507 |
+
#: bp-members/bp-members-functions.php:1073
|
3508 |
msgid "Sorry, that email address is not allowed!"
|
3509 |
msgstr ""
|
3510 |
|
3511 |
+
#: bp-members/bp-members-functions.php:1078
|
3512 |
msgid "Sorry, that username already exists!"
|
3513 |
msgstr ""
|
3514 |
|
3515 |
+
#: bp-members/bp-members-functions.php:1082
|
3516 |
msgid "Sorry, that email address is already used!"
|
3517 |
msgstr ""
|
3518 |
|
3519 |
+
#: bp-members/bp-members-functions.php:1121
|
3520 |
msgid "<strong>ERROR</strong>: Couldn’t register you... please contact the <a href=\"mailto:%s\">webmaster</a> !"
|
3521 |
msgstr ""
|
3522 |
|
3523 |
+
#: bp-members/bp-members-functions.php:1219
|
3524 |
+
#: bp-members/bp-members-functions.php:1223
|
3525 |
msgid "Invalid activation key"
|
3526 |
msgstr ""
|
3527 |
|
3528 |
+
#: bp-members/bp-members-functions.php:1260
|
3529 |
msgid "%s became a registered member"
|
3530 |
msgstr ""
|
3531 |
|
3532 |
+
#: bp-members/bp-members-functions.php:1346
|
3533 |
msgid "<strong>ERROR</strong>: Your account has not been activated. Check your email for the activation link."
|
3534 |
msgstr ""
|
3535 |
|
3583 |
msgid "Viewing member %1$s to %2$s (of %3$s members)"
|
3584 |
msgstr ""
|
3585 |
|
3586 |
+
#: bp-members/bp-members-template.php:556
|
3587 |
msgid "Never active"
|
3588 |
msgstr ""
|
3589 |
|
3590 |
+
#: bp-members/bp-members-template.php:578
|
3591 |
msgctxt "member latest update in member directory"
|
3592 |
msgid "- "%s ""
|
3593 |
msgstr ""
|
3594 |
|
3595 |
+
#: bp-members/bp-members-template.php:635
|
3596 |
msgid "registered %s"
|
3597 |
msgstr ""
|
3598 |
|
3599 |
+
#: bp-members/bp-members-template.php:1077
|
3600 |
msgid "Your Avatar"
|
3601 |
msgstr ""
|
3602 |
|
3603 |
+
#: bp-members/bp-members-template.php:1147
|
3604 |
msgid "Activity RSS Feed"
|
3605 |
msgstr ""
|
3606 |
|
3843 |
msgid "Sent %s"
|
3844 |
msgstr ""
|
3845 |
|
3846 |
+
#: bp-settings/bp-settings-actions.php:157
|
3847 |
msgid "That email address is invalid. Check the formatting and try again."
|
3848 |
msgstr ""
|
3849 |
|
3850 |
+
#: bp-settings/bp-settings-actions.php:160
|
3851 |
msgid "That email address is currently unavailable for use."
|
3852 |
msgstr ""
|
3853 |
|
3854 |
+
#: bp-settings/bp-settings-actions.php:163
|
3855 |
msgid "That email address is already taken."
|
3856 |
msgstr ""
|
3857 |
|
3858 |
+
#: bp-settings/bp-settings-actions.php:166
|
3859 |
msgid "Email address cannot be empty."
|
3860 |
msgstr ""
|
3861 |
|
3862 |
+
#: bp-settings/bp-settings-actions.php:176
|
3863 |
msgid "Your current password is invalid."
|
3864 |
msgstr ""
|
3865 |
|
3866 |
+
#: bp-settings/bp-settings-actions.php:179
|
3867 |
msgid "The new password fields did not match."
|
3868 |
msgstr ""
|
3869 |
|
3870 |
+
#: bp-settings/bp-settings-actions.php:182
|
3871 |
msgid "One of the password fields was empty."
|
3872 |
msgstr ""
|
3873 |
|
3874 |
+
#: bp-settings/bp-settings-actions.php:191
|
3875 |
msgid "Your settings have been saved."
|
3876 |
msgstr ""
|
3877 |
|
3878 |
+
#: bp-settings/bp-settings-actions.php:197
|
3879 |
msgid "No changes were made to your account."
|
3880 |
msgstr ""
|
3881 |
|
3882 |
+
#: bp-settings/bp-settings-actions.php:199
|
3883 |
msgid "No changes were made to this account."
|
3884 |
msgstr ""
|
3885 |
|
3886 |
+
#: bp-settings/bp-settings-actions.php:247
|
3887 |
msgid "Your notification settings have been saved."
|
3888 |
msgstr ""
|
3889 |
|
3890 |
+
#: bp-settings/bp-settings-actions.php:249
|
3891 |
msgid "This user's notification settings have been saved."
|
3892 |
msgstr ""
|
3893 |
|
3894 |
+
#: bp-settings/bp-settings-actions.php:340
|
3895 |
msgid "%s was successfully deleted."
|
3896 |
msgstr ""
|
3897 |
|
bp-loader.php
CHANGED
@@ -14,7 +14,7 @@
|
|
14 |
* Description: Social networking in a box. Build a social network for your company, school, sports team or niche community all based on the power and flexibility of WordPress.
|
15 |
* Author: The BuddyPress Community
|
16 |
* Author URI: http://buddypress.org/community/members/
|
17 |
-
* Version: 1.6.
|
18 |
* Text Domain: buddypress
|
19 |
* Domain Path: /bp-languages/
|
20 |
*/
|
@@ -52,7 +52,7 @@ class BuddyPress {
|
|
52 |
/**
|
53 |
* @var string BuddyPress version
|
54 |
*/
|
55 |
-
public $version = '1.6.
|
56 |
|
57 |
/**
|
58 |
* @var int Database version of current BuddyPress files
|
@@ -485,5 +485,3 @@ class BuddyPress {
|
|
485 |
$GLOBALS['bp'] = new BuddyPress;
|
486 |
|
487 |
endif;
|
488 |
-
|
489 |
-
?>
|
14 |
* Description: Social networking in a box. Build a social network for your company, school, sports team or niche community all based on the power and flexibility of WordPress.
|
15 |
* Author: The BuddyPress Community
|
16 |
* Author URI: http://buddypress.org/community/members/
|
17 |
+
* Version: 1.6.2
|
18 |
* Text Domain: buddypress
|
19 |
* Domain Path: /bp-languages/
|
20 |
*/
|
52 |
/**
|
53 |
* @var string BuddyPress version
|
54 |
*/
|
55 |
+
public $version = '1.6.2';
|
56 |
|
57 |
/**
|
58 |
* @var int Database version of current BuddyPress files
|
485 |
$GLOBALS['bp'] = new BuddyPress;
|
486 |
|
487 |
endif;
|
|
|
|
bp-members/bp-members-functions.php
CHANGED
@@ -478,7 +478,7 @@ function bp_core_get_total_member_count() {
|
|
478 |
|
479 |
if ( !$count = wp_cache_get( 'bp_total_member_count', 'bp' ) ) {
|
480 |
$status_sql = bp_core_get_status_sql();
|
481 |
-
$count = $wpdb->get_var(
|
482 |
wp_cache_set( 'bp_total_member_count', $count, 'bp' );
|
483 |
}
|
484 |
|
@@ -496,15 +496,15 @@ function bp_core_get_active_member_count() {
|
|
496 |
if ( !$count = get_transient( 'bp_active_member_count' ) ) {
|
497 |
// Avoid a costly join by splitting the lookup
|
498 |
if ( is_multisite() ) {
|
499 |
-
$sql =
|
500 |
} else {
|
501 |
-
$sql =
|
502 |
}
|
503 |
|
504 |
$exclude_users = $wpdb->get_col( $sql );
|
505 |
-
$exclude_users_sql = !empty( $exclude_users ) ?
|
506 |
|
507 |
-
$count = (int) $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(user_id) FROM $wpdb->usermeta WHERE meta_key = %s {$exclude_users_sql}", bp_get_user_meta_key( 'last_activity' ) ) );
|
508 |
set_transient( 'bp_active_member_count', $count );
|
509 |
}
|
510 |
|
@@ -770,7 +770,7 @@ function bp_core_get_all_posts_for_user( $user_id = 0 ) {
|
|
770 |
if ( empty( $user_id ) )
|
771 |
$user_id = bp_displayed_user_id();
|
772 |
|
773 |
-
return apply_filters( 'bp_core_get_all_posts_for_user', $wpdb->get_col( $wpdb->prepare( "SELECT ID FROM $wpdb->posts WHERE post_author = %d AND post_status = 'publish' AND post_type = 'post'", $user_id ) ) );
|
774 |
}
|
775 |
|
776 |
/**
|
@@ -969,9 +969,59 @@ function bp_core_get_illegal_names( $value = '', $oldvalue = '' ) {
|
|
969 |
}
|
970 |
add_filter( 'pre_update_site_option_illegal_names', 'bp_core_get_illegal_names', 10, 2 );
|
971 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
972 |
/**
|
973 |
* Validate a user name and email address when creating a new user.
|
974 |
*
|
|
|
|
|
975 |
* @param string $user_name Username to validate
|
976 |
* @param string $user_email Email address to validate
|
977 |
* @return array Results of user validation including errors, if any
|
@@ -1073,7 +1123,7 @@ function bp_core_signup_user( $user_login, $user_password, $user_email, $usermet
|
|
1073 |
}
|
1074 |
|
1075 |
// Update the user status to '2' which we will use as 'not activated' (0 = active, 1 = spam, 2 = not active)
|
1076 |
-
$wpdb->query( $wpdb->prepare( "UPDATE $wpdb->users SET user_status = 2 WHERE ID = %d", $user_id ) );
|
1077 |
|
1078 |
// Set any profile data
|
1079 |
if ( bp_is_active( 'xprofile' ) ) {
|
@@ -1163,13 +1213,13 @@ function bp_core_activate_signup( $key ) {
|
|
1163 |
} else {
|
1164 |
|
1165 |
// Get the user_id based on the $key
|
1166 |
-
$user_id = $wpdb->get_var( $wpdb->prepare( "SELECT user_id FROM $wpdb->usermeta WHERE meta_key = 'activation_key' AND meta_value = %s", $key ) );
|
1167 |
|
1168 |
if ( empty( $user_id ) )
|
1169 |
return new WP_Error( 'invalid_key', __( 'Invalid activation key', 'buddypress' ) );
|
1170 |
|
1171 |
// Change the user's status so they become active
|
1172 |
-
if ( !$wpdb->query( $wpdb->prepare( "UPDATE $wpdb->users SET user_status = 0 WHERE ID = %d", $user_id ) ) )
|
1173 |
return new WP_Error( 'invalid_key', __( 'Invalid activation key', 'buddypress' ) );
|
1174 |
|
1175 |
// Notify the site admin of a new user registration
|
@@ -1184,7 +1234,7 @@ function bp_core_activate_signup( $key ) {
|
|
1184 |
|
1185 |
// Set the password on multisite installs
|
1186 |
if ( is_multisite() && !empty( $user['meta']['password'] ) )
|
1187 |
-
$wpdb->query( $wpdb->prepare( "UPDATE $wpdb->users SET user_pass = %s WHERE ID = %d", $user['meta']['password'], $user_id ) );
|
1188 |
|
1189 |
do_action( 'bp_core_activated_user', $user_id, $key, $user );
|
1190 |
|
478 |
|
479 |
if ( !$count = wp_cache_get( 'bp_total_member_count', 'bp' ) ) {
|
480 |
$status_sql = bp_core_get_status_sql();
|
481 |
+
$count = $wpdb->get_var( "SELECT COUNT(ID) FROM $wpdb->users WHERE {$status_sql}" );
|
482 |
wp_cache_set( 'bp_total_member_count', $count, 'bp' );
|
483 |
}
|
484 |
|
496 |
if ( !$count = get_transient( 'bp_active_member_count' ) ) {
|
497 |
// Avoid a costly join by splitting the lookup
|
498 |
if ( is_multisite() ) {
|
499 |
+
$sql = "SELECT ID FROM $wpdb->users WHERE (user_status != 0 OR deleted != 0 OR user_status != 0)";
|
500 |
} else {
|
501 |
+
$sql = "SELECT ID FROM $wpdb->users WHERE user_status != 0";
|
502 |
}
|
503 |
|
504 |
$exclude_users = $wpdb->get_col( $sql );
|
505 |
+
$exclude_users_sql = !empty( $exclude_users ) ? "AND user_id NOT IN (" . implode( ',', wp_parse_id_list( $exclude_users ) ) . ")" : '';
|
506 |
|
507 |
+
$count = (int) $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(user_id) FROM {$wpdb->usermeta} WHERE meta_key = %s {$exclude_users_sql}", bp_get_user_meta_key( 'last_activity' ) ) );
|
508 |
set_transient( 'bp_active_member_count', $count );
|
509 |
}
|
510 |
|
770 |
if ( empty( $user_id ) )
|
771 |
$user_id = bp_displayed_user_id();
|
772 |
|
773 |
+
return apply_filters( 'bp_core_get_all_posts_for_user', $wpdb->get_col( $wpdb->prepare( "SELECT ID FROM {$wpdb->posts} WHERE post_author = %d AND post_status = 'publish' AND post_type = 'post'", $user_id ) ) );
|
774 |
}
|
775 |
|
776 |
/**
|
969 |
}
|
970 |
add_filter( 'pre_update_site_option_illegal_names', 'bp_core_get_illegal_names', 10, 2 );
|
971 |
|
972 |
+
/**
|
973 |
+
* Check that an email address is valid for use
|
974 |
+
*
|
975 |
+
* Performs the following checks:
|
976 |
+
* - Is the email address well-formed?
|
977 |
+
* - Is the email address already used?
|
978 |
+
* - If there's an email domain blacklist, is the current domain on it?
|
979 |
+
* - If there's an email domain whitelest, is the current domain on it?
|
980 |
+
*
|
981 |
+
* @since 1.6.2
|
982 |
+
*
|
983 |
+
* @param string $user_email The email being checked
|
984 |
+
* @return bool|array True if the address passes all checks; otherwise an array
|
985 |
+
* of error codes
|
986 |
+
*/
|
987 |
+
function bp_core_validate_email_address( $user_email ) {
|
988 |
+
$errors = array();
|
989 |
+
|
990 |
+
$user_email = sanitize_email( $user_email );
|
991 |
+
|
992 |
+
// Is the email well-formed?
|
993 |
+
if ( ! is_email( $user_email ) )
|
994 |
+
$errors['invalid'] = 1;
|
995 |
+
|
996 |
+
// Is the email on the Banned Email Domains list?
|
997 |
+
// Note: This check only works on Multisite
|
998 |
+
if ( function_exists( 'is_email_address_unsafe' ) && is_email_address_unsafe( $user_email ) )
|
999 |
+
$errors['domain_banned'] = 1;
|
1000 |
+
|
1001 |
+
// Is the email on the Limited Email Domains list?
|
1002 |
+
// Note: This check only works on Multisite
|
1003 |
+
$limited_email_domains = get_site_option( 'limited_email_domains' );
|
1004 |
+
if ( is_array( $limited_email_domains ) && empty( $limited_email_domains ) == false ) {
|
1005 |
+
$emaildomain = substr( $user_email, 1 + strpos( $user_email, '@' ) );
|
1006 |
+
if ( ! in_array( $emaildomain, $limited_email_domains ) ) {
|
1007 |
+
$errors['domain_not_allowed'] = 1;
|
1008 |
+
}
|
1009 |
+
}
|
1010 |
+
|
1011 |
+
// Is the email alreday in use?
|
1012 |
+
if ( email_exists( $user_email ) )
|
1013 |
+
$errors['in_use'] = 1;
|
1014 |
+
|
1015 |
+
$retval = ! empty( $errors ) ? $errors : true;
|
1016 |
+
|
1017 |
+
return apply_filters( 'bp_core_validate_email_address', $retval, $user_email );
|
1018 |
+
}
|
1019 |
+
|
1020 |
/**
|
1021 |
* Validate a user name and email address when creating a new user.
|
1022 |
*
|
1023 |
+
* @todo Refactor to use bp_core_validate_email_address()
|
1024 |
+
*
|
1025 |
* @param string $user_name Username to validate
|
1026 |
* @param string $user_email Email address to validate
|
1027 |
* @return array Results of user validation including errors, if any
|
1123 |
}
|
1124 |
|
1125 |
// Update the user status to '2' which we will use as 'not activated' (0 = active, 1 = spam, 2 = not active)
|
1126 |
+
$wpdb->query( $wpdb->prepare( "UPDATE {$wpdb->users} SET user_status = 2 WHERE ID = %d", $user_id ) );
|
1127 |
|
1128 |
// Set any profile data
|
1129 |
if ( bp_is_active( 'xprofile' ) ) {
|
1213 |
} else {
|
1214 |
|
1215 |
// Get the user_id based on the $key
|
1216 |
+
$user_id = $wpdb->get_var( $wpdb->prepare( "SELECT user_id FROM {$wpdb->usermeta} WHERE meta_key = 'activation_key' AND meta_value = %s", $key ) );
|
1217 |
|
1218 |
if ( empty( $user_id ) )
|
1219 |
return new WP_Error( 'invalid_key', __( 'Invalid activation key', 'buddypress' ) );
|
1220 |
|
1221 |
// Change the user's status so they become active
|
1222 |
+
if ( !$wpdb->query( $wpdb->prepare( "UPDATE {$wpdb->users} SET user_status = 0 WHERE ID = %d", $user_id ) ) )
|
1223 |
return new WP_Error( 'invalid_key', __( 'Invalid activation key', 'buddypress' ) );
|
1224 |
|
1225 |
// Notify the site admin of a new user registration
|
1234 |
|
1235 |
// Set the password on multisite installs
|
1236 |
if ( is_multisite() && !empty( $user['meta']['password'] ) )
|
1237 |
+
$wpdb->query( $wpdb->prepare( "UPDATE {$wpdb->users} SET user_pass = %s WHERE ID = %d", $user['meta']['password'], $user_id ) );
|
1238 |
|
1239 |
do_action( 'bp_core_activated_user', $user_id, $key, $user );
|
1240 |
|
bp-members/bp-members-template.php
CHANGED
@@ -540,8 +540,9 @@ function bp_member_name() {
|
|
540 |
return apply_filters( 'bp_get_member_name', $members_template->member->fullname );
|
541 |
}
|
542 |
add_filter( 'bp_get_member_name', 'wp_filter_kses' );
|
543 |
-
add_filter( 'bp_get_member_name', 'stripslashes'
|
544 |
-
add_filter( 'bp_get_member_name', 'strip_tags'
|
|
|
545 |
|
546 |
function bp_member_last_active() {
|
547 |
echo bp_get_member_last_active();
|
540 |
return apply_filters( 'bp_get_member_name', $members_template->member->fullname );
|
541 |
}
|
542 |
add_filter( 'bp_get_member_name', 'wp_filter_kses' );
|
543 |
+
add_filter( 'bp_get_member_name', 'stripslashes' );
|
544 |
+
add_filter( 'bp_get_member_name', 'strip_tags' );
|
545 |
+
add_filter( 'bp_get_member_name', 'esc_html' );
|
546 |
|
547 |
function bp_member_last_active() {
|
548 |
echo bp_get_member_last_active();
|
bp-messages/bp-messages-classes.php
CHANGED
@@ -144,9 +144,9 @@ class BP_Messages_Thread {
|
|
144 |
$pag_sql = $wpdb->prepare( " LIMIT %d, %d", intval( ( $page - 1 ) * $limit), intval( $limit ) );
|
145 |
|
146 |
if ( $type == 'unread' )
|
147 |
-
$type_sql =
|
148 |
elseif ( $type == 'read' )
|
149 |
-
$type_sql =
|
150 |
|
151 |
if ( !empty( $search_terms ) ) {
|
152 |
$search_terms = like_escape( $wpdb->escape( $search_terms ) );
|
@@ -199,9 +199,9 @@ class BP_Messages_Thread {
|
|
199 |
$exclude_sender = ' AND sender_only != 1';
|
200 |
|
201 |
if ( $type == 'unread' )
|
202 |
-
$type_sql =
|
203 |
else if ( $type == 'read' )
|
204 |
-
$type_sql =
|
205 |
|
206 |
return (int) $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(thread_id) FROM {$bp->messages->table_name_recipients} WHERE user_id = %d AND is_deleted = 0$exclude_sender $type_sql", $user_id ) );
|
207 |
}
|
@@ -282,7 +282,7 @@ class BP_Messages_Thread {
|
|
282 |
|
283 |
$bp_prefix = bp_core_get_table_prefix();
|
284 |
$errors = false;
|
285 |
-
$threads = $wpdb->get_results(
|
286 |
|
287 |
// Nothing to update, just return true to remove the table
|
288 |
if ( empty( $threads ) )
|
@@ -357,7 +357,7 @@ class BP_Messages_Message {
|
|
357 |
|
358 |
// If we have no thread_id then this is the first message of a new thread.
|
359 |
if ( empty( $this->thread_id ) ) {
|
360 |
-
$this->thread_id = (int) $wpdb->get_var(
|
361 |
$new_thread = true;
|
362 |
}
|
363 |
|
@@ -538,7 +538,7 @@ class BP_Messages_Notice {
|
|
538 |
$limit_sql = $wpdb->prepare( "LIMIT %d, %d", (int) ( ( $pag_page - 1 ) * $pag_num ), (int) $pag_num );
|
539 |
}
|
540 |
|
541 |
-
$notices = $wpdb->get_results(
|
542 |
|
543 |
return $notices;
|
544 |
}
|
@@ -546,7 +546,7 @@ class BP_Messages_Notice {
|
|
546 |
function get_total_notice_count() {
|
547 |
global $wpdb, $bp;
|
548 |
|
549 |
-
$notice_count = $wpdb->get_var(
|
550 |
|
551 |
return $notice_count;
|
552 |
}
|
@@ -554,7 +554,7 @@ class BP_Messages_Notice {
|
|
554 |
function get_active() {
|
555 |
global $wpdb, $bp;
|
556 |
|
557 |
-
$notice_id = $wpdb->get_var(
|
558 |
return new BP_Messages_Notice( $notice_id );
|
559 |
}
|
560 |
}
|
144 |
$pag_sql = $wpdb->prepare( " LIMIT %d, %d", intval( ( $page - 1 ) * $limit), intval( $limit ) );
|
145 |
|
146 |
if ( $type == 'unread' )
|
147 |
+
$type_sql = " AND r.unread_count != 0 ";
|
148 |
elseif ( $type == 'read' )
|
149 |
+
$type_sql = " AND r.unread_count = 0 ";
|
150 |
|
151 |
if ( !empty( $search_terms ) ) {
|
152 |
$search_terms = like_escape( $wpdb->escape( $search_terms ) );
|
199 |
$exclude_sender = ' AND sender_only != 1';
|
200 |
|
201 |
if ( $type == 'unread' )
|
202 |
+
$type_sql = " AND unread_count != 0 ";
|
203 |
else if ( $type == 'read' )
|
204 |
+
$type_sql = " AND unread_count = 0 ";
|
205 |
|
206 |
return (int) $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(thread_id) FROM {$bp->messages->table_name_recipients} WHERE user_id = %d AND is_deleted = 0$exclude_sender $type_sql", $user_id ) );
|
207 |
}
|
282 |
|
283 |
$bp_prefix = bp_core_get_table_prefix();
|
284 |
$errors = false;
|
285 |
+
$threads = $wpdb->get_results( "SELECT * FROM {$bp_prefix}bp_messages_threads" );
|
286 |
|
287 |
// Nothing to update, just return true to remove the table
|
288 |
if ( empty( $threads ) )
|
357 |
|
358 |
// If we have no thread_id then this is the first message of a new thread.
|
359 |
if ( empty( $this->thread_id ) ) {
|
360 |
+
$this->thread_id = (int) $wpdb->get_var( "SELECT MAX(thread_id) FROM {$bp->messages->table_name_messages}" ) + 1;
|
361 |
$new_thread = true;
|
362 |
}
|
363 |
|
538 |
$limit_sql = $wpdb->prepare( "LIMIT %d, %d", (int) ( ( $pag_page - 1 ) * $pag_num ), (int) $pag_num );
|
539 |
}
|
540 |
|
541 |
+
$notices = $wpdb->get_results( "SELECT * FROM {$bp->messages->table_name_notices} ORDER BY date_sent DESC {$limit_sql}" );
|
542 |
|
543 |
return $notices;
|
544 |
}
|
546 |
function get_total_notice_count() {
|
547 |
global $wpdb, $bp;
|
548 |
|
549 |
+
$notice_count = $wpdb->get_var( "SELECT COUNT(id) FROM " . $bp->messages->table_name_notices );
|
550 |
|
551 |
return $notice_count;
|
552 |
}
|
554 |
function get_active() {
|
555 |
global $wpdb, $bp;
|
556 |
|
557 |
+
$notice_id = $wpdb->get_var( "SELECT id FROM {$bp->messages->table_name_notices} WHERE is_active = 1" );
|
558 |
return new BP_Messages_Notice( $notice_id );
|
559 |
}
|
560 |
}
|
bp-messages/js/autocomplete/license.bgiframe.txt
CHANGED
@@ -1,20 +1,20 @@
|
|
1 |
-
Copyright 2010, Brandon Aaron (http://brandonaaron.net/)
|
2 |
-
|
3 |
-
Permission is hereby granted, free of charge, to any person obtaining
|
4 |
-
a copy of this software and associated documentation files (the
|
5 |
-
"Software"), to deal in the Software without restriction, including
|
6 |
-
without limitation the rights to use, copy, modify, merge, publish,
|
7 |
-
distribute, sublicense, and/or sell copies of the Software, and to
|
8 |
-
permit persons to whom the Software is furnished to do so, subject to
|
9 |
-
the following conditions:
|
10 |
-
|
11 |
-
The above copyright notice and this permission notice shall be
|
12 |
-
included in all copies or substantial portions of the Software.
|
13 |
-
|
14 |
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
15 |
-
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
16 |
-
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
17 |
-
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
18 |
-
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
19 |
-
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
20 |
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
1 |
+
Copyright 2010, Brandon Aaron (http://brandonaaron.net/)
|
2 |
+
|
3 |
+
Permission is hereby granted, free of charge, to any person obtaining
|
4 |
+
a copy of this software and associated documentation files (the
|
5 |
+
"Software"), to deal in the Software without restriction, including
|
6 |
+
without limitation the rights to use, copy, modify, merge, publish,
|
7 |
+
distribute, sublicense, and/or sell copies of the Software, and to
|
8 |
+
permit persons to whom the Software is furnished to do so, subject to
|
9 |
+
the following conditions:
|
10 |
+
|
11 |
+
The above copyright notice and this permission notice shall be
|
12 |
+
included in all copies or substantial portions of the Software.
|
13 |
+
|
14 |
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
15 |
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
16 |
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
17 |
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
18 |
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
19 |
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
20 |
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
bp-settings/bp-settings-actions.php
CHANGED
@@ -71,25 +71,21 @@ function bp_settings_action_general() {
|
|
71 |
// User is changing email address
|
72 |
if ( $bp->displayed_user->userdata->user_email != $user_email ) {
|
73 |
|
74 |
-
//
|
75 |
-
|
76 |
-
$email_error = 'invalid';
|
77 |
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
if ( is_array( $limited_email_domains ) && empty( $limited_email_domains ) == false ) {
|
83 |
-
$emaildomain = substr( $user_email, 1 + strpos( $user_email, '@' ) );
|
84 |
|
85 |
-
if (
|
86 |
$email_error = 'blocked';
|
87 |
}
|
88 |
-
}
|
89 |
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
}
|
94 |
|
95 |
// Yay we made it!
|
@@ -242,9 +238,7 @@ function bp_settings_action_notifications() {
|
|
242 |
|
243 |
if ( isset( $_POST['notifications'] ) ) {
|
244 |
foreach ( (array) $_POST['notifications'] as $key => $value ) {
|
245 |
-
|
246 |
-
bp_update_user_meta( (int) bp_displayed_user_id(), $meta_key, $value );
|
247 |
-
}
|
248 |
}
|
249 |
}
|
250 |
|
71 |
// User is changing email address
|
72 |
if ( $bp->displayed_user->userdata->user_email != $user_email ) {
|
73 |
|
74 |
+
// Run some tests on the email address
|
75 |
+
$email_checks = bp_core_validate_email_address( $user_email );
|
|
|
76 |
|
77 |
+
if ( true !== $email_checks ) {
|
78 |
+
if ( isset( $email_checks['invalid'] ) ) {
|
79 |
+
$email_error = 'invalid';
|
80 |
+
}
|
|
|
|
|
81 |
|
82 |
+
if ( isset( $email_checks['domain_banned'] ) || isset( $email_checks['domain_not_allowed'] ) ) {
|
83 |
$email_error = 'blocked';
|
84 |
}
|
|
|
85 |
|
86 |
+
if ( isset( $email_checks['in_use'] ) ) {
|
87 |
+
$email_error = 'taken';
|
88 |
+
}
|
89 |
}
|
90 |
|
91 |
// Yay we made it!
|
238 |
|
239 |
if ( isset( $_POST['notifications'] ) ) {
|
240 |
foreach ( (array) $_POST['notifications'] as $key => $value ) {
|
241 |
+
bp_update_user_meta( (int) bp_displayed_user_id(), $key, $value );
|
|
|
|
|
242 |
}
|
243 |
}
|
244 |
|
bp-themes/bp-default/blogs/create.php
CHANGED
@@ -44,5 +44,4 @@ get_header( 'buddypress' ); ?>
|
|
44 |
<?php do_action( 'bp_after_directory_blogs_content' ); ?>
|
45 |
|
46 |
<?php get_sidebar( 'buddypress' ); ?>
|
47 |
-
<?php get_footer( 'buddypress' ); ?>
|
48 |
-
|
44 |
<?php do_action( 'bp_after_directory_blogs_content' ); ?>
|
45 |
|
46 |
<?php get_sidebar( 'buddypress' ); ?>
|
47 |
+
<?php get_footer( 'buddypress' ); ?>
|
|
bp-themes/bp-default/groups/index.php
CHANGED
@@ -88,5 +88,4 @@ get_header( 'buddypress' ); ?>
|
|
88 |
<?php do_action( 'bp_after_directory_groups_page' ); ?>
|
89 |
|
90 |
<?php get_sidebar( 'buddypress' ); ?>
|
91 |
-
<?php get_footer( 'buddypress' ); ?>
|
92 |
-
|
88 |
<?php do_action( 'bp_after_directory_groups_page' ); ?>
|
89 |
|
90 |
<?php get_sidebar( 'buddypress' ); ?>
|
91 |
+
<?php get_footer( 'buddypress' ); ?>
|
|
bp-themes/bp-default/groups/single/forum.php
CHANGED
@@ -93,5 +93,4 @@ else : ?>
|
|
93 |
|
94 |
<?php endif; ?>
|
95 |
|
96 |
-
<?php endif; ?>
|
97 |
-
|
93 |
|
94 |
<?php endif; ?>
|
95 |
|
96 |
+
<?php endif; ?>
|
|
bp-themes/bp-default/license.txt
CHANGED
@@ -1,280 +1,280 @@
|
|
1 |
-
GNU GENERAL PUBLIC LICENSE
|
2 |
-
Version 2, June 1991
|
3 |
-
|
4 |
-
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
|
5 |
-
675 Mass Ave, Cambridge, MA 02139, USA
|
6 |
-
Everyone is permitted to copy and distribute verbatim copies
|
7 |
-
of this license document, but changing it is not allowed.
|
8 |
-
|
9 |
-
Preamble
|
10 |
-
|
11 |
-
The licenses for most software are designed to take away your
|
12 |
-
freedom to share and change it. By contrast, the GNU General Public
|
13 |
-
License is intended to guarantee your freedom to share and change free
|
14 |
-
software--to make sure the software is free for all its users. This
|
15 |
-
General Public License applies to most of the Free Software
|
16 |
-
Foundation's software and to any other program whose authors commit to
|
17 |
-
using it. (Some other Free Software Foundation software is covered by
|
18 |
-
the GNU Library General Public License instead.) You can apply it to
|
19 |
-
your programs, too.
|
20 |
-
|
21 |
-
When we speak of free software, we are referring to freedom, not
|
22 |
-
price. Our General Public Licenses are designed to make sure that you
|
23 |
-
have the freedom to distribute copies of free software (and charge for
|
24 |
-
this service if you wish), that you receive source code or can get it
|
25 |
-
if you want it, that you can change the software or use pieces of it
|
26 |
-
in new free programs; and that you know you can do these things.
|
27 |
-
|
28 |
-
To protect your rights, we need to make restrictions that forbid
|
29 |
-
anyone to deny you these rights or to ask you to surrender the rights.
|
30 |
-
These restrictions translate to certain responsibilities for you if you
|
31 |
-
distribute copies of the software, or if you modify it.
|
32 |
-
|
33 |
-
For example, if you distribute copies of such a program, whether
|
34 |
-
gratis or for a fee, you must give the recipients all the rights that
|
35 |
-
you have. You must make sure that they, too, receive or can get the
|
36 |
-
source code. And you must show them these terms so they know their
|
37 |
-
rights.
|
38 |
-
|
39 |
-
We protect your rights with two steps: (1) copyright the software, and
|
40 |
-
(2) offer you this license which gives you legal permission to copy,
|
41 |
-
distribute and/or modify the software.
|
42 |
-
|
43 |
-
Also, for each author's protection and ours, we want to make certain
|
44 |
-
that everyone understands that there is no warranty for this free
|
45 |
-
software. If the software is modified by someone else and passed on, we
|
46 |
-
want its recipients to know that what they have is not the original, so
|
47 |
-
that any problems introduced by others will not reflect on the original
|
48 |
-
authors' reputations.
|
49 |
-
|
50 |
-
Finally, any free program is threatened constantly by software
|
51 |
-
patents. We wish to avoid the danger that redistributors of a free
|
52 |
-
program will individually obtain patent licenses, in effect making the
|
53 |
-
program proprietary. To prevent this, we have made it clear that any
|
54 |
-
patent must be licensed for everyone's free use or not licensed at all.
|
55 |
-
|
56 |
-
The precise terms and conditions for copying, distribution and
|
57 |
-
modification follow.
|
58 |
-
|
59 |
-
GNU GENERAL PUBLIC LICENSE
|
60 |
-
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
61 |
-
|
62 |
-
0. This License applies to any program or other work which contains
|
63 |
-
a notice placed by the copyright holder saying it may be distributed
|
64 |
-
under the terms of this General Public License. The "Program", below,
|
65 |
-
refers to any such program or work, and a "work based on the Program"
|
66 |
-
means either the Program or any derivative work under copyright law:
|
67 |
-
that is to say, a work containing the Program or a portion of it,
|
68 |
-
either verbatim or with modifications and/or translated into another
|
69 |
-
language. (Hereinafter, translation is included without limitation in
|
70 |
-
the term "modification".) Each licensee is addressed as "you".
|
71 |
-
|
72 |
-
Activities other than copying, distribution and modification are not
|
73 |
-
covered by this License; they are outside its scope. The act of
|
74 |
-
running the Program is not restricted, and the output from the Program
|
75 |
-
is covered only if its contents constitute a work based on the
|
76 |
-
Program (independent of having been made by running the Program).
|
77 |
-
Whether that is true depends on what the Program does.
|
78 |
-
|
79 |
-
1. You may copy and distribute verbatim copies of the Program's
|
80 |
-
source code as you receive it, in any medium, provided that you
|
81 |
-
conspicuously and appropriately publish on each copy an appropriate
|
82 |
-
copyright notice and disclaimer of warranty; keep intact all the
|
83 |
-
notices that refer to this License and to the absence of any warranty;
|
84 |
-
and give any other recipients of the Program a copy of this License
|
85 |
-
along with the Program.
|
86 |
-
|
87 |
-
You may charge a fee for the physical act of transferring a copy, and
|
88 |
-
you may at your option offer warranty protection in exchange for a fee.
|
89 |
-
|
90 |
-
2. You may modify your copy or copies of the Program or any portion
|
91 |
-
of it, thus forming a work based on the Program, and copy and
|
92 |
-
distribute such modifications or work under the terms of Section 1
|
93 |
-
above, provided that you also meet all of these conditions:
|
94 |
-
|
95 |
-
a) You must cause the modified files to carry prominent notices
|
96 |
-
stating that you changed the files and the date of any change.
|
97 |
-
|
98 |
-
b) You must cause any work that you distribute or publish, that in
|
99 |
-
whole or in part contains or is derived from the Program or any
|
100 |
-
part thereof, to be licensed as a whole at no charge to all third
|
101 |
-
parties under the terms of this License.
|
102 |
-
|
103 |
-
c) If the modified program normally reads commands interactively
|
104 |
-
when run, you must cause it, when started running for such
|
105 |
-
interactive use in the most ordinary way, to print or display an
|
106 |
-
announcement including an appropriate copyright notice and a
|
107 |
-
notice that there is no warranty (or else, saying that you provide
|
108 |
-
a warranty) and that users may redistribute the program under
|
109 |
-
these conditions, and telling the user how to view a copy of this
|
110 |
-
License. (Exception: if the Program itself is interactive but
|
111 |
-
does not normally print such an announcement, your work based on
|
112 |
-
the Program is not required to print an announcement.)
|
113 |
-
|
114 |
-
These requirements apply to the modified work as a whole. If
|
115 |
-
identifiable sections of that work are not derived from the Program,
|
116 |
-
and can be reasonably considered independent and separate works in
|
117 |
-
themselves, then this License, and its terms, do not apply to those
|
118 |
-
sections when you distribute them as separate works. But when you
|
119 |
-
distribute the same sections as part of a whole which is a work based
|
120 |
-
on the Program, the distribution of the whole must be on the terms of
|
121 |
-
this License, whose permissions for other licensees extend to the
|
122 |
-
entire whole, and thus to each and every part regardless of who wrote it.
|
123 |
-
Thus, it is not the intent of this section to claim rights or contest
|
124 |
-
your rights to work written entirely by you; rather, the intent is to
|
125 |
-
exercise the right to control the distribution of derivative or
|
126 |
-
collective works based on the Program.
|
127 |
-
|
128 |
-
In addition, mere aggregation of another work not based on the Program
|
129 |
-
with the Program (or with a work based on the Program) on a volume of
|
130 |
-
a storage or distribution medium does not bring the other work under
|
131 |
-
the scope of this License.
|
132 |
-
|
133 |
-
3. You may copy and distribute the Program (or a work based on it,
|
134 |
-
under Section 2) in object code or executable form under the terms of
|
135 |
-
Sections 1 and 2 above provided that you also do one of the following:
|
136 |
-
|
137 |
-
a) Accompany it with the complete corresponding machine-readable
|
138 |
-
source code, which must be distributed under the terms of Sections
|
139 |
-
1 and 2 above on a medium customarily used for software interchange; or,
|
140 |
-
|
141 |
-
b) Accompany it with a written offer, valid for at least three
|
142 |
-
years, to give any third party, for a charge no more than your
|
143 |
-
cost of physically performing source distribution, a complete
|
144 |
-
machine-readable copy of the corresponding source code, to be
|
145 |
-
distributed under the terms of Sections 1 and 2 above on a medium
|
146 |
-
customarily used for software interchange; or,
|
147 |
-
|
148 |
-
c) Accompany it with the information you received as to the offer
|
149 |
-
to distribute corresponding source code. (This alternative is
|
150 |
-
allowed only for noncommercial distribution and only if you
|
151 |
-
received the program in object code or executable form with such
|
152 |
-
an offer, in accord with Subsection b above.)
|
153 |
-
|
154 |
-
The source code for a work means the preferred form of the work for
|
155 |
-
making modifications to it. For an executable work, complete source
|
156 |
-
code means all the source code for all modules it contains, plus any
|
157 |
-
associated interface definition files, plus the scripts used to
|
158 |
-
control compilation and installation of the executable. However, as a
|
159 |
-
special exception, the source code distributed need not include
|
160 |
-
anything that is normally distributed (in either source or binary
|
161 |
-
form) with the major components (compiler, kernel, and so on) of the
|
162 |
-
operating system on which the executable runs, unless that component
|
163 |
-
itself accompanies the executable.
|
164 |
-
|
165 |
-
If distribution of executable or object code is made by offering
|
166 |
-
access to copy from a designated place, then offering equivalent
|
167 |
-
access to copy the source code from the same place counts as
|
168 |
-
distribution of the source code, even though third parties are not
|
169 |
-
compelled to copy the source along with the object code.
|
170 |
-
|
171 |
-
4. You may not copy, modify, sublicense, or distribute the Program
|
172 |
-
except as expressly provided under this License. Any attempt
|
173 |
-
otherwise to copy, modify, sublicense or distribute the Program is
|
174 |
-
void, and will automatically terminate your rights under this License.
|
175 |
-
However, parties who have received copies, or rights, from you under
|
176 |
-
this License will not have their licenses terminated so long as such
|
177 |
-
parties remain in full compliance.
|
178 |
-
|
179 |
-
5. You are not required to accept this License, since you have not
|
180 |
-
signed it. However, nothing else grants you permission to modify or
|
181 |
-
distribute the Program or its derivative works. These actions are
|
182 |
-
prohibited by law if you do not accept this License. Therefore, by
|
183 |
-
modifying or distributing the Program (or any work based on the
|
184 |
-
Program), you indicate your acceptance of this License to do so, and
|
185 |
-
all its terms and conditions for copying, distributing or modifying
|
186 |
-
the Program or works based on it.
|
187 |
-
|
188 |
-
6. Each time you redistribute the Program (or any work based on the
|
189 |
-
Program), the recipient automatically receives a license from the
|
190 |
-
original licensor to copy, distribute or modify the Program subject to
|
191 |
-
these terms and conditions. You may not impose any further
|
192 |
-
restrictions on the recipients' exercise of the rights granted herein.
|
193 |
-
You are not responsible for enforcing compliance by third parties to
|
194 |
-
this License.
|
195 |
-
|
196 |
-
7. If, as a consequence of a court judgment or allegation of patent
|
197 |
-
infringement or for any other reason (not limited to patent issues),
|
198 |
-
conditions are imposed on you (whether by court order, agreement or
|
199 |
-
otherwise) that contradict the conditions of this License, they do not
|
200 |
-
excuse you from the conditions of this License. If you cannot
|
201 |
-
distribute so as to satisfy simultaneously your obligations under this
|
202 |
-
License and any other pertinent obligations, then as a consequence you
|
203 |
-
may not distribute the Program at all. For example, if a patent
|
204 |
-
license would not permit royalty-free redistribution of the Program by
|
205 |
-
all those who receive copies directly or indirectly through you, then
|
206 |
-
the only way you could satisfy both it and this License would be to
|
207 |
-
refrain entirely from distribution of the Program.
|
208 |
-
|
209 |
-
If any portion of this section is held invalid or unenforceable under
|
210 |
-
any particular circumstance, the balance of the section is intended to
|
211 |
-
apply and the section as a whole is intended to apply in other
|
212 |
-
circumstances.
|
213 |
-
|
214 |
-
It is not the purpose of this section to induce you to infringe any
|
215 |
-
patents or other property right claims or to contest validity of any
|
216 |
-
such claims; this section has the sole purpose of protecting the
|
217 |
-
integrity of the free software distribution system, which is
|
218 |
-
implemented by public license practices. Many people have made
|
219 |
-
generous contributions to the wide range of software distributed
|
220 |
-
through that system in reliance on consistent application of that
|
221 |
-
system; it is up to the author/donor to decide if he or she is willing
|
222 |
-
to distribute software through any other system and a licensee cannot
|
223 |
-
impose that choice.
|
224 |
-
|
225 |
-
This section is intended to make thoroughly clear what is believed to
|
226 |
-
be a consequence of the rest of this License.
|
227 |
-
|
228 |
-
8. If the distribution and/or use of the Program is restricted in
|
229 |
-
certain countries either by patents or by copyrighted interfaces, the
|
230 |
-
original copyright holder who places the Program under this License
|
231 |
-
may add an explicit geographical distribution limitation excluding
|
232 |
-
those countries, so that distribution is permitted only in or among
|
233 |
-
countries not thus excluded. In such case, this License incorporates
|
234 |
-
the limitation as if written in the body of this License.
|
235 |
-
|
236 |
-
9. The Free Software Foundation may publish revised and/or new versions
|
237 |
-
of the General Public License from time to time. Such new versions will
|
238 |
-
be similar in spirit to the present version, but may differ in detail to
|
239 |
-
address new problems or concerns.
|
240 |
-
|
241 |
-
Each version is given a distinguishing version number. If the Program
|
242 |
-
specifies a version number of this License which applies to it and "any
|
243 |
-
later version", you have the option of following the terms and conditions
|
244 |
-
either of that version or of any later version published by the Free
|
245 |
-
Software Foundation. If the Program does not specify a version number of
|
246 |
-
this License, you may choose any version ever published by the Free Software
|
247 |
-
Foundation.
|
248 |
-
|
249 |
-
10. If you wish to incorporate parts of the Program into other free
|
250 |
-
programs whose distribution conditions are different, write to the author
|
251 |
-
to ask for permission. For software which is copyrighted by the Free
|
252 |
-
Software Foundation, write to the Free Software Foundation; we sometimes
|
253 |
-
make exceptions for this. Our decision will be guided by the two goals
|
254 |
-
of preserving the free status of all derivatives of our free software and
|
255 |
-
of promoting the sharing and reuse of software generally.
|
256 |
-
|
257 |
-
NO WARRANTY
|
258 |
-
|
259 |
-
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
|
260 |
-
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
|
261 |
-
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
|
262 |
-
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
|
263 |
-
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
264 |
-
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
|
265 |
-
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
|
266 |
-
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
|
267 |
-
REPAIR OR CORRECTION.
|
268 |
-
|
269 |
-
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
270 |
-
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
|
271 |
-
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
|
272 |
-
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
|
273 |
-
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
|
274 |
-
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
|
275 |
-
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
|
276 |
-
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
|
277 |
-
POSSIBILITY OF SUCH DAMAGES.
|
278 |
-
|
279 |
-
END OF TERMS AND CONDITIONS
|
280 |
-
|
1 |
+
GNU GENERAL PUBLIC LICENSE
|
2 |
+
Version 2, June 1991
|
3 |
+
|
4 |
+
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
|
5 |
+
675 Mass Ave, Cambridge, MA 02139, USA
|
6 |
+
Everyone is permitted to copy and distribute verbatim copies
|
7 |
+
of this license document, but changing it is not allowed.
|
8 |
+
|
9 |
+
Preamble
|
10 |
+
|
11 |
+
The licenses for most software are designed to take away your
|
12 |
+
freedom to share and change it. By contrast, the GNU General Public
|
13 |
+
License is intended to guarantee your freedom to share and change free
|
14 |
+
software--to make sure the software is free for all its users. This
|
15 |
+
General Public License applies to most of the Free Software
|
16 |
+
Foundation's software and to any other program whose authors commit to
|
17 |
+
using it. (Some other Free Software Foundation software is covered by
|
18 |
+
the GNU Library General Public License instead.) You can apply it to
|
19 |
+
your programs, too.
|
20 |
+
|
21 |
+
When we speak of free software, we are referring to freedom, not
|
22 |
+
price. Our General Public Licenses are designed to make sure that you
|
23 |
+
have the freedom to distribute copies of free software (and charge for
|
24 |
+
this service if you wish), that you receive source code or can get it
|
25 |
+
if you want it, that you can change the software or use pieces of it
|
26 |
+
in new free programs; and that you know you can do these things.
|
27 |
+
|
28 |
+
To protect your rights, we need to make restrictions that forbid
|
29 |
+
anyone to deny you these rights or to ask you to surrender the rights.
|
30 |
+
These restrictions translate to certain responsibilities for you if you
|
31 |
+
distribute copies of the software, or if you modify it.
|
32 |
+
|
33 |
+
For example, if you distribute copies of such a program, whether
|
34 |
+
gratis or for a fee, you must give the recipients all the rights that
|
35 |
+
you have. You must make sure that they, too, receive or can get the
|
36 |
+
source code. And you must show them these terms so they know their
|
37 |
+
rights.
|
38 |
+
|
39 |
+
We protect your rights with two steps: (1) copyright the software, and
|
40 |
+
(2) offer you this license which gives you legal permission to copy,
|
41 |
+
distribute and/or modify the software.
|
42 |
+
|
43 |
+
Also, for each author's protection and ours, we want to make certain
|
44 |
+
that everyone understands that there is no warranty for this free
|
45 |
+
software. If the software is modified by someone else and passed on, we
|
46 |
+
want its recipients to know that what they have is not the original, so
|
47 |
+
that any problems introduced by others will not reflect on the original
|
48 |
+
authors' reputations.
|
49 |
+
|
50 |
+
Finally, any free program is threatened constantly by software
|
51 |
+
patents. We wish to avoid the danger that redistributors of a free
|
52 |
+
program will individually obtain patent licenses, in effect making the
|
53 |
+
program proprietary. To prevent this, we have made it clear that any
|
54 |
+
patent must be licensed for everyone's free use or not licensed at all.
|
55 |
+
|
56 |
+
The precise terms and conditions for copying, distribution and
|
57 |
+
modification follow.
|
58 |
+
|
59 |
+
GNU GENERAL PUBLIC LICENSE
|
60 |
+
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
61 |
+
|
62 |
+
0. This License applies to any program or other work which contains
|
63 |
+
a notice placed by the copyright holder saying it may be distributed
|
64 |
+
under the terms of this General Public License. The "Program", below,
|
65 |
+
refers to any such program or work, and a "work based on the Program"
|
66 |
+
means either the Program or any derivative work under copyright law:
|
67 |
+
that is to say, a work containing the Program or a portion of it,
|
68 |
+
either verbatim or with modifications and/or translated into another
|
69 |
+
language. (Hereinafter, translation is included without limitation in
|
70 |
+
the term "modification".) Each licensee is addressed as "you".
|
71 |
+
|
72 |
+
Activities other than copying, distribution and modification are not
|
73 |
+
covered by this License; they are outside its scope. The act of
|
74 |
+
running the Program is not restricted, and the output from the Program
|
75 |
+
is covered only if its contents constitute a work based on the
|
76 |
+
Program (independent of having been made by running the Program).
|
77 |
+
Whether that is true depends on what the Program does.
|
78 |
+
|
79 |
+
1. You may copy and distribute verbatim copies of the Program's
|
80 |
+
source code as you receive it, in any medium, provided that you
|
81 |
+
conspicuously and appropriately publish on each copy an appropriate
|
82 |
+
copyright notice and disclaimer of warranty; keep intact all the
|
83 |
+
notices that refer to this License and to the absence of any warranty;
|
84 |
+
and give any other recipients of the Program a copy of this License
|
85 |
+
along with the Program.
|
86 |
+
|
87 |
+
You may charge a fee for the physical act of transferring a copy, and
|
88 |
+
you may at your option offer warranty protection in exchange for a fee.
|
89 |
+
|
90 |
+
2. You may modify your copy or copies of the Program or any portion
|
91 |
+
of it, thus forming a work based on the Program, and copy and
|
92 |
+
distribute such modifications or work under the terms of Section 1
|
93 |
+
above, provided that you also meet all of these conditions:
|
94 |
+
|
95 |
+
a) You must cause the modified files to carry prominent notices
|
96 |
+
stating that you changed the files and the date of any change.
|
97 |
+
|
98 |
+
b) You must cause any work that you distribute or publish, that in
|
99 |
+
whole or in part contains or is derived from the Program or any
|
100 |
+
part thereof, to be licensed as a whole at no charge to all third
|
101 |
+
parties under the terms of this License.
|
102 |
+
|
103 |
+
c) If the modified program normally reads commands interactively
|
104 |
+
when run, you must cause it, when started running for such
|
105 |
+
interactive use in the most ordinary way, to print or display an
|
106 |
+
announcement including an appropriate copyright notice and a
|
107 |
+
notice that there is no warranty (or else, saying that you provide
|
108 |
+
a warranty) and that users may redistribute the program under
|
109 |
+
these conditions, and telling the user how to view a copy of this
|
110 |
+
License. (Exception: if the Program itself is interactive but
|
111 |
+
does not normally print such an announcement, your work based on
|
112 |
+
the Program is not required to print an announcement.)
|
113 |
+
|
114 |
+
These requirements apply to the modified work as a whole. If
|
115 |
+
identifiable sections of that work are not derived from the Program,
|
116 |
+
and can be reasonably considered independent and separate works in
|
117 |
+
themselves, then this License, and its terms, do not apply to those
|
118 |
+
sections when you distribute them as separate works. But when you
|
119 |
+
distribute the same sections as part of a whole which is a work based
|
120 |
+
on the Program, the distribution of the whole must be on the terms of
|
121 |
+
this License, whose permissions for other licensees extend to the
|
122 |
+
entire whole, and thus to each and every part regardless of who wrote it.
|
123 |
+
Thus, it is not the intent of this section to claim rights or contest
|
124 |
+
your rights to work written entirely by you; rather, the intent is to
|
125 |
+
exercise the right to control the distribution of derivative or
|
126 |
+
collective works based on the Program.
|
127 |
+
|
128 |
+
In addition, mere aggregation of another work not based on the Program
|
129 |
+
with the Program (or with a work based on the Program) on a volume of
|
130 |
+
a storage or distribution medium does not bring the other work under
|
131 |
+
the scope of this License.
|
132 |
+
|
133 |
+
3. You may copy and distribute the Program (or a work based on it,
|
134 |
+
under Section 2) in object code or executable form under the terms of
|
135 |
+
Sections 1 and 2 above provided that you also do one of the following:
|
136 |
+
|
137 |
+
a) Accompany it with the complete corresponding machine-readable
|
138 |
+
source code, which must be distributed under the terms of Sections
|
139 |
+
1 and 2 above on a medium customarily used for software interchange; or,
|
140 |
+
|
141 |
+
b) Accompany it with a written offer, valid for at least three
|
142 |
+
years, to give any third party, for a charge no more than your
|
143 |
+
cost of physically performing source distribution, a complete
|
144 |
+
machine-readable copy of the corresponding source code, to be
|
145 |
+
distributed under the terms of Sections 1 and 2 above on a medium
|
146 |
+
customarily used for software interchange; or,
|
147 |
+
|
148 |
+
c) Accompany it with the information you received as to the offer
|
149 |
+
to distribute corresponding source code. (This alternative is
|
150 |
+
allowed only for noncommercial distribution and only if you
|
151 |
+
received the program in object code or executable form with such
|
152 |
+
an offer, in accord with Subsection b above.)
|
153 |
+
|
154 |
+
The source code for a work means the preferred form of the work for
|
155 |
+
making modifications to it. For an executable work, complete source
|
156 |
+
code means all the source code for all modules it contains, plus any
|
157 |
+
associated interface definition files, plus the scripts used to
|
158 |
+
control compilation and installation of the executable. However, as a
|
159 |
+
special exception, the source code distributed need not include
|
160 |
+
anything that is normally distributed (in either source or binary
|
161 |
+
form) with the major components (compiler, kernel, and so on) of the
|
162 |
+
operating system on which the executable runs, unless that component
|
163 |
+
itself accompanies the executable.
|
164 |
+
|
165 |
+
If distribution of executable or object code is made by offering
|
166 |
+
access to copy from a designated place, then offering equivalent
|
167 |
+
access to copy the source code from the same place counts as
|
168 |
+
distribution of the source code, even though third parties are not
|
169 |
+
compelled to copy the source along with the object code.
|
170 |
+
|
171 |
+
4. You may not copy, modify, sublicense, or distribute the Program
|
172 |
+
except as expressly provided under this License. Any attempt
|
173 |
+
otherwise to copy, modify, sublicense or distribute the Program is
|
174 |
+
void, and will automatically terminate your rights under this License.
|
175 |
+
However, parties who have received copies, or rights, from you under
|
176 |
+
this License will not have their licenses terminated so long as such
|
177 |
+
parties remain in full compliance.
|
178 |
+
|
179 |
+
5. You are not required to accept this License, since you have not
|
180 |
+
signed it. However, nothing else grants you permission to modify or
|
181 |
+
distribute the Program or its derivative works. These actions are
|
182 |
+
prohibited by law if you do not accept this License. Therefore, by
|
183 |
+
modifying or distributing the Program (or any work based on the
|
184 |
+
Program), you indicate your acceptance of this License to do so, and
|
185 |
+
all its terms and conditions for copying, distributing or modifying
|
186 |
+
the Program or works based on it.
|
187 |
+
|
188 |
+
6. Each time you redistribute the Program (or any work based on the
|
189 |
+
Program), the recipient automatically receives a license from the
|
190 |
+
original licensor to copy, distribute or modify the Program subject to
|
191 |
+
these terms and conditions. You may not impose any further
|
192 |
+
restrictions on the recipients' exercise of the rights granted herein.
|
193 |
+
You are not responsible for enforcing compliance by third parties to
|
194 |
+
this License.
|
195 |
+
|
196 |
+
7. If, as a consequence of a court judgment or allegation of patent
|
197 |
+
infringement or for any other reason (not limited to patent issues),
|
198 |
+
conditions are imposed on you (whether by court order, agreement or
|
199 |
+
otherwise) that contradict the conditions of this License, they do not
|
200 |
+
excuse you from the conditions of this License. If you cannot
|
201 |
+
distribute so as to satisfy simultaneously your obligations under this
|
202 |
+
License and any other pertinent obligations, then as a consequence you
|
203 |
+
may not distribute the Program at all. For example, if a patent
|
204 |
+
license would not permit royalty-free redistribution of the Program by
|
205 |
+
all those who receive copies directly or indirectly through you, then
|
206 |
+
the only way you could satisfy both it and this License would be to
|
207 |
+
refrain entirely from distribution of the Program.
|
208 |
+
|
209 |
+
If any portion of this section is held invalid or unenforceable under
|
210 |
+
any particular circumstance, the balance of the section is intended to
|
211 |
+
apply and the section as a whole is intended to apply in other
|
212 |
+
circumstances.
|
213 |
+
|
214 |
+
It is not the purpose of this section to induce you to infringe any
|
215 |
+
patents or other property right claims or to contest validity of any
|
216 |
+
such claims; this section has the sole purpose of protecting the
|
217 |
+
integrity of the free software distribution system, which is
|
218 |
+
implemented by public license practices. Many people have made
|
219 |
+
generous contributions to the wide range of software distributed
|
220 |
+
through that system in reliance on consistent application of that
|
221 |
+
system; it is up to the author/donor to decide if he or she is willing
|
222 |
+
to distribute software through any other system and a licensee cannot
|
223 |
+
impose that choice.
|
224 |
+
|
225 |
+
This section is intended to make thoroughly clear what is believed to
|
226 |
+
be a consequence of the rest of this License.
|
227 |
+
|
228 |
+
8. If the distribution and/or use of the Program is restricted in
|
229 |
+
certain countries either by patents or by copyrighted interfaces, the
|
230 |
+
original copyright holder who places the Program under this License
|
231 |
+
may add an explicit geographical distribution limitation excluding
|
232 |
+
those countries, so that distribution is permitted only in or among
|
233 |
+
countries not thus excluded. In such case, this License incorporates
|
234 |
+
the limitation as if written in the body of this License.
|
235 |
+
|
236 |
+
9. The Free Software Foundation may publish revised and/or new versions
|
237 |
+
of the General Public License from time to time. Such new versions will
|
238 |
+
be similar in spirit to the present version, but may differ in detail to
|
239 |
+
address new problems or concerns.
|
240 |
+
|
241 |
+
Each version is given a distinguishing version number. If the Program
|
242 |
+
specifies a version number of this License which applies to it and "any
|
243 |
+
later version", you have the option of following the terms and conditions
|
244 |
+
either of that version or of any later version published by the Free
|
245 |
+
Software Foundation. If the Program does not specify a version number of
|
246 |
+
this License, you may choose any version ever published by the Free Software
|
247 |
+
Foundation.
|
248 |
+
|
249 |
+
10. If you wish to incorporate parts of the Program into other free
|
250 |
+
programs whose distribution conditions are different, write to the author
|
251 |
+
to ask for permission. For software which is copyrighted by the Free
|
252 |
+
Software Foundation, write to the Free Software Foundation; we sometimes
|
253 |
+
make exceptions for this. Our decision will be guided by the two goals
|
254 |
+
of preserving the free status of all derivatives of our free software and
|
255 |
+
of promoting the sharing and reuse of software generally.
|
256 |
+
|
257 |
+
NO WARRANTY
|
258 |
+
|
259 |
+
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
|
260 |
+
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
|
261 |
+
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
|
262 |
+
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
|
263 |
+
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
264 |
+
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
|
265 |
+
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
|
266 |
+
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
|
267 |
+
REPAIR OR CORRECTION.
|
268 |
+
|
269 |
+
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
270 |
+
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
|
271 |
+
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
|
272 |
+
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
|
273 |
+
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
|
274 |
+
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
|
275 |
+
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
|
276 |
+
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
|
277 |
+
POSSIBILITY OF SUCH DAMAGES.
|
278 |
+
|
279 |
+
END OF TERMS AND CONDITIONS
|
280 |
+
|
bp-themes/bp-default/readme.txt
CHANGED
@@ -1,22 +1,22 @@
|
|
1 |
-
--- BuddyPress Default ---
|
2 |
-
Clean and stylish, BuddyPress Default lets you build a social network straight out of the box. Make it yours with a custom menu, header image, and background. Along with five widgetized areas (one in the sidebar, four in the footer), BP-Default supports featured images (as custom header images on posts and pages) and is furnished with an optional one-column page template that removes the sidebar, and a stylesheet for the admin Visual Editor.
|
3 |
-
|
4 |
-
|
5 |
-
--- Installation ---
|
6 |
-
The theme is bundled with BuddyPress. After activating the plugin, BuddyPress Default will be added to the "Appearance > Themes" menu in your WordPress admin area.
|
7 |
-
|
8 |
-
|
9 |
-
--- About BuddyPress ---
|
10 |
-
Social networking in a box. Build a social network for your company, school, sports team or niche community all based on the power and flexibility of WordPress. BuddyPress will let users register on your site and start creating profiles, posting messages, making connections, creating and interacting in groups and much more.
|
11 |
-
|
12 |
-
For help with BuddyPress Default, or for more information about BuddyPress, please visit http://buddypress.org/.
|
13 |
-
|
14 |
-
|
15 |
-
--- Building a BuddyPress theme ---
|
16 |
-
If you want to make a custom theme based on BuddyPress Default, DO NOT copy and edit it. By doing this you will make updates and maintenance much harder for yourself. Instead, please review this codex page for instructions on how to build a BuddyPress child theme:
|
17 |
-
|
18 |
-
http://codex.buddypress.org/how-to-guides/building-a-buddypress-child-theme/
|
19 |
-
|
20 |
-
|
21 |
-
--- Changelog ---
|
22 |
A list of changes is available at http://codex.buddypress.org/theme-development/bp-default-theme-changelog/.
|
1 |
+
--- BuddyPress Default ---
|
2 |
+
Clean and stylish, BuddyPress Default lets you build a social network straight out of the box. Make it yours with a custom menu, header image, and background. Along with five widgetized areas (one in the sidebar, four in the footer), BP-Default supports featured images (as custom header images on posts and pages) and is furnished with an optional one-column page template that removes the sidebar, and a stylesheet for the admin Visual Editor.
|
3 |
+
|
4 |
+
|
5 |
+
--- Installation ---
|
6 |
+
The theme is bundled with BuddyPress. After activating the plugin, BuddyPress Default will be added to the "Appearance > Themes" menu in your WordPress admin area.
|
7 |
+
|
8 |
+
|
9 |
+
--- About BuddyPress ---
|
10 |
+
Social networking in a box. Build a social network for your company, school, sports team or niche community all based on the power and flexibility of WordPress. BuddyPress will let users register on your site and start creating profiles, posting messages, making connections, creating and interacting in groups and much more.
|
11 |
+
|
12 |
+
For help with BuddyPress Default, or for more information about BuddyPress, please visit http://buddypress.org/.
|
13 |
+
|
14 |
+
|
15 |
+
--- Building a BuddyPress theme ---
|
16 |
+
If you want to make a custom theme based on BuddyPress Default, DO NOT copy and edit it. By doing this you will make updates and maintenance much harder for yourself. Instead, please review this codex page for instructions on how to build a BuddyPress child theme:
|
17 |
+
|
18 |
+
http://codex.buddypress.org/how-to-guides/building-a-buddypress-child-theme/
|
19 |
+
|
20 |
+
|
21 |
+
--- Changelog ---
|
22 |
A list of changes is available at http://codex.buddypress.org/theme-development/bp-default-theme-changelog/.
|
bp-themes/bp-default/rtl.css
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
* Theme Name: BuddyPress Default
|
3 |
* Theme URI: http://buddypress.org/extend/themes/
|
4 |
* Description: Clean and stylish, BuddyPress Default lets you build a social network straight out of the box. Make it yours with a custom menu, header image, and background. Along with five widgetized areas (one in the sidebar, four in the footer), BP-Default supports featured images (as custom header images on posts and pages) and is furnished with an optional one-column page template that removes the sidebar, and a stylesheet for the admin Visual Editor.
|
5 |
-
* Version: 1.6.
|
6 |
* Author: the BuddyPress team
|
7 |
* Author URI: http://buddypress.org
|
8 |
* License: GNU General Public License
|
@@ -21,4 +21,4 @@
|
|
21 |
*
|
22 |
* This file intentionally left blank. CSS is enqueued in functions.php
|
23 |
*
|
24 |
-
*/
|
2 |
* Theme Name: BuddyPress Default
|
3 |
* Theme URI: http://buddypress.org/extend/themes/
|
4 |
* Description: Clean and stylish, BuddyPress Default lets you build a social network straight out of the box. Make it yours with a custom menu, header image, and background. Along with five widgetized areas (one in the sidebar, four in the footer), BP-Default supports featured images (as custom header images on posts and pages) and is furnished with an optional one-column page template that removes the sidebar, and a stylesheet for the admin Visual Editor.
|
5 |
+
* Version: 1.6.2
|
6 |
* Author: the BuddyPress team
|
7 |
* Author URI: http://buddypress.org
|
8 |
* License: GNU General Public License
|
21 |
*
|
22 |
* This file intentionally left blank. CSS is enqueued in functions.php
|
23 |
*
|
24 |
+
*/
|
bp-themes/bp-default/style.css
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
* Theme Name: BuddyPress Default
|
3 |
* Theme URI: http://buddypress.org/extend/themes/
|
4 |
* Description: Clean and stylish, BuddyPress Default lets you build a social network straight out of the box. Make it yours with a custom menu, header image, and background. Along with five widgetized areas (one in the sidebar, four in the footer), BP-Default supports featured images (as custom header images on posts and pages) and is furnished with an optional one-column page template that removes the sidebar, and a stylesheet for the admin Visual Editor.
|
5 |
-
* Version: 1.6.
|
6 |
* Author: the BuddyPress team
|
7 |
* Author URI: http://buddypress.org
|
8 |
* License: GNU General Public License
|
@@ -21,4 +21,4 @@
|
|
21 |
*
|
22 |
* This file intentionally left blank. CSS is enqueued in functions.php
|
23 |
*
|
24 |
-
*/
|
2 |
* Theme Name: BuddyPress Default
|
3 |
* Theme URI: http://buddypress.org/extend/themes/
|
4 |
* Description: Clean and stylish, BuddyPress Default lets you build a social network straight out of the box. Make it yours with a custom menu, header image, and background. Along with five widgetized areas (one in the sidebar, four in the footer), BP-Default supports featured images (as custom header images on posts and pages) and is furnished with an optional one-column page template that removes the sidebar, and a stylesheet for the admin Visual Editor.
|
5 |
+
* Version: 1.6.2
|
6 |
* Author: the BuddyPress team
|
7 |
* Author URI: http://buddypress.org
|
8 |
* License: GNU General Public License
|
21 |
*
|
22 |
* This file intentionally left blank. CSS is enqueued in functions.php
|
23 |
*
|
24 |
+
*/
|
bp-xprofile/bp-xprofile-classes.php
CHANGED
@@ -133,12 +133,12 @@ class BP_XProfile_Group {
|
|
133 |
if ( !empty( $profile_group_id ) )
|
134 |
$where_sql = $wpdb->prepare( 'WHERE g.id = %d', $profile_group_id );
|
135 |
elseif ( $exclude_groups )
|
136 |
-
$where_sql =
|
137 |
|
138 |
if ( !empty( $hide_empty_groups ) )
|
139 |
-
$groups = $wpdb->get_results(
|
140 |
else
|
141 |
-
$groups = $wpdb->get_results(
|
142 |
|
143 |
if ( empty( $fetch_fields ) )
|
144 |
return $groups;
|
@@ -164,13 +164,13 @@ class BP_XProfile_Group {
|
|
164 |
$exclude_fields_cs = implode( ',', $exclude_fields_cs );
|
165 |
|
166 |
if ( !empty( $exclude_fields_cs ) ) {
|
167 |
-
$exclude_fields_sql =
|
168 |
} else {
|
169 |
$exclude_fields_sql = '';
|
170 |
}
|
171 |
|
172 |
// Fetch the fields
|
173 |
-
$fields = $wpdb->get_results(
|
174 |
|
175 |
if ( empty( $fields ) )
|
176 |
return $groups;
|
@@ -331,7 +331,7 @@ class BP_XProfile_Group {
|
|
331 |
function fetch_default_visibility_levels() {
|
332 |
global $wpdb, $bp;
|
333 |
|
334 |
-
$levels = $wpdb->get_results(
|
335 |
|
336 |
// Arrange so that the field id is the key and the visibility level the value
|
337 |
$default_visibility_levels = array();
|
@@ -1197,7 +1197,7 @@ class BP_XProfile_ProfileData {
|
|
1197 |
global $wpdb, $bp;
|
1198 |
|
1199 |
if ( !empty( $exclude_fullname ) )
|
1200 |
-
$exclude_sql =
|
1201 |
|
1202 |
return $wpdb->get_results( $wpdb->prepare( "SELECT pf.type, pf.name, pd.value FROM {$bp->profile->table_name_data} pd INNER JOIN {$bp->profile->table_name_fields} pf ON pd.field_id = pf.id AND pd.user_id = %d {$exclude_sql} ORDER BY RAND() LIMIT 1", $user_id ) );
|
1203 |
}
|
133 |
if ( !empty( $profile_group_id ) )
|
134 |
$where_sql = $wpdb->prepare( 'WHERE g.id = %d', $profile_group_id );
|
135 |
elseif ( $exclude_groups )
|
136 |
+
$where_sql = "WHERE g.id NOT IN ({$exclude_groups})";
|
137 |
|
138 |
if ( !empty( $hide_empty_groups ) )
|
139 |
+
$groups = $wpdb->get_results( "SELECT DISTINCT g.* FROM {$bp->profile->table_name_groups} g INNER JOIN {$bp->profile->table_name_fields} f ON g.id = f.group_id {$where_sql} ORDER BY g.group_order ASC" );
|
140 |
else
|
141 |
+
$groups = $wpdb->get_results( "SELECT DISTINCT g.* FROM {$bp->profile->table_name_groups} g {$where_sql} ORDER BY g.group_order ASC" );
|
142 |
|
143 |
if ( empty( $fetch_fields ) )
|
144 |
return $groups;
|
164 |
$exclude_fields_cs = implode( ',', $exclude_fields_cs );
|
165 |
|
166 |
if ( !empty( $exclude_fields_cs ) ) {
|
167 |
+
$exclude_fields_sql = "AND id NOT IN ({$exclude_fields_cs})";
|
168 |
} else {
|
169 |
$exclude_fields_sql = '';
|
170 |
}
|
171 |
|
172 |
// Fetch the fields
|
173 |
+
$fields = $wpdb->get_results( "SELECT id, name, description, type, group_id, is_required FROM {$bp->profile->table_name_fields} WHERE group_id IN ( {$group_ids} ) AND parent_id = 0 {$exclude_fields_sql} ORDER BY field_order" );
|
174 |
|
175 |
if ( empty( $fields ) )
|
176 |
return $groups;
|
331 |
function fetch_default_visibility_levels() {
|
332 |
global $wpdb, $bp;
|
333 |
|
334 |
+
$levels = $wpdb->get_results( "SELECT object_id, meta_key, meta_value FROM {$bp->profile->table_name_meta} WHERE object_type = 'field' AND ( meta_key = 'default_visibility' OR meta_key = 'allow_custom_visibility' )" );
|
335 |
|
336 |
// Arrange so that the field id is the key and the visibility level the value
|
337 |
$default_visibility_levels = array();
|
1197 |
global $wpdb, $bp;
|
1198 |
|
1199 |
if ( !empty( $exclude_fullname ) )
|
1200 |
+
$exclude_sql = " AND pf.id != 1";
|
1201 |
|
1202 |
return $wpdb->get_results( $wpdb->prepare( "SELECT pf.type, pf.name, pd.value FROM {$bp->profile->table_name_data} pd INNER JOIN {$bp->profile->table_name_fields} pf ON pd.field_id = pf.id AND pd.user_id = %d {$exclude_sql} ORDER BY RAND() LIMIT 1", $user_id ) );
|
1203 |
}
|
bp-xprofile/bp-xprofile-functions.php
CHANGED
@@ -513,11 +513,11 @@ function bp_xprofile_delete_meta( $object_id, $object_type, $meta_key = false, $
|
|
513 |
$meta_value = trim( $meta_value );
|
514 |
|
515 |
if ( !$meta_key )
|
516 |
-
$wpdb->query( $wpdb->prepare( "DELETE FROM
|
517 |
else if ( $meta_value )
|
518 |
-
$wpdb->query( $wpdb->prepare( "DELETE FROM
|
519 |
else
|
520 |
-
$wpdb->query( $wpdb->prepare( "DELETE FROM
|
521 |
|
522 |
// Delete the cached object
|
523 |
wp_cache_delete( 'bp_xprofile_meta_' . $object_type . '_' . $object_id . '_' . $meta_key, 'bp' );
|
@@ -543,11 +543,11 @@ function bp_xprofile_get_meta( $object_id, $object_type, $meta_key = '') {
|
|
543 |
$meta_key = preg_replace( '|[^a-z0-9_]|i', '', $meta_key );
|
544 |
|
545 |
if ( !$metas = wp_cache_get( 'bp_xprofile_meta_' . $object_type . '_' . $object_id . '_' . $meta_key, 'bp' ) ) {
|
546 |
-
$metas = $wpdb->get_col( $wpdb->prepare( "SELECT meta_value FROM
|
547 |
wp_cache_set( 'bp_xprofile_meta_' . $object_type . '_' . $object_id . '_' . $meta_key, $metas, 'bp' );
|
548 |
}
|
549 |
} else {
|
550 |
-
$metas = $wpdb->get_col( $wpdb->prepare( "SELECT meta_value FROM
|
551 |
}
|
552 |
|
553 |
if ( empty( $metas ) ) {
|
@@ -590,12 +590,12 @@ function bp_xprofile_update_meta( $object_id, $object_type, $meta_key, $meta_val
|
|
590 |
if ( empty( $meta_value ) )
|
591 |
return bp_xprofile_delete_meta( $object_id, $object_type, $meta_key );
|
592 |
|
593 |
-
$cur = $wpdb->get_row( $wpdb->prepare( "SELECT * FROM
|
594 |
|
595 |
if ( empty( $cur ) )
|
596 |
-
$wpdb->query( $wpdb->prepare( "INSERT INTO
|
597 |
else if ( $cur->meta_value != $meta_value )
|
598 |
-
$wpdb->query( $wpdb->prepare( "UPDATE
|
599 |
else
|
600 |
return false;
|
601 |
|
513 |
$meta_value = trim( $meta_value );
|
514 |
|
515 |
if ( !$meta_key )
|
516 |
+
$wpdb->query( $wpdb->prepare( "DELETE FROM {$bp->profile->table_name_meta} WHERE object_id = %d AND object_type = %s", $object_id, $object_type ) );
|
517 |
else if ( $meta_value )
|
518 |
+
$wpdb->query( $wpdb->prepare( "DELETE FROM {$bp->profile->table_name_meta} WHERE object_id = %d AND object_type = %s AND meta_key = %s AND meta_value = %s", $object_id, $object_type, $meta_key, $meta_value ) );
|
519 |
else
|
520 |
+
$wpdb->query( $wpdb->prepare( "DELETE FROM {$bp->profile->table_name_meta} WHERE object_id = %d AND object_type = %s AND meta_key = %s", $object_id, $object_type, $meta_key ) );
|
521 |
|
522 |
// Delete the cached object
|
523 |
wp_cache_delete( 'bp_xprofile_meta_' . $object_type . '_' . $object_id . '_' . $meta_key, 'bp' );
|
543 |
$meta_key = preg_replace( '|[^a-z0-9_]|i', '', $meta_key );
|
544 |
|
545 |
if ( !$metas = wp_cache_get( 'bp_xprofile_meta_' . $object_type . '_' . $object_id . '_' . $meta_key, 'bp' ) ) {
|
546 |
+
$metas = $wpdb->get_col( $wpdb->prepare( "SELECT meta_value FROM {$bp->profile->table_name_meta} WHERE object_id = %d AND object_type = %s AND meta_key = %s", $object_id, $object_type, $meta_key ) );
|
547 |
wp_cache_set( 'bp_xprofile_meta_' . $object_type . '_' . $object_id . '_' . $meta_key, $metas, 'bp' );
|
548 |
}
|
549 |
} else {
|
550 |
+
$metas = $wpdb->get_col( $wpdb->prepare( "SELECT meta_value FROM {$bp->profile->table_name_meta} WHERE object_id = %d AND object_type = %s", $object_id, $object_type ) );
|
551 |
}
|
552 |
|
553 |
if ( empty( $metas ) ) {
|
590 |
if ( empty( $meta_value ) )
|
591 |
return bp_xprofile_delete_meta( $object_id, $object_type, $meta_key );
|
592 |
|
593 |
+
$cur = $wpdb->get_row( $wpdb->prepare( "SELECT * FROM {$bp->profile->table_name_meta} WHERE object_id = %d AND object_type = %s AND meta_key = %s", $object_id, $object_type, $meta_key ) );
|
594 |
|
595 |
if ( empty( $cur ) )
|
596 |
+
$wpdb->query( $wpdb->prepare( "INSERT INTO {$bp->profile->table_name_meta} ( object_id, object_type, meta_key, meta_value ) VALUES ( %d, %s, %s, %s )", $object_id, $object_type, $meta_key, $meta_value ) );
|
597 |
else if ( $cur->meta_value != $meta_value )
|
598 |
+
$wpdb->query( $wpdb->prepare( "UPDATE {$bp->profile->table_name_meta} SET meta_value = %s WHERE object_id = %d AND object_type = %s AND meta_key = %s", $meta_value, $object_id, $object_type, $meta_key ) );
|
599 |
else
|
600 |
return false;
|
601 |
|
readme.txt
CHANGED
@@ -3,7 +3,7 @@ Contributors: johnjamesjacoby, DJPaul, boonebgorges
|
|
3 |
Tags: buddypress, social networking, activity, profiles, messaging, friends, groups, forums, microblogging, twitter, facebook, social, community, networks, networking, cms
|
4 |
Requires at least: 3.4
|
5 |
Tested up to: 3.4.1
|
6 |
-
Stable tag: 1.6.
|
7 |
License: GPLv2 or later
|
8 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
9 |
|
@@ -86,6 +86,9 @@ BuddyPress is available in more than 20 languages. For more information, check o
|
|
86 |
|
87 |
== Upgrade Notice ==
|
88 |
|
|
|
|
|
|
|
89 |
= 1.6.1 =
|
90 |
Fixes 4 bugs
|
91 |
|
3 |
Tags: buddypress, social networking, activity, profiles, messaging, friends, groups, forums, microblogging, twitter, facebook, social, community, networks, networking, cms
|
4 |
Requires at least: 3.4
|
5 |
Tested up to: 3.4.1
|
6 |
+
Stable tag: 1.6.2
|
7 |
License: GPLv2 or later
|
8 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
9 |
|
86 |
|
87 |
== Upgrade Notice ==
|
88 |
|
89 |
+
= 1.6.2 =
|
90 |
+
Compatibility with WordPress 3.5
|
91 |
+
|
92 |
= 1.6.1 =
|
93 |
Fixes 4 bugs
|
94 |
|