Changeset 3472
- Timestamp:
- 11/21/2010 11:30:57 PM (14 years ago)
- Location:
- trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-core/bp-core-templatetags.php
r3454 r3472 705 705 function bp_get_avatar_admin_step() { 706 706 global $bp; 707 708 return apply_filters( 'bp_get_avatar_admin_step', $bp->avatar_admin->step ); 707 708 if ( isset( $bp->avatar_admin->step ) ) 709 $step = $bp->avatar_admin->step; 710 else 711 $step = ''; 712 713 return apply_filters( 'bp_get_avatar_admin_step', $step ); 709 714 } 710 715 … … 714 719 function bp_get_avatar_to_crop() { 715 720 global $bp; 716 717 return apply_filters( 'bp_get_avatar_to_crop', $bp->avatar_admin->image->url ); 721 722 if ( isset( $bp->avatar_admin->image->url ) ) 723 $url = $bp->avatar_admin->image->url; 724 else 725 $url = ''; 726 727 return apply_filters( 'bp_get_avatar_to_crop', $url ); 718 728 } 719 729 … … 1027 1037 $options['groups'] = __( 'Groups', 'buddypress' ); 1028 1038 1029 if ( function_exists( 'bp_forums_is_installed_correctly' ) && bp_forums_is_installed_correctly() && ! (int) $bp->site_options['bp-disable-forum-directory'])1039 if ( function_exists( 'bp_forums_is_installed_correctly' ) && bp_forums_is_installed_correctly() && !isset( $bp->site_options['bp-disable-forum-directory'] ) ) 1030 1040 $options['forums'] = __( 'Forums', 'buddypress' ); 1031 1041 -
trunk/bp-groups.php
r3455 r3472 97 97 /* When in a single group, the first action is bumped down one because of the 98 98 group name, so we need to adjust this and set the group name to current_item. */ 99 $bp->current_item = $bp->current_action;100 $bp->current_action = $bp->action_variables[0];99 $bp->current_item = isset( $bp->current_action ) ? $bp->current_action : false; 100 $bp->current_action = isset( $bp->action_variables[0] ) ? $bp->action_variables[0] : false; 101 101 array_shift($bp->action_variables); 102 102 … … 990 990 991 991 /* If no current step is set, reset everything so we can start a fresh group creation */ 992 if ( ! $bp->groups->current_create_step = $bp->action_variables[1] ) {992 if ( !isset( $bp->action_variables[1] ) || !$bp->groups->current_create_step = $bp->action_variables[1] ) { 993 993 994 994 unset( $bp->groups->current_create_step ); … … 1009 1009 1010 1010 /* Fetch the currently completed steps variable */ 1011 if ( isset( $_COOKIE['bp_completed_create_steps'] ) && ! $reset_steps)1011 if ( isset( $_COOKIE['bp_completed_create_steps'] ) && !isset( $reset_steps ) ) 1012 1012 $bp->groups->completed_create_steps = unserialize( stripslashes( $_COOKIE['bp_completed_create_steps'] ) ); 1013 1013 … … 1029 1029 bp_core_redirect( $bp->root_domain . '/' . $bp->groups->slug . '/create/step/' . $bp->groups->current_create_step . '/' ); 1030 1030 } 1031 1032 if ( !$bp->groups->new_group_id = groups_create_group( array( 'group_id' => $bp->groups->new_group_id, 'name' => $_POST['group-name'], 'description' => $_POST['group-desc'], 'slug' => groups_check_slug( sanitize_title( esc_attr( $_POST['group-name'] ) ) ), 'date_created' => bp_core_current_time(), 'status' => 'public' ) ) ) { 1031 1032 $new_group_id = isset( $bp->groups->new_group_id ) ? $bp->groups->new_group_id : 0; 1033 1034 if ( !$bp->groups->new_group_id = groups_create_group( array( 'group_id' => $new_group_id, 'name' => $_POST['group-name'], 'description' => $_POST['group-desc'], 'slug' => groups_check_slug( sanitize_title( esc_attr( $_POST['group-name'] ) ) ), 'date_created' => bp_core_current_time(), 'status' => 'public' ) ) ) { 1033 1035 bp_core_add_message( __( 'There was an error saving group details, please try again.', 'buddypress' ), 'error' ); 1034 1036 bp_core_redirect( $bp->root_domain . '/' . $bp->groups->slug . '/create/step/' . $bp->groups->current_create_step . '/' ); … … 1075 1077 * holding the information 1076 1078 */ 1077 if ( !in_array( $bp->groups->current_create_step, (array)$bp->groups->completed_create_steps ) ) 1079 $completed_create_steps = isset( $bp->groups->completed_create_steps ) ? $bp->groups->completed_create_steps : array(); 1080 if ( !in_array( $bp->groups->current_create_step, $completed_create_steps ) ) 1078 1081 $bp->groups->completed_create_steps[] = $bp->groups->current_create_step; 1079 1082 … … 1108 1111 } 1109 1112 1110 if ( $next) {1113 if ( isset( $next ) ) { 1111 1114 $next_step = $key; 1112 1115 break; … … 1465 1468 */ 1466 1469 1467 if ( $group_id )1470 if ( isset( $group_id ) && $group_id ) 1468 1471 $group = new BP_Groups_Group( $group_id ); 1469 1472 else 1470 1473 $group = new BP_Groups_Group; 1471 1474 1472 if ( $creator_id )1475 if ( isset( $creator_id ) && $creator_id ) 1473 1476 $group->creator_id = $creator_id; 1474 1477 else -
trunk/bp-groups/bp-groups-templatetags.php
r3449 r3472 1130 1130 1131 1131 // If they're not logged in or are banned from the group, no join button. 1132 if ( !is_user_logged_in() || $group->is_banned)1132 if ( !is_user_logged_in() || isset( $group->is_banned ) ) 1133 1133 return false; 1134 1134 … … 1633 1633 global $bp; 1634 1634 1635 if ( ! $bp->groups->completed_create_steps)1635 if ( !isset( $bp->groups->completed_create_steps ) ) 1636 1636 return false; 1637 1637 … … 1678 1678 function bp_get_new_group_id() { 1679 1679 global $bp; 1680 return apply_filters( 'bp_get_new_group_id', $bp->groups->new_group_id ); 1680 1681 if ( isset( $bp->groups->new_group_id ) ) 1682 $new_group_id = $bp->groups->new_group_id; 1683 else 1684 $new_group_id = 0; 1685 1686 return apply_filters( 'bp_get_new_group_id', $new_group_id ); 1681 1687 } 1682 1688 … … 1686 1692 function bp_get_new_group_name() { 1687 1693 global $bp; 1688 return apply_filters( 'bp_get_new_group_name', $bp->groups->current_group->name ); 1694 1695 if ( isset( $bp->groups->current_group->name ) ) 1696 $name = $bp->groups->current_group->name; 1697 else 1698 $name = ''; 1699 1700 return apply_filters( 'bp_get_new_group_name', $name ); 1689 1701 } 1690 1702 … … 1694 1706 function bp_get_new_group_description() { 1695 1707 global $bp; 1696 return apply_filters( 'bp_get_new_group_description', $bp->groups->current_group->description ); 1708 1709 if ( isset( $bp->groups->current_group->description ) ) 1710 $description = $bp->groups->current_group->description; 1711 else 1712 $description = ''; 1713 1714 return apply_filters( 'bp_get_new_group_description', $description ); 1697 1715 } 1698 1716
Note: See TracChangeset
for help on using the changeset viewer.