Changeset 3369
- Timestamp:
- 11/07/2010 12:20:02 AM (14 years ago)
- Location:
- trunk
- Files:
-
- 24 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-activity.php
r3365 r3369 33 33 bp_core_new_nav_item( array( 'name' => __( 'Activity', 'buddypress' ), 'slug' => $bp->activity->name, 'position' => 10, 'screen_function' => 'bp_activity_screen_my_activity', 'default_subnav_slug' => 'just-me', 'item_css_id' => $bp->activity->id ) ); 34 34 35 $user_domain = ( !empty( $bp->displayed_user->domain ) ) ? $bp->displayed_user->domain : $bp->loggedin_user->domain; 36 $user_login = ( !empty( $bp->displayed_user->userdata->user_login ) ) ? $bp->displayed_user->userdata->user_login : $bp->loggedin_user->userdata->user_login; 35 if ( !is_user_logged_in() && !isset( $bp->displayed_user->id ) ) 36 return; 37 38 $user_domain = ( isset( $bp->displayed_user->domain ) ) ? $bp->displayed_user->domain : $bp->loggedin_user->domain; 39 $user_login = ( isset( $bp->displayed_user->userdata->user_login ) ) ? $bp->displayed_user->userdata->user_login : $bp->loggedin_user->userdata->user_login; 37 40 $activity_link = $user_domain . $bp->activity->name . '/'; 38 41 … … 203 206 <tr> 204 207 <td></td> 205 <td><?php printf( __( "A member replies to an update or comment you've posted", 'buddypress' ), $current_user->user_login) ?></td>208 <td><?php _e( "A member replies to an update or comment you've posted", 'buddypress' ) ?></td> 206 209 <td class="yes"><input type="radio" name="notifications[notification_activity_new_reply]" value="yes" <?php if ( !get_user_meta( $bp->loggedin_user->id, 'notification_activity_new_reply', true ) || 'yes' == get_user_meta( $bp->loggedin_user->id, 'notification_activity_new_reply', true ) ) { ?>checked="checked" <?php } ?>/></td> 207 210 <td class="no"><input type="radio" name="notifications[notification_activity_new_reply]" value="no" <?php if ( 'no' == get_user_meta( $bp->loggedin_user->id, 'notification_activity_new_reply', true ) ) { ?>checked="checked" <?php } ?>/></td> … … 401 404 global $bp, $wp_query; 402 405 403 if ( $bp->current_component != $bp->activity->slug || $bp->current_action != 'feed' || $bp->displayed_user->id || $bp->groups->current_group)406 if ( $bp->current_component != $bp->activity->slug || $bp->current_action != 'feed' || ( isset( $bp->displayed_user->id ) && $bp->displayed_user->id ) || isset( $bp->groups->current_group ) ) 404 407 return false; 405 408 … … 429 432 global $bp, $wp_query; 430 433 431 if ( $bp->current_component != $bp->activity->slug || !$bp->displayed_user->id || $bp->current_action != $bp->friends->slug || $bp->action_variables[0] != 'feed' )434 if ( $bp->current_component != $bp->activity->slug || !$bp->displayed_user->id || $bp->current_action != $bp->friends->slug || !isset( $bp->action_variables[0] ) || $bp->action_variables[0] != 'feed' ) 432 435 return false; 433 436 … … 443 446 global $bp, $wp_query; 444 447 445 if ( $bp->current_component != $bp->activity->slug || !$bp->displayed_user->id || $bp->current_action != $bp->groups->slug || $bp->action_variables[0] != 'feed' )448 if ( $bp->current_component != $bp->activity->slug || !$bp->displayed_user->id || $bp->current_action != $bp->groups->slug || !isset( $bp->action_variables[0] ) || $bp->action_variables[0] != 'feed' ) 446 449 return false; 447 450 … … 457 460 global $bp, $wp_query; 458 461 459 if ( $bp->current_component != $bp->activity->slug || !$bp->displayed_user->id || $bp->current_action != 'mentions' || $bp->action_variables[0] != 'feed' )462 if ( $bp->current_component != $bp->activity->slug || !$bp->displayed_user->id || $bp->current_action != 'mentions' || !isset( $bp->action_variables[0] ) || $bp->action_variables[0] != 'feed' ) 460 463 return false; 461 464 … … 471 474 global $bp, $wp_query; 472 475 473 if ( $bp->current_component != $bp->activity->slug || !$bp->displayed_user->id || $bp->current_action != 'favorites' || $bp->action_variables[0] != 'feed' )476 if ( $bp->current_component != $bp->activity->slug || !$bp->displayed_user->id || $bp->current_action != 'favorites' || !isset( $bp->action_variables[0] ) || $bp->action_variables[0] != 'feed' ) 474 477 return false; 475 478 -
trunk/bp-activity/bp-activity-classes.php
r3365 r3369 13 13 var $date_recorded; 14 14 var $hide_sitewide = false; 15 var $mptt_left; 16 var $mptt_right; 15 17 16 18 function bp_activity_activity( $id = false ) { -
trunk/bp-activity/bp-activity-templatetags.php
r3365 r3369 445 445 446 446 // If this is a user object pass the users' email address for Gravatar so we don't have to refetch it. 447 if ( 'user' == $object && empty( $email ) )447 if ( 'user' == $object && empty( $email ) && isset( $activities_template->activity->user_email ) ) 448 448 $email = $activities_template->activity->user_email; 449 449 … … 656 656 return false; 657 657 658 $content .= '<ul>';658 $content = '<ul>'; 659 659 foreach ( (array)$comment->children as $comment ) { 660 660 if ( !$comment->user_fullname ) … … 999 999 global $bp; 1000 1000 1001 $link = ''; 1002 1001 1003 if ( $bp->current_component == $bp->profile->slug || 'just-me' == $bp->current_action ) 1002 1004 $link = $bp->displayed_user->domain . $bp->activity->slug . '/feed/'; 1003 else 1005 elseif ( $bp->friends->slug == $bp->current_action ) 1004 1006 $link = $bp->displayed_user->domain . $bp->activity->slug . '/' . $bp->friends->slug . '/feed/'; 1005 else 1007 elseif ( $bp->groups->slug == $bp->current_action ) 1006 1008 $link = $bp->displayed_user->domain . $bp->activity->slug . '/' . $bp->groups->slug . '/feed/'; 1007 else 1009 elseif ( 'favorites' == $bp->current_action ) 1008 1010 $link = $bp->displayed_user->domain . $bp->activity->slug . '/favorites/feed/'; 1009 else 1011 elseif ( 'mentions' == $bp->current_action ) 1010 1012 $link = $bp->displayed_user->domain . $bp->activity->slug . '/mentions/feed/'; 1011 1013 -
trunk/bp-core/admin/bp-core-admin.php
r3358 r3369 23 23 function bp_core_admin_settings() { 24 24 global $wpdb, $bp, $current_blog; 25 26 $ud = get_userdata( $bp->loggedin_user->id ); 25 27 ?> 26 28 -
trunk/bp-core/bp-core-classes.php
r3368 r3369 238 238 global $wpdb, $bp; 239 239 240 $pag_sql = ''; 240 241 if ( $limit && $page ) 241 242 $pag_sql = $wpdb->prepare( " LIMIT %d, %d", intval( ( $page - 1 ) * $limit), intval( $limit ) ); … … 267 268 * We can't add these to the main query above since only users who have this information will be returned (since the much of the data is in usermeta and won't support any type of directional join) 268 269 */ 270 $user_ids = array(); 269 271 foreach ( (array)$paged_users as $user ) 270 272 $user_ids[] = $user->id; -
trunk/bp-core/bp-core-filters.php
r3362 r3369 127 127 return $redirect_to; 128 128 129 if ( !empty( $_REQUEST['redirect_to'] ) || strpos( $_REQUEST['redirect_to'], 'wp-admin') )129 if ( isset( $_REQUEST['redirect_to'] ) && ( !empty( $_REQUEST['redirect_to'] ) || strpos( $_REQUEST['redirect_to'], 'wp-admin' ) ) ) 130 130 return $redirect_to; 131 131 -
trunk/bp-core/bp-core-settings.php
r3352 r3369 115 115 $bp_settings_updated = false; 116 116 117 if ( $_POST['submit']) {117 if ( isset( $_POST['submit'] ) ) { 118 118 check_admin_referer('bp_settings_notifications'); 119 119 120 if ( $_POST['notifications']) {120 if ( isset( $_POST['notifications'] ) ) { 121 121 foreach ( (array)$_POST['notifications'] as $key => $value ) { 122 122 update_user_meta( (int)$current_user->id, $key, $value ); -
trunk/bp-core/bp-core-signup.php
r3365 r3369 14 14 if ( $bp->current_component != BP_REGISTER_SLUG ) 15 15 return false; 16 17 $bp->is_directory = false; 16 18 17 19 /* If the user is logged in, redirect away from here */ … … 287 289 288 290 // Add our slugs to the array and allow them to be filtered 289 $filtered_illegal_names = apply_filters( 'bp_core_illegal_usernames', array( 'www', 'web', 'root', 'admin', 'main', 'invite', 'administrator', BP_GROUPS_SLUG, BP_MEMBERS_SLUG, BP_FORUMS_SLUG, BP_BLOGS_SLUG, BP_ACTIVITY_SLUG, BP_XPROFILE_SLUG, BP_FRIENDS_SLUG, BP_SEARCH_SLUG, BP_SETTINGS_SLUG, BP_REGISTER_SLUG, BP_ACTIVATION_SLUG ) ); 291 $filtered_illegal_names = array( 'www', 'web', 'root', 'admin', 'main', 'invite', 'administrator' ); 292 293 if ( bp_is_active( 'activity' ) ) 294 $filtered_illegal_names[] = BP_ACTIVITY_SLUG; 295 296 if ( is_multisite() && bp_is_active( 'blogs' ) ) 297 $filtered_illegal_names[] = BP_BLOGS_SLUG; 298 299 if ( bp_is_active( 'forums' ) ) 300 $filtered_illegal_names[] = BP_FORUMS_SLUG; 301 302 if ( bp_is_active( 'friends' ) ) 303 $filtered_illegal_names[] = BP_FRIENDS_SLUG; 304 305 if ( bp_is_active( 'groups' ) ) 306 $filtered_illegal_names[] = BP_GROUPS_SLUG; 307 308 if ( bp_is_active( 'xprofile' ) ) 309 $filtered_illegal_names[] = BP_XPROFILE_SLUG; 310 311 $filtered_illegal_names[] = BP_ACTIVATION_SLUG; 312 $filtered_illegal_names[] = BP_MEMBERS_SLUG; 313 $filtered_illegal_names[] = BP_REGISTER_SLUG; 314 $filtered_illegal_names[] = BP_SEARCH_SLUG; 315 $filtered_illegal_names[] = BP_SETTINGS_SLUG; 316 $filtered_illegal_names = apply_filters( 'bp_core_illegal_usernames', $filtered_illegal_names ); 290 317 291 318 // Merge the arrays together … … 324 351 bp_core_flush_illegal_names(); 325 352 353 $illegal_names = get_site_option( 'illegal_names' ); 354 326 355 if ( !validate_username( $user_name ) || in_array( $user_name, (array)$illegal_names ) || $user_name != $maybe[0] ) 327 356 $errors->add( 'user_name', __( 'Only lowercase letters and numbers allowed', 'buddypress' ) ); -
trunk/bp-core/bp-core-templatetags.php
r3368 r3369 377 377 extract( $r, EXTR_SKIP ); 378 378 379 if ( ! $update = maybe_unserialize( $members_template->member->latest_update ) )379 if ( !isset( $members_template->member->latest_update ) || !$update = maybe_unserialize( $members_template->member->latest_update ) ) 380 380 return false; 381 381 … … 1147 1147 } 1148 1148 function bp_get_signup_username_value() { 1149 return apply_filters( 'bp_get_signup_username_value', $_POST['signup_username'] ); 1149 $value = ''; 1150 if ( isset( $_POST['signup_username'] ) ) 1151 $value = $_POST['signup_username']; 1152 1153 return apply_filters( 'bp_get_signup_username_value', $value ); 1150 1154 } 1151 1155 … … 1154 1158 } 1155 1159 function bp_get_signup_email_value() { 1156 return apply_filters( 'bp_get_signup_email_value', $_POST['signup_email'] ); 1160 $value = ''; 1161 if ( isset( $_POST['signup_email'] ) ) 1162 $value = $_POST['signup_email']; 1163 1164 return apply_filters( 'bp_get_signup_email_value', $value ); 1157 1165 } 1158 1166 … … 1161 1169 } 1162 1170 function bp_get_signup_with_blog_value() { 1163 return apply_filters( 'bp_get_signup_with_blog_value', $_POST['signup_with_blog'] ); 1171 $value = ''; 1172 if ( isset( $_POST['signup_with_blog'] ) ) 1173 $value = $_POST['signup_with_blog']; 1174 1175 return apply_filters( 'bp_get_signup_with_blog_value', $value ); 1164 1176 } 1165 1177 … … 1168 1180 } 1169 1181 function bp_get_signup_blog_url_value() { 1170 return apply_filters( 'bp_get_signup_blog_url_value', $_POST['signup_blog_url'] ); 1182 $value = ''; 1183 if ( isset( $_POST['signup_blog_url'] ) ) 1184 $value = $_POST['signup_blog_url']; 1185 1186 return apply_filters( 'bp_get_signup_blog_url_value', $value ); 1171 1187 } 1172 1188 … … 1175 1191 } 1176 1192 function bp_get_signup_blog_title_value() { 1177 return apply_filters( 'bp_get_signup_blog_title_value', $_POST['signup_blog_title'] ); 1193 $value = ''; 1194 if ( isset( $_POST['signup_blog_title'] ) ) 1195 $value = $_POST['signup_blog_title']; 1196 1197 return apply_filters( 'bp_get_signup_blog_title_value', $value ); 1178 1198 } 1179 1199 … … 1182 1202 } 1183 1203 function bp_get_signup_blog_privacy_value() { 1184 return apply_filters( 'bp_get_signup_blog_privacy_value', $_POST['signup_blog_privacy'] ); 1204 $value = ''; 1205 if ( isset( $_POST['signup_blog_privacy'] ) ) 1206 $value = $_POST['signup_blog_privacy']; 1207 1208 return apply_filters( 'bp_get_signup_blog_privacy_value', $value ); 1185 1209 } 1186 1210 … … 1940 1964 global $bp; 1941 1965 1966 $bp_classes = array(); 1967 1942 1968 if ( bp_is_front_page() ) 1943 1969 $bp_classes[] = 'home-page'; -
trunk/bp-forums/bp-forums-bbpress.php
r3349 r3369 6 6 7 7 /* Return if we've already run this function. */ 8 if ( is_object( $bbdb ) && is_object( $bb_roles ))8 if ( is_object( $bbdb ) ) 9 9 return; 10 10 -
trunk/bp-forums/bp-forums-templatetags.php
r3308 r3369 177 177 178 178 /* If we're in a single group, set this group's forum_id */ 179 if ( !$forum_id && $bp->groups->current_group) {179 if ( !$forum_id && isset( $bp->groups->current_group ) ) { 180 180 $bp->groups->current_group->forum_id = groups_get_groupmeta( $bp->groups->current_group->id, 'forum_id' ); 181 181 … … 192 192 193 193 /* Show stickies on a group forum */ 194 if ( $bp->groups->current_group)194 if ( isset( $bp->groups->current_group ) ) 195 195 $no_stickies = null; 196 196 -
trunk/bp-friends.php
r3331 r3369 76 76 global $bp; 77 77 78 if ( isset( $bp->action_variables) && 'accept' == $bp->action_variables[0] && is_numeric($bp->action_variables[1]) ) {78 if ( isset( $bp->action_variables[0] ) && isset( $bp->action_variables[1] ) && 'accept' == $bp->action_variables[0] && is_numeric( $bp->action_variables[1] ) ) { 79 79 /* Check the nonce */ 80 80 check_admin_referer( 'friends_accept_friendship' ); 81 81 82 if ( friends_accept_friendship( $bp->action_variables[1] ) ) {82 if ( friends_accept_friendship( $bp->action_variables[1] ) ) 83 83 bp_core_add_message( __( 'Friendship accepted', 'buddypress' ) ); 84 } else {84 else 85 85 bp_core_add_message( __( 'Friendship could not be accepted', 'buddypress' ), 'error' ); 86 } 86 87 87 bp_core_redirect( $bp->loggedin_user->domain . $bp->current_component . '/' . $bp->current_action ); 88 88 89 } else if ( isset($bp->action_variables) && 'reject' == $bp->action_variables[0] && is_numeric($bp->action_variables[1]) ) {89 } elseif ( isset( $bp->action_variables[0] ) && isset( $bp->action_variables[1] ) && 'reject' == $bp->action_variables[0] && is_numeric( $bp->action_variables[1] ) ) { 90 90 /* Check the nonce */ 91 91 check_admin_referer( 'friends_reject_friendship' ); 92 92 93 if ( friends_reject_friendship( $bp->action_variables[1] ) ) {93 if ( friends_reject_friendship( $bp->action_variables[1] ) ) 94 94 bp_core_add_message( __( 'Friendship rejected', 'buddypress' ) ); 95 } else {95 else 96 96 bp_core_add_message( __( 'Friendship could not be rejected', 'buddypress' ), 'error' ); 97 } 97 98 98 bp_core_redirect( $bp->loggedin_user->domain . $bp->current_component . '/' . $bp->current_action ); 99 99 } -
trunk/bp-friends/bp-friends-classes.php
r3300 r3369 93 93 94 94 $friends = $wpdb->get_results( $wpdb->prepare( "SELECT friend_user_id, initiator_user_id FROM {$bp->friends->table_name} $friend_sql $oc_sql ORDER BY date_created DESC" ) ); 95 $fids = array(); 95 96 96 97 for ( $i = 0; $i < count($friends); $i++ ) { -
trunk/bp-friends/bp-friends-templatetags.php
r3353 r3369 118 118 global $members_template; 119 119 120 if ( null === $members_template->member->is_friend )120 if ( !isset( $members_template->member->is_friend ) || null === $members_template->member->is_friend ) 121 121 $friend_status = 'not_friends'; 122 122 else -
trunk/bp-groups.php
r3360 r3369 217 217 global $bp; 218 218 219 $group_id = $bp->action_variables[1]; 220 221 if ( isset($bp->action_variables) && in_array( 'accept', (array)$bp->action_variables ) && is_numeric($group_id) ) { 219 $group_id = 0; 220 if ( isset( $bp->action_variables[1] ) ) 221 $group_id = $bp->action_variables[1]; 222 223 if ( isset( $bp->action_variables ) && in_array( 'accept', (array)$bp->action_variables ) && is_numeric( $group_id ) ) { 222 224 /* Check the nonce */ 223 225 if ( !check_admin_referer( 'groups_accept_invite' ) ) … … 241 243 bp_core_redirect( $bp->loggedin_user->domain . $bp->current_component . '/' . $bp->current_action ); 242 244 243 } else if ( isset($bp->action_variables) && in_array( 'reject', (array)$bp->action_variables ) && is_numeric($group_id) ) {245 } elseif ( isset( $bp->action_variables ) && in_array( 'reject', (array)$bp->action_variables ) && is_numeric( $group_id ) ) { 244 246 /* Check the nonce */ 245 247 if ( !check_admin_referer( 'groups_reject_invite' ) ) 246 248 return false; 247 249 248 if ( !groups_reject_invite( $bp->loggedin_user->id, $group_id ) ) {250 if ( !groups_reject_invite( $bp->loggedin_user->id, $group_id ) ) 249 251 bp_core_add_message( __('Group invite could not be rejected', 'buddypress'), 'error' ); 250 } else {252 else 251 253 bp_core_add_message( __('Group invite rejected', 'buddypress') ); 252 }253 254 254 255 bp_core_redirect( $bp->loggedin_user->domain . $bp->current_component . '/' . $bp->current_action ); … … 1244 1245 global $bp, $wp_query; 1245 1246 1246 if ( !bp_is_active( 'activity' ) || $bp->current_component != $bp->groups->slug || ! $bp->groups->current_group|| $bp->current_action != 'feed' )1247 if ( !bp_is_active( 'activity' ) || $bp->current_component != $bp->groups->slug || !isset( $bp->groups->current_group ) || $bp->current_action != 'feed' ) 1247 1248 return false; 1248 1249 -
trunk/bp-groups/bp-groups-classes.php
r3365 r3369 261 261 global $wpdb, $bp; 262 262 263 $pag_sql = ''; 263 264 if ( $limit && $page ) 264 265 $pag_sql = $wpdb->prepare( " LIMIT %d, %d", intval( ( $page - 1 ) * $limit), intval( $limit ) ); 265 266 267 $hidden_sql = ''; 266 268 if ( !is_user_logged_in() || ( !is_super_admin() && ( $user_id != $bp->loggedin_user->id ) ) ) 267 269 $hidden_sql = "AND g.status != 'hidden'"; 268 270 271 $search_sql = ''; 269 272 if ( $search_terms ) { 270 273 $search_terms = like_escape( $wpdb->escape( $search_terms ) ); … … 282 285 283 286 if ( !empty( $populate_extras ) ) { 287 $group_ids = array(); 284 288 foreach ( (array)$paged_groups as $group ) $group_ids[] = $group->id; 285 289 $group_ids = $wpdb->escape( join( ',', (array)$group_ids ) ); … … 316 320 } 317 321 318 $group_ids = array();319 322 if ( !empty( $populate_extras ) ) { 323 $group_ids = array(); 320 324 foreach ( (array)$paged_groups as $group ) $group_ids[] = $group->id; 321 325 $group_ids = $wpdb->escape( join( ',', (array)$group_ids ) ); … … 329 333 global $wpdb, $bp; 330 334 335 $pag_sql = ''; 331 336 if ( $limit && $page ) { 332 337 $pag_sql = $wpdb->prepare( " LIMIT %d, %d", intval( ( $page - 1 ) * $limit), intval( $limit ) ); 333 338 } 334 339 340 $hidden_sql = ''; 335 341 if ( !is_user_logged_in() || ( !is_super_admin() && ( $user_id != $bp->loggedin_user->id ) ) ) 336 342 $hidden_sql = "AND g.status != 'hidden'"; 337 343 344 $search_sql = ''; 338 345 if ( $search_terms ) { 339 346 $search_terms = like_escape( $wpdb->escape( $search_terms ) ); … … 351 358 352 359 if ( !empty( $populate_extras ) ) { 360 $group_ids = array(); 353 361 foreach ( (array)$paged_groups as $group ) $group_ids[] = $group->id; 354 362 $group_ids = $wpdb->escape( join( ',', (array)$group_ids ) ); … … 362 370 global $wpdb, $bp; 363 371 372 $pag_sql = ''; 364 373 if ( $limit && $page ) 365 374 $pag_sql = $wpdb->prepare( " LIMIT %d, %d", intval( ( $page - 1 ) * $limit), intval( $limit ) ); 366 375 376 $hidden_sql = ''; 367 377 if ( !is_user_logged_in() || ( !is_super_admin() && ( $user_id != $bp->loggedin_user->id ) ) ) 368 378 $hidden_sql = " AND g.status != 'hidden'"; 369 379 380 $search_sql = ''; 370 381 if ( $search_terms ) { 371 382 $search_terms = like_escape( $wpdb->escape( $search_terms ) ); … … 383 394 384 395 if ( !empty( $populate_extras ) ) { 396 $group_ids = array(); 385 397 foreach ( (array)$paged_groups as $group ) $group_ids[] = $group->id; 386 398 $group_ids = $wpdb->escape( join( ',', (array)$group_ids ) ); … … 824 836 global $wpdb, $bp; 825 837 838 $pag_sql = ''; 826 839 if ( $limit && $page ) 827 840 $pag_sql = $wpdb->prepare( " LIMIT %d, %d", intval( ( $page - 1 ) * $limit), intval( $limit ) ); -
trunk/bp-groups/bp-groups-filters.php
r3300 r3369 66 66 67 67 /* Only filter the forum SQL on group pages or on the forums directory */ 68 if ( ( $bp->groups->current_group && 'public' == $bp->groups->current_group->status ) || !$bp->groups->current_group) {68 if ( ( isset( $bp->groups->current_group ) && 'public' == $bp->groups->current_group->status ) || ( !isset( $bp->groups->current_group ) || !$bp->groups->current_group ) ) { 69 69 add_filter( 'get_topics_fields', 'groups_add_forum_fields_sql' ); 70 70 add_filter( 'get_topics_index_hint', 'groups_add_forum_tables_sql' ); -
trunk/bp-themes/bp-default/comments.php
r3300 r3369 161 161 <?php endif; ?> 162 162 163 <?php if ( $numTrackBacks ) : ?>163 <?php if ( isset( $numTrackBacks ) && $numTrackBacks ) : ?> 164 164 <div id="trackbacks"> 165 165 -
trunk/bp-themes/bp-default/functions.php
r3365 r3369 37 37 ); 38 38 39 if ( bp_is_profile_component() && !bp_is_directory() ) 39 global $bp; 40 if ( isset( $bp->displayed_user->id ) ) 40 41 $params['mention_explain'] = sprintf( __( "%s is a unique identifier for %s that you can type into any message on this site. %s will be sent a notification and a link to your message any time you use it.", 'buddypress' ), '@' . bp_get_displayed_user_username(), bp_get_user_firstname( bp_get_displayed_user_fullname() ), bp_get_user_firstname( bp_get_displayed_user_fullname() ) ); 41 42 -
trunk/bp-themes/bp-default/sidebar.php
r3300 r3369 40 40 <form name="login-form" id="sidebar-login-form" class="standard-form" action="<?php echo site_url( 'wp-login.php', 'login_post' ) ?>" method="post"> 41 41 <label><?php _e( 'Username', 'buddypress' ) ?><br /> 42 <input type="text" name="log" id="sidebar-user-login" class="input" value="<?php echo esc_attr(stripslashes($user_login)); ?>"/></label>42 <input type="text" name="log" id="sidebar-user-login" class="input" /></label> 43 43 44 44 <label><?php _e( 'Password', 'buddypress' ) ?><br /> 45 <input type="password" name="pwd" id="sidebar-user-pass" class="input" value=""/></label>45 <input type="password" name="pwd" id="sidebar-user-pass" class="input" /></label> 46 46 47 47 <p class="forgetmenot"><label><input name="rememberme" type="checkbox" id="sidebar-rememberme" value="forever" /> <?php _e( 'Remember Me', 'buddypress' ) ?></label></p> -
trunk/bp-xprofile.php
r3365 r3369 175 175 global $bp; 176 176 177 do_action( 'xprofile_screen_display_profile', $_GET['new'] ); 177 $new = ''; 178 if ( isset( $_GET['new'] ) ) 179 $new = $_GET['new']; 180 181 do_action( 'xprofile_screen_display_profile', $new ); 178 182 bp_core_load_template( apply_filters( 'xprofile_template_display_profile', 'members/single/home' ) ); 179 183 } … … 345 349 global $bp; 346 350 347 if ( $bp->profile->slug != $bp->current_component || 'change-avatar' != $bp->current_action || 'delete-avatar' != $bp->action_variables[0] )351 if ( $bp->profile->slug != $bp->current_component || 'change-avatar' != $bp->current_action || !isset( $bp->action_variables[0] ) || 'delete-avatar' != $bp->action_variables[0] ) 348 352 return false; 349 353 -
trunk/bp-xprofile/bp-xprofile-admin.php
r3300 r3369 68 68 if ( $groups ) : 69 69 foreach ( $groups as $group ) { ?> 70 <li id="group_<?php echo $group->id; ?>"><a href="#tabs-<?php echo $group->id; ?>" class="ui-tab"><?php echo attribute_escape( $group->name ); ?><?php if ( !$group->can_delete ) : ?> <?php _e( '(Core)', 'buddypress'); endif; ?></a></li>70 <li id="group_<?php echo $group->id; ?>"><a href="#tabs-<?php echo $group->id; ?>" class="ui-tab"><?php echo esc_attr( $group->name ); ?><?php if ( !$group->can_delete ) : ?> <?php _e( '(Core)', 'buddypress'); endif; ?></a></li> 71 71 <?php } 72 72 endif; ?> … … 76 76 foreach ( $groups as $group ) { ?> 77 77 <noscript> 78 <h3><?php echo attribute_escape( $group->name ) ?></h3>78 <h3><?php echo esc_attr( $group->name ) ?></h3> 79 79 </noscript> 80 80 <div id="tabs-<?php echo $group->id; ?>" class="tab-wrapper"> 81 81 <div class="tab-toolbar"> 82 82 <div class="tab-toolbar-left"> 83 <a class="button" href="admin.php?page=bp-profile-setup&group_id=<?php echo attribute_escape( $group->id ); ?>&mode=add_field"><?php _e( 'Add New Field', 'buddypress' ); ?></a>84 <a class="button edit" href="admin.php?page=bp-profile-setup&mode=edit_group&group_id=<?php echo attribute_escape( $group->id ); ?>"><?php _e( 'Edit Group', 'buddypress' ); ?></a>83 <a class="button" href="admin.php?page=bp-profile-setup&group_id=<?php echo esc_attr( $group->id ); ?>&mode=add_field"><?php _e( 'Add New Field', 'buddypress' ); ?></a> 84 <a class="button edit" href="admin.php?page=bp-profile-setup&mode=edit_group&group_id=<?php echo esc_attr( $group->id ); ?>"><?php _e( 'Edit Group', 'buddypress' ); ?></a> 85 85 <?php if ( $group->can_delete ) : ?> 86 <a class="button delete" href="admin.php?page=bp-profile-setup&mode=delete_group&group_id=<?php echo attribute_escape( $group->id ); ?>"><?php _e( 'Delete Group', 'buddypress' ); ?></a>86 <a class="button delete" href="admin.php?page=bp-profile-setup&mode=delete_group&group_id=<?php echo esc_attr( $group->id ); ?>"><?php _e( 'Delete Group', 'buddypress' ); ?></a> 87 87 <?php endif; ?> 88 88 </div> … … 91 91 <fieldset id="<?php echo $group->id; ?>" class="connectedSortable field-group"> 92 92 <?php if( $group->description ) : ?> 93 <legend><?php echo attribute_escape( $group->description ) ?></legend>93 <legend><?php echo esc_attr( $group->description ) ?></legend> 94 94 <?php endif; 95 95 … … 99 99 /* Load the field */ 100 100 $field = new BP_XProfile_Field( $field->id ); 101 102 $class = ''; 101 103 if ( !$field->can_delete ) 102 $class .= ' core nodrag';104 $class = ' core nodrag'; 103 105 104 106 /* This function handles the WYSIWYG profile field 105 107 * display for the xprofile admin setup screen 106 108 */ 107 xprofile_admin_field( $field, $group );109 xprofile_admin_field( $field, $group, $class ); 108 110 109 111 } /* end for */ … … 328 330 Handles the WYSIWYG display of each profile field on the edit screen 329 331 **************************************************************************/ 330 function xprofile_admin_field( $admin_field, $admin_group ) {332 function xprofile_admin_field( $admin_field, $admin_group, $class='' ) { 331 333 global $field; 332 334 333 335 $field = $admin_field; 334 336 ?> 335 <fieldset id="field_<?php echo attribute_escape( $field->id ); ?>" class="sortable<?php echo ' ' . $field->type; if ( $class ) echo ' ' . $class; ?>">337 <fieldset id="field_<?php echo esc_attr( $field->id ); ?>" class="sortable<?php echo ' ' . $field->type; if ( $class ) echo ' ' . $class; ?>"> 336 338 <legend><?php bp_the_profile_field_name(); ?> <?php if( !$field->can_delete ) : ?> <?php _e( '(Core)', 'buddypress' ); endif; ?> <?php if ( bp_get_the_profile_field_is_required() ) : ?><?php _e( '(required)', 'buddypress' ) ?><?php endif; ?></legend> 337 339 <div class="field-wrapper"> … … 394 396 <?php } ?> 395 397 <div class="actions"> 396 <a class="button edit" href="admin.php?page=bp-profile-setup&group_id=<?php echo attribute_escape( $admin_group->id ); ?>&field_id=<?php echo attribute_escape( $field->id ); ?>&mode=edit_field"><?php _e( 'Edit', 'buddypress' ); ?></a>397 <?php if ( !$field->can_delete ) : ?> <?php else : ?><a class="button delete" href="admin.php?page=bp-profile-setup&field_id=<?php echo attribute_escape( $field->id ); ?>&mode=delete_field"><?php _e( 'Delete', 'buddypress' ); ?></a><?php endif; ?>398 <a class="button edit" href="admin.php?page=bp-profile-setup&group_id=<?php echo esc_attr( $admin_group->id ); ?>&field_id=<?php echo esc_attr( $field->id ); ?>&mode=edit_field"><?php _e( 'Edit', 'buddypress' ); ?></a> 399 <?php if ( !$field->can_delete ) : ?> <?php else : ?><a class="button delete" href="admin.php?page=bp-profile-setup&field_id=<?php echo esc_attr( $field->id ); ?>&mode=delete_field"><?php _e( 'Delete', 'buddypress' ); ?></a><?php endif; ?> 398 400 399 401 </div> 400 402 <?php if ( $field->description ) : ?> 401 <p class="description"><?php echo attribute_escape( $field->description ); ?></p>403 <p class="description"><?php echo esc_attr( $field->description ); ?></p> 402 404 <?php endif; ?> 403 405 </div> -
trunk/bp-xprofile/bp-xprofile-classes.php
r3357 r3369 94 94 extract( $r, EXTR_SKIP ); 95 95 96 $group_id_sql = ''; 96 97 if ( $profile_group_id ) 97 98 $group_id_sql = $wpdb->prepare( 'WHERE g.id = %d', $profile_group_id ); … … 258 259 global $wpdb, $userdata, $bp; 259 260 261 $user_id = 0; 260 262 if ( is_null( $user_id ) ) 261 263 $user_id = $userdata->ID; … … 264 266 265 267 if ( $field = $wpdb->get_row( $sql ) ) { 266 $this->id = $field->id; 267 $this->group_id = $field->group_id; 268 $this->parent_id = $field->parent_id; 269 $this->type = $field->type; 270 $this->name = stripslashes($field->name); 271 $this->description = stripslashes($field->description); 272 $this->is_required = $field->is_required; 273 $this->can_delete = $field->can_delete; 274 $this->field_order = $field->field_order; 275 $this->option_order = $field->option_order; 276 $this->order_by = $field->order_by; 277 $this->is_default_option = $field->is_default_option; 278 279 if ( $get_data ) 280 $this->data = $this->get_field_data( $user_id ); 281 268 $this->id = $field->id; 269 $this->group_id = $field->group_id; 270 $this->parent_id = $field->parent_id; 271 $this->type = $field->type; 272 $this->name = stripslashes( $field->name ); 273 $this->description = stripslashes( $field->description ); 274 $this->is_required = $field->is_required; 275 $this->can_delete = $field->can_delete; 276 $this->field_order = $field->field_order; 277 $this->option_order = $field->option_order; 278 $this->order_by = $field->order_by; 279 $this->is_default_option = $field->is_default_option; 280 281 if ( $get_data && $user_id ) 282 $this->data = $this->get_field_data( $user_id ); 282 283 } 283 284 } -
trunk/bp-xprofile/bp-xprofile-templatetags.php
r3300 r3369 1 1 <?php 2 3 2 /*************************************************************************** 4 3 * XProfile Data Display Template Tags … … 257 256 global $group; 258 257 258 $field_ids = ''; 259 259 foreach ( (array) $group->fields as $field ) 260 260 $field_ids .= $field->id . ','; … … 311 311 * value as long as it's not empty and a required field. 312 312 */ 313 if ( isset( $_POST['field_' . $field->id] ) && ( $field->data->value != $_POST['field_' . $field->id] )) {313 if ( isset( $_POST['field_' . $field->id] ) && isset( $field->data->value ) && $field->data->value != $_POST['field_' . $field->id] ) { 314 314 if ( !empty( $_POST['field_' . $field->id] ) ) 315 315 $field->data->value = $_POST['field_' . $field->id]; 316 316 } 317 317 318 $field->data->value = bp_unserialize_profile_field( $field->data->value ); 319 320 return apply_filters( 'bp_get_the_profile_field_edit_value', esc_html( $field->data->value ) ); 318 if ( isset( $field->data->value ) ) 319 return apply_filters( 'bp_get_the_profile_field_edit_value', esc_html( bp_unserialize_profile_field( $field->data->value ) ) ); 320 else 321 return apply_filters( 'bp_get_the_profile_field_edit_value', '' ); 321 322 } 322 323 … … 677 678 678 679 function bp_get_user_has_avatar() { 680 global $bp; 681 679 682 if ( !bp_core_fetch_avatar( array( 'item_id' => $bp->displayed_user->id, 'no_grav' => true ) ) ) 680 683 return false; … … 697 700 ) ); 698 701 } 699 700 702 ?>
Note: See TracChangeset
for help on using the changeset viewer.