Changeset 2352
- Timestamp:
- 01/19/2010 11:27:58 AM (15 years ago)
- Location:
- trunk
- Files:
-
- 8 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; -
trunk/bp-groups/bp-groups-classes.php
r2351 r2352 7 7 var $slug; 8 8 var $description; 9 var $news;10 9 var $status; 11 var $enable_wire;12 10 var $enable_forum; 13 11 var $date_created; … … 18 16 var $total_member_count; 19 17 var $random_members; 20 var $latest_wire_posts;21 18 22 19 function bp_groups_group( $id = null, $single = false, $get_user_dataset = true ) { … … 43 40 $this->slug = $group->slug; 44 41 $this->description = stripslashes($group->description); 45 $this->news = stripslashes($group->news);46 42 $this->status = $group->status; 47 $this->enable_wire = $group->enable_wire;48 43 $this->enable_forum = $group->enable_forum; 49 44 $this->date_created = strtotime($group->date_created); … … 75 70 $this->slug = apply_filters( 'groups_group_slug_before_save', $this->slug, $this->id ); 76 71 $this->description = apply_filters( 'groups_group_description_before_save', $this->description, $this->id ); 77 $this->news = apply_filters( 'groups_group_news_before_save', $this->news, $this->id ); 78 $this->status = apply_filters( 'groups_group_status_before_save', $this->status, $this->id ); 79 $this->enable_wire = apply_filters( 'groups_group_enable_wire_before_save', $this->enable_wire, $this->id ); 72 $this->status = apply_filters( 'groups_group_status_before_save', $this->status, $this->id ); 80 73 $this->enable_forum = apply_filters( 'groups_group_enable_forum_before_save', $this->enable_forum, $this->id ); 81 74 $this->date_created = apply_filters( 'groups_group_date_created_before_save', $this->date_created, $this->id ); … … 90 83 slug = %s, 91 84 description = %s, 92 news = %s,93 85 status = %s, 94 enable_wire = %d,95 86 enable_forum = %d, 96 87 date_created = FROM_UNIXTIME(%d) … … 102 93 $this->slug, 103 94 $this->description, 104 $this->news,105 95 $this->status, 106 $this->enable_wire,107 96 $this->enable_forum, 108 97 $this->date_created, … … 116 105 slug, 117 106 description, 118 news,119 107 status, 120 enable_wire,121 108 enable_forum, 122 109 date_created 123 110 ) VALUES ( 124 %d, %s, %s, %s, %s, % s, %d, %d, FROM_UNIXTIME(%d)111 %d, %s, %s, %s, %s, %d, FROM_UNIXTIME(%d) 125 112 )", 126 113 $this->creator_id, … … 128 115 $this->slug, 129 116 $this->description, 130 $this->news,131 117 $this->status, 132 $this->enable_wire,133 118 $this->enable_forum, 134 119 $this->date_created -
trunk/bp-groups/bp-groups-filters.php
r2268 r2352 6 6 add_filter( 'bp_get_the_site_group_description', 'wptexturize' ); 7 7 add_filter( 'bp_get_the_site_group_description_excerpt', 'wptexturize' ); 8 add_filter( 'bp_get_group_news', 'wptexturize' );9 8 add_filter( 'bp_get_group_name', 'wptexturize' ); 10 9 add_filter( 'bp_get_the_site_group_name', 'wptexturize' ); … … 12 11 add_filter( 'bp_get_group_description', 'convert_smilies' ); 13 12 add_filter( 'bp_get_group_description_excerpt', 'convert_smilies' ); 14 add_filter( 'bp_get_group_news', 'convert_smilies' );15 13 add_filter( 'bp_get_the_site_group_description', 'convert_smilies' ); 16 14 add_filter( 'bp_get_the_site_group_description_excerpt', 'convert_smilies' ); … … 18 16 add_filter( 'bp_get_group_description', 'convert_chars' ); 19 17 add_filter( 'bp_get_group_description_excerpt', 'convert_chars' ); 20 add_filter( 'bp_get_group_news', 'convert_chars' );21 18 add_filter( 'bp_get_group_name', 'convert_chars' ); 22 19 add_filter( 'bp_get_the_site_group_name', 'convert_chars' ); … … 26 23 add_filter( 'bp_get_group_description', 'wpautop' ); 27 24 add_filter( 'bp_get_group_description_excerpt', 'wpautop' ); 28 add_filter( 'bp_get_group_news', 'wpautop' );29 25 add_filter( 'bp_get_the_site_group_description', 'wpautop' ); 30 26 add_filter( 'bp_get_the_site_group_description_excerpt', 'wpautop' ); … … 32 28 add_filter( 'bp_get_group_description', 'make_clickable' ); 33 29 add_filter( 'bp_get_group_description_excerpt', 'make_clickable' ); 34 add_filter( 'bp_get_group_news', 'make_clickable' );35 30 36 31 add_filter( 'bp_get_group_name', 'wp_filter_kses', 1 ); … … 38 33 add_filter( 'bp_get_group_description', 'wp_filter_kses', 1 ); 39 34 add_filter( 'bp_get_group_description_excerpt', 'wp_filter_kses', 1 ); 40 add_filter( 'bp_get_group_news', 'wp_filter_kses', 1 );41 35 add_filter( 'bp_get_the_site_group_name', 'wp_filter_kses', 1 ); 42 36 add_filter( 'bp_get_the_site_group_description', 'wp_filter_kses', 1 ); … … 44 38 add_filter( 'groups_group_name_before_save', 'wp_filter_kses', 1 ); 45 39 add_filter( 'groups_group_description_before_save', 'wp_filter_kses', 1 ); 46 add_filter( 'groups_group_news_before_save', 'wp_filter_kses', 1 );47 40 48 41 add_filter( 'bp_get_group_description', 'stripslashes' ); 49 42 add_filter( 'bp_get_group_description_excerpt', 'stripslashes' ); 50 add_filter( 'bp_get_group_news', 'stripslashes' );51 43 add_filter( 'bp_get_group_name', 'stripslashes' ); 52 44 … … 55 47 add_filter( 'groups_group_name_before_save', 'force_balance_tags' ); 56 48 add_filter( 'groups_group_description_before_save', 'force_balance_tags' ); 57 add_filter( 'groups_group_news_before_save', 'force_balance_tags' );58 49 59 50 add_filter( 'bp_get_total_group_count', 'number_format' ); -
trunk/bp-groups/bp-groups-templatetags.php
r2350 r2352 244 244 } 245 245 246 function bp_group_has_news( $group = false ) {247 global $groups_template;248 249 if ( !$group )250 $group =& $groups_template->group;251 252 if ( empty( $group->news ) )253 return false;254 255 return true;256 }257 246 258 247 function bp_group_id( $deprecated = true, $deprecated2 = false ) { … … 468 457 } 469 458 470 function bp_group_news( $deprecated = false ) {471 echo bp_get_group_news();472 }473 function bp_get_group_news( $group = false ) {474 global $groups_template;475 476 if ( !$group )477 $group =& $groups_template->group;478 479 return apply_filters( 'bp_get_group_news', stripslashes($groups_template->group->news) );480 }481 482 function bp_group_news_editable( $deprecated = false ) {483 echo bp_get_group_news_editable();484 }485 function bp_get_group_news_editable( $group = false ) {486 global $groups_template;487 488 if ( !$group )489 $group =& $groups_template->group;490 491 return apply_filters( 'bp_get_group_news_editable', $group->news );492 }493 459 494 460 function bp_group_public_status( $deprecated = false ) { … … 1585 1551 } 1586 1552 1587 function bp_new_group_news() {1588 echo bp_get_new_group_news();1589 }1590 function bp_get_new_group_news() {1591 global $bp;1592 return apply_filters( 'bp_get_new_group_news', $bp->groups->current_group->news );1593 }1594 1595 1553 function bp_new_group_enable_forum() { 1596 1554 echo bp_get_new_group_enable_forum(); -
trunk/bp-themes/bp-default/groups/create.php
r2338 r2352 29 29 <label for="group-desc"><?php _e('* Group Description', 'buddypress') ?> <? _e( '(required)', 'buddypress' )?></label> 30 30 <textarea name="group-desc" id="group-desc"><?php bp_new_group_description() ?></textarea> 31 32 <label for="group-news"><?php _e('Recent News', 'buddypress') ?></label>33 <textarea name="group-news" id="group-news"><?php bp_new_group_news() ?></textarea>34 31 35 32 <?php do_action( 'bp_after_group_details_creation_step' ); /* Deprecated -> */ do_action( 'groups_custom_group_fields_editable' ); ?> -
trunk/bp-themes/bp-default/style.css
r2311 r2352 8 8 Tags: buddypress, two-columns, custom-header, white, blue 9 9 10 ** IMPORTANT **10 ** IMPORTANT - DO NOT COPY THIS THEME ** 11 11 If you want to make a custom theme based on this theme, DO NOT copy and edit it. By 12 12 doing this you will make upgrades and maintainence much harder for yourself. -
trunk/bp-themes/bp-sn-parent/groups/create.php
r2069 r2352 25 25 <label for="group-desc"><?php _e('* Group Description', 'buddypress') ?> <? _e( '(required)', 'buddypress' )?></label> 26 26 <textarea name="group-desc" id="group-desc"><?php bp_new_group_description() ?></textarea> 27 28 <label for="group-news"><?php _e('Recent News', 'buddypress') ?></label>29 <textarea name="group-news" id="group-news"><?php bp_new_group_news() ?></textarea>30 27 31 28 <?php do_action( 'bp_after_group_details_creation_step' ); /* Deprecated -> */ do_action( 'groups_custom_group_fields_editable' ); ?> -
trunk/bp-themes/bp-sn-parent/style.css
r2311 r2352 7 7 Author URI: http://buddypress.org 8 8 9 ** IMPORTANT **9 ** IMPORTANT - DO NOT COPY THIS THEME ** 10 10 If you want to make a custom theme based on this theme, DO NOT copy and edit it. By 11 11 doing this you will make upgrades and maintainence much harder for yourself.
Note: See TracChangeset
for help on using the changeset viewer.