Changeset 2352 for trunk/bp-groups.php
- Timestamp:
- 01/19/2010 11:27:58 AM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-groups.php
r2345 r2352 697 697 return false; 698 698 699 if ( !groups_edit_base_group_details( $_POST['group-id'], $_POST['group-name'], $_POST['group-desc'], $_POST['group-news'],(int)$_POST['group-notify-members'] ) ) {699 if ( !groups_edit_base_group_details( $_POST['group-id'], $_POST['group-name'], $_POST['group-desc'], (int)$_POST['group-notify-members'] ) ) { 700 700 bp_core_add_message( __( 'There was an error updating group details, please try again.', 'buddypress' ), 'error' ); 701 701 } else { … … 726 726 // If the edit form has been submitted, save the edited details 727 727 if ( isset( $_POST['save'] ) ) { 728 $enable_wire = ( isset($_POST['group-show-wire'] ) ) ? 1 : 0;729 728 $enable_forum = ( isset($_POST['group-show-forum'] ) ) ? 1 : 0; 730 729 $enable_photos = ( isset($_POST['group-show-photos'] ) ) ? 1 : 0; … … 738 737 return false; 739 738 740 if ( !groups_edit_group_settings( $_POST['group-id'], $enable_ wire, $enable_forum, $enable_photos, $photos_admin_only, $status ) ) {739 if ( !groups_edit_group_settings( $_POST['group-id'], $enable_forum, $enable_photos, $photos_admin_only, $status ) ) { 741 740 bp_core_add_message( __( 'There was an error updating group settings, please try again.', 'buddypress' ), 'error' ); 742 741 } else { … … 1097 1096 } 1098 1097 1099 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'], ' news' => $_POST['group-news'], 'slug' => groups_check_slug( sanitize_title($_POST['group-name']) ), 'date_created' => time() ) ) ) {1098 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($_POST['group-name']) ), 'date_created' => time() ) ) ) { 1100 1099 bp_core_add_message( __( 'There was an error saving group details, please try again.', 'buddypress' ), 'error' ); 1101 1100 bp_core_redirect( $bp->root_domain . '/' . $bp->groups->slug . '/create/step/' . $bp->groups->current_create_step . '/' ); … … 1108 1107 if ( 'group-settings' == $bp->groups->current_create_step ) { 1109 1108 $group_status = 'public'; 1110 $group_enable_wire = 1;1111 1109 $group_enable_forum = 1; 1112 1113 if ( !isset($_POST['group-show-wire']) )1114 $group_enable_wire = 0;1115 1110 1116 1111 if ( !isset($_POST['group-show-forum']) ) { … … 1128 1123 $group_status = 'hidden'; 1129 1124 1130 if ( !$bp->groups->new_group_id = groups_create_group( array( 'group_id' => $bp->groups->new_group_id, 'status' => $group_status, 'enable_ wire' => $group_enable_wire, 'enable_forum' => $group_enable_forum ) ) ) {1125 if ( !$bp->groups->new_group_id = groups_create_group( array( 'group_id' => $bp->groups->new_group_id, 'status' => $group_status, 'enable_forum' => $group_enable_forum ) ) ) { 1131 1126 bp_core_add_message( __( 'There was an error saving group details, please try again.', 'buddypress' ), 'error' ); 1132 1127 bp_core_redirect( $bp->root_domain . '/' . $bp->groups->slug . '/create/step/' . $bp->groups->current_create_step . '/' ); … … 1478 1473 * 'name' 1479 1474 * 'description' 1480 * 'news'1481 1475 * 'slug' 1482 1476 * 'status' 1483 * 'enable_wire'1484 1477 * 'enable_forum' 1485 1478 * 'date_created' … … 1502 1495 $group->description = $description; 1503 1496 1504 if ( isset( $news ) )1505 $group->news = $news;1506 1507 1497 if ( isset( $slug ) && groups_check_slug( $slug ) ) 1508 1498 $group->slug = $slug; … … 1512 1502 $group->status = $status; 1513 1503 } 1514 1515 if ( isset( $enable_wire ) )1516 $group->enable_wire = $enable_wire;1517 else if ( !$group_id && !isset( $enable_wire ) )1518 $group->enable_wire = 1;1519 1504 1520 1505 if ( isset( $enable_forum ) ) … … 1546 1531 } 1547 1532 1548 function groups_edit_base_group_details( $group_id, $group_name, $group_desc, $ group_news, $notify_members ) {1533 function groups_edit_base_group_details( $group_id, $group_name, $group_desc, $notify_members ) { 1549 1534 global $bp; 1550 1535 … … 1555 1540 $group->name = $group_name; 1556 1541 $group->description = $group_desc; 1557 $group->news = $group_news;1558 1542 1559 1543 if ( !$group->save() ) … … 1570 1554 } 1571 1555 1572 function groups_edit_group_settings( $group_id, $enable_ wire, $enable_forum, $enable_photos, $photos_admin_only, $status ) {1556 function groups_edit_group_settings( $group_id, $enable_forum, $enable_photos, $photos_admin_only, $status ) { 1573 1557 global $bp; 1574 1558 1575 1559 $group = new BP_Groups_Group( $group_id, false, false ); 1576 $group->enable_wire = $enable_wire;1577 1560 $group->enable_forum = $enable_forum; 1578 1561 $group->enable_photos = $enable_photos;
Note: See TracChangeset
for help on using the changeset viewer.