Changeset 540
- Timestamp:
- 11/13/2008 11:20:15 PM (17 years ago)
- Location:
- trunk
- Files:
-
- 9 edited
-
bp-core.php (modified) (1 diff)
-
bp-core/bp-core-templatetags.php (modified) (2 diffs)
-
bp-groups.php (modified) (13 diffs)
-
bp-groups/bp-groups-ajax.php (modified) (1 diff)
-
bp-groups/bp-groups-classes.php (modified) (14 diffs)
-
bp-groups/bp-groups-notifications.php (modified) (1 diff)
-
bp-groups/bp-groups-templatetags.php (modified) (13 diffs)
-
bp-groups/js/general.js (modified) (2 diffs)
-
bp-messages.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-core.php
r538 r540 132 132 'is_item_admin' would be 1 if they are a group admin, 0 if they are not. */ 133 133 $bp['is_item_admin'] = bp_is_home(); 134 135 /* Used to determine if the logged in user is a moderator for the current content. */ 136 $bp['is_item_mod'] = false; 134 137 135 138 $bp['core'] = array( -
trunk/bp-core/bp-core-templatetags.php
r516 r540 30 30 foreach( (array) $bp['bp_nav'] as $nav_item ) { 31 31 /* If the current component matches the nav item id, then add a highlight CSS class. */ 32 if ( $bp['current_component'] == $nav_item['css_id'] && bp_is_home()) {32 if ( $bp['current_component'] == $nav_item['css_id'] ) { 33 33 $selected = ' class="current"'; 34 34 } else { … … 37 37 38 38 /* If we are viewing another person (current_userid does not equal loggedin_userid) 39 then check to see if the two users are friends. if they are, add a highligh CSS class39 then check to see if the two users are friends. if they are, add a highlight CSS class 40 40 to the friends nav item if it exists. */ 41 if ( !bp_is_home() ) {42 if ( function_exists('friends_ check_friendship') ) {41 if ( !bp_is_home() && $bp['current_userid'] ) { 42 if ( function_exists('friends_install') ) { 43 43 if ( friends_check_friendship( $bp['loggedin_userid'], $bp['current_userid'] ) && $nav_item['css_id'] == $bp['friends']['slug'] ) { 44 44 $selected = ' class="current"'; 45 } else { 45 } else { 46 46 $selected = ''; 47 47 } -
trunk/bp-groups.php
r527 r540 3 3 4 4 define ( 'BP_GROUPS_IS_INSTALLED', 1 ); 5 define ( 'BP_GROUPS_VERSION', '0.2. 3' );5 define ( 'BP_GROUPS_VERSION', '0.2.5' ); 6 6 7 7 include_once( 'bp-groups/bp-groups-classes.php' ); … … 12 12 include_once( 'bp-groups/bp-groups-notifications.php' ); 13 13 include_once( 'bp-groups/bp-groups-admin.php' ); 14 15 /*include_once( 'bp-messages/bp-groups-admin.php' );*/16 14 17 15 /************************************************************************** … … 54 52 inviter_id int(11) NOT NULL, 55 53 is_admin tinyint(1) NOT NULL DEFAULT '0', 54 is_mod tinyint(1) NOT NULL DEFAULT '0', 56 55 user_title varchar(100) NOT NULL, 57 56 date_modified datetime NOT NULL, 58 57 comments longtext NOT NULL, 59 58 is_confirmed tinyint(1) NOT NULL DEFAULT '0', 59 is_banned tinyint(1) NOT NULL DEFAULT '0', 60 60 KEY group_id (group_id), 61 KEY is_admin (is_admin), 62 KEY is_mod (is_mod), 61 63 KEY user_id (user_id), 62 64 KEY inviter_id (inviter_id), … … 177 179 $bp['is_item_admin'] = groups_is_user_admin( $bp['loggedin_userid'], $group_obj->id ); 178 180 181 /* If the user is not an admin, check if they are a moderator */ 182 if ( !$bp['is_item_admin'] ) 183 $bp['is_item_mod'] = groups_is_user_mod( $bp['loggedin_userid'], $group_obj->id ); 184 179 185 /* Is the logged in user a member of the group? */ 180 186 $is_member = ( groups_is_user_member( $bp['loggedin_userid'], $group_obj->id ) ) ? true : false; … … 228 234 bp_core_add_subnav_item( $bp['groups']['slug'], 'home', __('Home', 'buddypress'), $group_link, 'groups_screen_group_home', 'group-home' ); 229 235 230 // If the user is a group administrator, then show the group admin nav item */231 if ( $bp['is_item_ admin'] )232 bp_core_add_subnav_item( $bp['groups']['slug'], 'admin', __('Admin', 'buddypress'), $group_link , 'groups_screen_group_admin', 'group-admin', $bp['is_item_admin']);236 // If the user is a group mod or more, then show the group admin nav item */ 237 if ( $bp['is_item_mod'] || $bp['is_item_admin'] ) 238 bp_core_add_subnav_item( $bp['groups']['slug'], 'admin', __('Admin', 'buddypress'), $group_link , 'groups_screen_group_admin', 'group-admin', ( $bp['is_item_admin'] + (int)$bp['is_item_mod'] ) ); 233 239 234 240 // If this is a closed group, and the user is not a member, show a "Request Membership" nav item. … … 516 522 if ( $bp['current_component'] == $bp['groups']['slug'] && $bp['action_variables'][0] == 'edit-details' ) { 517 523 518 if ( !$bp['is_item_ admin'] )524 if ( !$bp['is_item_mod'] ) 519 525 return false; 520 526 … … 564 570 } 565 571 add_action( 'wp', 'groups_screen_group_admin_settings', 4 ); 572 573 function groups_screen_group_admin_manage_members() { 574 global $bp, $group_obj; 575 576 if ( $bp['current_component'] == $bp['groups']['slug'] && $bp['action_variables'][0] == 'manage-members' ) { 577 578 if ( !$bp['is_item_admin'] ) 579 return false; 580 581 if ( $bp['action_variables'][1] == 'promote' && is_numeric( $bp['action_variables'][2] ) ) { 582 $user_id = $bp['action_variables'][2]; 583 584 // Promote a user. 585 if ( !groups_promote_member( $user_id, $group_obj->id ) ) { 586 bp_core_add_message( __( 'There was an error when promoting that user, please try again', 'buddypress' ), 'error' ); 587 } else { 588 bp_core_add_message( __( 'User promoted successfully', 'buddypress' ) ); 589 } 590 591 do_action( 'bp_groups_promoted_member', $user_id, $group_obj->id ); 592 593 bp_core_redirect( site_url() . '/' . $bp['current_component'] . '/' . $bp['current_item'] . '/admin/manage-members' ); 594 } 595 596 if ( $bp['action_variables'][1] == 'demote' && is_numeric( $bp['action_variables'][2] ) ) { 597 $user_id = $bp['action_variables'][2]; 598 599 // Demote a user. 600 if ( !groups_demote_member( $user_id, $group_obj->id ) ) { 601 bp_core_add_message( __( 'There was an error when demoting that user, please try again', 'buddypress' ), 'error' ); 602 } else { 603 bp_core_add_message( __( 'User demoted successfully', 'buddypress' ) ); 604 } 605 606 do_action( 'bp_groups_demoted_member', $user_id, $group_obj->id ); 607 608 bp_core_redirect( site_url() . '/' . $bp['current_component'] . '/' . $bp['current_item'] . '/admin/manage-members' ); 609 } 610 611 if ( $bp['action_variables'][1] == 'ban' && is_numeric( $bp['action_variables'][2] ) ) { 612 $user_id = $bp['action_variables'][2]; 613 614 // Ban a user. 615 if ( !groups_ban_member( $user_id, $group_obj->id ) ) { 616 bp_core_add_message( __( 'There was an error when banning that user, please try again', 'buddypress' ), 'error' ); 617 } else { 618 bp_core_add_message( __( 'User banned successfully', 'buddypress' ) ); 619 } 620 621 do_action( 'bp_groups_banned_member', $user_id, $group_obj->id ); 622 623 bp_core_redirect( site_url() . '/' . $bp['current_component'] . '/' . $bp['current_item'] . '/admin/manage-members' ); 624 } 625 626 if ( $bp['action_variables'][1] == 'unban' && is_numeric( $bp['action_variables'][2] ) ) { 627 $user_id = $bp['action_variables'][2]; 628 629 // Remove a ban for user. 630 if ( !groups_unban_member( $user_id, $group_obj->id ) ) { 631 bp_core_add_message( __( 'There was an error when unbanning that user, please try again', 'buddypress' ), 'error' ); 632 } else { 633 bp_core_add_message( __( 'User ban removed successfully', 'buddypress' ) ); 634 } 635 636 do_action( 'bp_groups_unbanned_member', $user_id, $group_obj->id ); 637 638 bp_core_redirect( site_url() . '/' . $bp['current_component'] . '/' . $bp['current_item'] . '/admin/manage-members' ); 639 } 640 641 bp_catch_uri( 'groups/admin/manage-members' ); 642 } 643 } 644 add_action( 'wp', 'groups_screen_group_admin_manage_members', 4 ); 566 645 567 646 … … 685 764 686 765 // user wants to join a group 687 if ( !groups_is_user_member( $bp['loggedin_userid'], $group_obj->id ) ) {766 if ( !groups_is_user_member( $bp['loggedin_userid'], $group_obj->id ) && !groups_is_user_banned( $bp['loggedin_userid'], $group_obj->id ) ) { 688 767 if ( !groups_join_group($group_obj->id) ) { 689 bp_core_add_message( __('There was an error joining the group. Please try again.', 'buddypress'), 'error' );768 bp_core_add_message( __('There was an error joining the group.', 'buddypress'), 'error' ); 690 769 } else { 691 770 bp_core_add_message( __('You joined the group!', 'buddypress') ); … … 1083 1162 } 1084 1163 1164 function groups_get_slug( $group_id ) { 1165 $group = new BP_Groups_Group( $group_id, false, false ); 1166 return $group->slug; 1167 } 1168 1085 1169 function groups_is_user_admin( $user_id, $group_id ) { 1086 1170 return BP_Groups_Member::check_is_admin( $user_id, $group_id ); 1087 1171 } 1088 1172 1173 function groups_is_user_mod( $user_id, $group_id ) { 1174 return BP_Groups_Member::check_is_mod( $user_id, $group_id ); 1175 } 1176 1089 1177 function groups_is_user_member( $user_id, $group_id ) { 1090 1178 return BP_Groups_Member::check_is_member( $user_id, $group_id ); 1179 } 1180 1181 function groups_is_user_banned( $user_id, $group_id ) { 1182 return BP_Groups_Member::check_is_banned( $user_id, $group_id ); 1091 1183 } 1092 1184 … … 1214 1306 } 1215 1307 1216 function groups_get_group_admin( $group_id ) { 1217 return BP_Groups_Member::get_group_administrator_id( $group_id ); 1308 function groups_get_group_admins( $group_id ) { 1309 return BP_Groups_Member::get_group_administrator_ids( $group_id ); 1310 } 1311 1312 function groups_get_group_mods( $group_id ) { 1313 return BP_Groups_Member::get_group_moderator_ids( $group_id ); 1314 } 1315 1316 function groups_get_group_users( $group_id, $limit = false, $page = false ) { 1317 return BP_Groups_Member::get_all_for_group( $group_id, $limit, $page ); 1218 1318 } 1219 1319 1220 1320 function groups_is_group_admin( $user_id, $group_id ) { 1221 1321 return BP_Groups_Member::check_is_admin( $user_id, $group_id ); 1322 } 1323 1324 function groups_is_group_mod( $user_id, $group_id ) { 1325 return BP_Groups_Member::check_is_mod( $user_id, $group_id ); 1222 1326 } 1223 1327 … … 1284 1388 1285 1389 return true; 1390 } 1391 1392 function groups_promote_member( $user_id, $group_id ) { 1393 global $bp; 1394 1395 if ( !$bp['is_item_admin'] ) 1396 return false; 1397 1398 $member = new BP_Groups_Member( $user_id, $group_id ); 1399 return $member->promote(); 1400 } 1401 1402 function groups_demote_member( $user_id, $group_id ) { 1403 global $bp; 1404 1405 if ( !$bp['is_item_admin'] ) 1406 return false; 1407 1408 $member = new BP_Groups_Member( $user_id, $group_id ); 1409 return $member->demote(); 1410 } 1411 1412 function groups_ban_member( $user_id, $group_id ) { 1413 global $bp; 1414 1415 if ( !$bp['is_item_admin'] ) 1416 return false; 1417 1418 $member = new BP_Groups_Member( $user_id, $group_id ); 1419 return $member->ban(); 1420 } 1421 1422 function groups_unban_member( $user_id, $group_id ) { 1423 global $bp; 1424 1425 if ( !$bp['is_item_admin'] ) 1426 return false; 1427 1428 $member = new BP_Groups_Member( $user_id, $group_id ); 1429 return $member->unban(); 1286 1430 } 1287 1431 … … 1300 1444 1301 1445 if ( $requesting_user->save() ) { 1302 $admin = groups_get_group_admin( $group_id ); 1303 1304 // Saved okay, now send the email notification 1305 groups_notification_new_membership_request( $requesting_user_id, $admin->user_id, $group_id, $requesting_user->id ); 1306 1307 do_action( 'bp_groups_group_membership_requested', $requesting_user_id, $admin->user_id, $group_id, $requesting_user->id ); 1446 $admins = groups_get_group_admins( $group_id ); 1447 1448 for ( $i = 0; $i < count( $admins ); $i++ ) { 1449 // Saved okay, now send the email notification 1450 groups_notification_new_membership_request( $requesting_user_id, $admins[$i]->user_id, $group_id, $requesting_user->id ); 1451 } 1452 1453 do_action( 'bp_groups_group_membership_requested', $requesting_user_id, $admins, $group_id, $requesting_user->id ); 1308 1454 1309 1455 return true; … … 1392 1538 return BP_Groups_Group::get_random(); 1393 1539 } 1394 1395 1396 1540 1397 1541 // -
trunk/bp-groups/bp-groups-ajax.php
r531 r540 159 159 add_action( 'wp_ajax_get_group_members', 'groups_ajax_member_list' ); 160 160 161 162 function groups_ajax_member_admin_list() { 163 global $bp; 164 165 check_ajax_referer('bp_groups_member_admin_list'); ?> 166 167 <?php if ( bp_group_has_members( $_REQUEST['group_id'], $_REQUEST['num'] ) ) : ?> 168 169 <?php if ( bp_group_member_needs_pagination() ) : ?> 170 <div id="member-count" class="pag-count"> 171 <?php bp_group_member_pagination_count() ?> 172 </div> 173 174 <div id="member-admin-pagination" class="pagination-links"> 175 <?php bp_group_member_admin_pagination() ?> 176 </div> 177 <?php endif; ?> 178 179 <ul id="members-list" class="item-list single-line"> 180 <?php while ( bp_group_members() ) : bp_group_the_member(); ?> 181 <?php if ( bp_group_member_is_banned() ) : ?> 182 <li class="banned-user"> 183 <?php bp_group_member_avatar_mini() ?> 184 185 <h5><?php bp_group_member_link() ?> (banned) <span class="small"> — <a href="<?php bp_group_member_unban_link() ?>" title="Kick and ban this member">Remove Ban</a> </h5> 186 <?php else : ?> 187 <li> 188 <?php bp_group_member_avatar_mini() ?> 189 <h5><?php bp_group_member_link() ?> <span class="small"> — <a href="<?php bp_group_member_ban_link() ?>" title="Kick and ban this member">Kick & Ban</a> | <a href="<?php bp_group_member_promote_link() ?>" title="Promote this member">Promote to Moderator</a></span></h5> 190 191 <?php endif; ?> 192 </li> 193 <?php endwhile; ?> 194 </ul> 195 <?php else: ?> 196 197 <div id="message" class="info"> 198 <p>This group has no members.</p> 199 </div> 200 201 <?php endif;?> 202 <input type="hidden" name="group_id" id="group_id" value="<?php echo $_REQUEST['group_id'] ?>" /> 203 <?php 204 } 205 add_action( 'wp_ajax_get_group_members_admin', 'groups_ajax_member_admin_list' ); 206 207 fuction 208 161 209 ?> -
trunk/bp-groups/bp-groups-classes.php
r531 r540 186 186 global $wpdb, $bp; 187 187 188 return $wpdb->get_results( $wpdb->prepare( "SELECT user_id, is_admin, inviter_id, user_title FROM " . $bp['groups']['table_name_members'] . " WHERE group_id = %d AND is_confirmed = 1ORDER BY rand()", $this->id ) );188 return $wpdb->get_results( $wpdb->prepare( "SELECT user_id, is_admin, inviter_id, user_title, is_mod FROM " . $bp['groups']['table_name_members'] . " WHERE group_id = %d AND is_confirmed = 1 AND is_banned = 0 ORDER BY rand()", $this->id ) ); 189 189 } 190 190 191 191 function get_administrators() { 192 192 for ( $i = 0; $i < count($this->user_dataset); $i++ ) { 193 if ( $this->user_dataset[$i]->is_admin ) {193 if ( $this->user_dataset[$i]->is_admin ) 194 194 $admins[] = new BP_Groups_Member( $this->user_dataset[$i]->user_id, $this->id ); 195 }196 195 } 197 196 … … 203 202 204 203 for ( $i = 0; $i < $total_randoms; $i++ ) { 205 $users[] = new BP_Groups_Member( $this->user_dataset[$i]->user_id, $this->id ); 204 if ( !(int)$this->user_dataset[$i]->is_banned ) 205 $users[] = new BP_Groups_Member( $this->user_dataset[$i]->user_id, $this->id ); 206 206 } 207 207 return $users; … … 459 459 var $inviter_id; 460 460 var $is_admin; 461 var $is_mod; 462 var $is_banned; 461 463 var $user_title; 462 464 var $date_modified; … … 500 502 $this->inviter_id = $member->inviter_id; 501 503 $this->is_admin = $member->is_admin; 504 $this->is_mod = $member->is_mod; 505 $this->is_banned = $member->is_banned; 502 506 $this->user_title = $member->user_title; 503 $this->date_modified = $member->date_modified;507 $this->date_modified = strtotime($member->date_modified); 504 508 $this->is_confirmed = $member->is_confirmed; 505 509 $this->comments = $member->comments; … … 513 517 514 518 if ( $this->id ) { 515 $sql = $wpdb->prepare( "UPDATE " . $bp['groups']['table_name_members'] . " SET inviter_id = %d, is_admin = %d, user_title = %s, date_modified = FROM_UNIXTIME(%d), is_confirmed = %d, comments = %s WHERE id = %d", $this->inviter_id, $this->is_admin, $this->user_title, $this->date_modified, $this->is_confirmed, $this->comments, $this->id ); 516 519 $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 = FROM_UNIXTIME(%d), is_confirmed = %d, comments = %s 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->id ); 517 520 } else { 518 $sql = $wpdb->prepare( "INSERT INTO " . $bp['groups']['table_name_members'] . " ( user_id, group_id, inviter_id, is_admin, user_title, date_modified, is_confirmed, comments ) VALUES ( %d, %d, %d, %d, %s, FROM_UNIXTIME(%d), %d, %s )", $this->user_id, $this->group_id, $this->inviter_id, $this->is_admin, $this->user_title, $this->date_modified, $this->is_confirmed, $this->comments );521 $sql = $wpdb->prepare( "INSERT INTO " . $bp['groups']['table_name_members'] . " ( user_id, group_id, inviter_id, is_admin, is_mod, is_banned, user_title, date_modified, is_confirmed, comments ) VALUES ( %d, %d, %d, %d, %d, %d, %s, FROM_UNIXTIME(%d), %d, %s )", $this->user_id, $this->group_id, $this->inviter_id, $this->is_admin, $this->is_mod, $this->is_banned, $this->user_title, $this->date_modified, $this->is_confirmed, $this->comments ); 519 522 } 520 523 … … 527 530 528 531 function promote() { 529 532 // Check the users current status 533 534 // Not letting mods be promoted to admins right now. In the future though yes. 535 if ( $this->is_admin || $this->is_mod ) 536 return false; 537 538 $this->is_mod = 1; 539 return $this->save(); 530 540 } 531 541 532 542 function demote() { 533 543 if ( $this->is_admin ) 544 return false; 545 546 if ( !$this->is_mod ) 547 return false; 548 549 $this->is_mod = 0; 550 return $this->save(); 551 } 552 553 function ban() { 554 if ( $this->is_admin ) 555 return false; 556 557 $this->is_mod = 0; 558 $this->is_banned = 1; 559 560 groups_update_groupmeta( $this->group_id, 'total_member_count', ( (int) groups_get_groupmeta( $this->group_id, 'total_member_count' ) - 1 ) ); 561 562 return $this->save(); 563 } 564 565 function unban() { 566 if ( $this->is_admin ) 567 return false; 568 569 $this->is_banned = 0; 570 571 groups_update_groupmeta( $this->group_id, 'total_member_count', ( (int) groups_get_groupmeta( $this->group_id, 'total_member_count' ) + 1 ) ); 572 573 return $this->save(); 534 574 } 535 575 … … 551 591 552 592 $delete_result = $wpdb->query( $wpdb->prepare( "DELETE FROM " . $bp['groups']['table_name_members'] . " WHERE user_id = %d AND group_id = %d", $user_id, $group_id ) ); 553 593 554 594 return $delete_result; 555 595 } … … 563 603 // If the user is logged in and viewing their own groups, we can show hidden and closed groups 564 604 if ( bp_is_home() ) { 565 $group_ids = $wpdb->get_col( $wpdb->prepare( "SELECT DISTINCT group_id FROM " . $bp['groups']['table_name_members'] . " WHERE user_id = %d AND inviter_id = 0 $pag_sql", $user_id ) );605 $group_ids = $wpdb->get_col( $wpdb->prepare( "SELECT DISTINCT group_id FROM " . $bp['groups']['table_name_members'] . " WHERE user_id = %d AND inviter_id = 0 AND is_banned = 0{$pag_sql}", $user_id ) ); 566 606 } else { 567 $group_ids = $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.inviter_id = 0 $pag_sql", $user_id ) );607 $group_ids = $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.inviter_id = 0 AND m.is_banned = 0{$pag_sql}", $user_id ) ); 568 608 } 569 609 … … 581 621 582 622 if ( bp_is_home() ) { 583 return $wpdb->get_var( $wpdb->prepare( "SELECT DISTINCT count(group_id) FROM " . $bp['groups']['table_name_members'] . " WHERE user_id = %d AND inviter_id = 0 ", $user_id ) );623 return $wpdb->get_var( $wpdb->prepare( "SELECT DISTINCT count(group_id) FROM " . $bp['groups']['table_name_members'] . " WHERE user_id = %d AND inviter_id = 0 AND is_banned = 0", $user_id ) ); 584 624 } else { 585 return $wpdb->get_var( $wpdb->prepare( "SELECT DISTINCT count(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.inviter_id = 0 ", $user_id ) );625 return $wpdb->get_var( $wpdb->prepare( "SELECT DISTINCT count(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.inviter_id = 0 m.is_banned = 0", $user_id ) ); 586 626 } 587 627 } … … 602 642 global $wpdb, $bp; 603 643 604 return $wpdb->query( $wpdb->prepare( "SELECT id FROM " . $bp['groups']['table_name_members'] . " WHERE user_id = %d AND group_id = %d AND is_admin = 1", $user_id, $group_id ) ); 644 return $wpdb->query( $wpdb->prepare( "SELECT id FROM " . $bp['groups']['table_name_members'] . " WHERE user_id = %d AND group_id = %d AND is_admin = 1 AND is_banned = 0", $user_id, $group_id ) ); 645 } 646 647 function check_is_mod( $user_id, $group_id ) { 648 global $wpdb, $bp; 649 650 return $wpdb->query( $wpdb->prepare( "SELECT id FROM " . $bp['groups']['table_name_members'] . " WHERE user_id = %d AND group_id = %d AND is_mod = 1 AND is_banned = 0", $user_id, $group_id ) ); 605 651 } 606 652 … … 608 654 global $wpdb, $bp; 609 655 610 return $wpdb->query( $wpdb->prepare( "SELECT id FROM " . $bp['groups']['table_name_members'] . " WHERE user_id = %d AND group_id = %d AND is_confirmed = 1", $user_id, $group_id ) ); 656 return $wpdb->query( $wpdb->prepare( "SELECT id FROM " . $bp['groups']['table_name_members'] . " WHERE user_id = %d AND group_id = %d AND is_confirmed = 1 AND is_banned = 0", $user_id, $group_id ) ); 657 } 658 659 function check_is_banned( $user_id, $group_id ) { 660 global $wpdb, $bp; 661 662 return $wpdb->get_var( $wpdb->prepare( "SELECT is_banned FROM " . $bp['groups']['table_name_members'] . " WHERE user_id = %d AND group_id = %d", $user_id, $group_id ) ); 611 663 } 612 664 … … 614 666 global $wpdb, $bp; 615 667 616 return $wpdb->query( $wpdb->prepare( "SELECT id FROM " . $bp['groups']['table_name_members'] . " WHERE user_id = %d AND group_id = %d AND is_confirmed = 0 ", $user_id, $group_id ) );668 return $wpdb->query( $wpdb->prepare( "SELECT id FROM " . $bp['groups']['table_name_members'] . " WHERE user_id = %d AND group_id = %d AND is_confirmed = 0 AND is_banned = 0", $user_id, $group_id ) ); 617 669 } 618 670 … … 622 674 // If the user is logged in and viewing their random groups, we can show hidden and closed groups 623 675 if ( bp_is_home() ) { 624 return $wpdb->get_col( $wpdb->prepare( "SELECT DISTINCT group_id FROM " . $bp['groups']['table_name_members'] . " WHERE user_id = %d AND is_confirmed = 1 ORDER BY rand() LIMIT $total_groups", $user_id ) );676 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 ) ); 625 677 } else { 626 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 ORDER BY rand() LIMIT $total_groups", $user_id ) );627 } 628 } 629 630 function get_group_administrator_id ( $group_id ) {678 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 ) ); 679 } 680 } 681 682 function get_group_administrator_ids( $group_id ) { 631 683 global $bp, $wpdb; 632 684 633 return $wpdb->get_r ow( $wpdb->prepare( "SELECT user_id FROM " . $bp['groups']['table_name_members'] . " WHERE group_id = %d AND is_admin = 1", $group_id ) );634 } 635 636 function get_ all_for_group( $group_id, $limit = false, $page = false) {685 return $wpdb->get_results( $wpdb->prepare( "SELECT user_id, date_modified FROM " . $bp['groups']['table_name_members'] . " WHERE group_id = %d AND is_admin = 1 AND is_banned = 0", $group_id ) ); 686 } 687 688 function get_group_moderator_ids( $group_id ) { 637 689 global $bp, $wpdb; 638 690 691 return $wpdb->get_results( $wpdb->prepare( "SELECT user_id, date_modified FROM " . $bp['groups']['table_name_members'] . " WHERE group_id = %d AND is_mod = 1 AND is_banned = 0", $group_id ) ); 692 } 693 694 function get_all_for_group( $group_id, $limit = false, $page = false, $exclude_admins_mods = true, $exclude_banned = true ) { 695 global $bp, $wpdb; 696 639 697 if ( $limit && $page ) 640 $pag_sql = $wpdb->prepare( " LIMIT %d, %d", intval( ( $page - 1 ) * $limit), intval( $limit ) ); 641 642 $members = $wpdb->get_results( $wpdb->prepare( "SELECT user_id, date_modified FROM " . $bp['groups']['table_name_members'] . " WHERE group_id = %d AND is_confirmed = 1 {$pag_sql}", $group_id ) ); 698 $pag_sql = $wpdb->prepare( "LIMIT %d, %d", intval( ( $page - 1 ) * $limit), intval( $limit ) ); 699 700 if ( $exclude_admins_mods ) 701 $exclude_sql = $wpdb->prepare( "AND is_admin = 0 AND is_mod = 0" ); 702 703 if ( $exclude_banned ) 704 $banned_sql = $wpdb->prepare( " AND is_banned = 0" ); 705 706 $members = $wpdb->get_results( $wpdb->prepare( "SELECT user_id, date_modified FROM " . $bp['groups']['table_name_members'] . " WHERE group_id = %d AND is_confirmed = 1 {$banned_sql} {$exclude_sql} {$pag_sql}", $group_id ) ); 643 707 644 708 if ( !$members ) … … 648 712 $total_member_count = count($members); 649 713 else 650 $total_member_count = $wpdb->get_var( $wpdb->prepare( "SELECT count(user_id) FROM " . $bp['groups']['table_name_members'] . " WHERE group_id = %d AND is_confirmed = 1 ", $group_id ) );714 $total_member_count = $wpdb->get_var( $wpdb->prepare( "SELECT count(user_id) FROM " . $bp['groups']['table_name_members'] . " WHERE group_id = %d AND is_confirmed = 1 {$banned_sql} {$exclude_sql}", $group_id ) ); 651 715 652 716 return array( 'members' => $members, 'count' => $total_member_count ); -
trunk/bp-groups/bp-groups-notifications.php
r515 r540 175 175 } 176 176 177 function groups_notification_promoted_member( $user_id, $group_id ) { 178 global $bp, $current_user; 179 180 if ( groups_is_user_admin( $user_id, $group_id ) ) { 181 $promoted_to = 'admin'; 182 $type = 'member_promoted_to_admin'; 183 } else { 184 $promoted_to = 'mod'; 185 $type = 'member_promoted_to_mod'; 186 } 187 188 // Post a screen notification first. 189 bp_core_add_notification( $group_id, $user_id, 'groups', $type ); 190 191 if ( get_usermeta( $user_id, 'notification_group_promotion' ) == 'no' ) 192 return false; 193 194 $group = new BP_Groups_Group( $group_id, false, false ); 195 $ud = get_userdata($user_id); 196 197 $group_link = bp_group_permalink( $group, false ); 198 $settings_link = site_url() . '/' . MEMBERS_SLUG . '/' . $ud->user_login . '/settings/notifications'; 199 200 // Set up and send the message 201 $to = $ud->user_email; 202 203 $subject = sprintf( __( 'You have been promoted in the group: "%s"', 'buddypress' ), stripslashes($group->name) ); 204 205 $message = sprintf( __( 206 'You have been promoted to % for the group: "%s". 207 208 To view the group please visit: %s 209 210 --------------------- 211 ', 'buddypress' ), stripslashes($group->name), $group_link ); 212 213 $message .= sprintf( __( 'To disable these notifications please log in and go to: %s', 'buddypress' ), $settings_link ); 214 215 // Send it 216 wp_mail( $to, $subject, $message ); 217 } 218 add_action( 'bp_groups_promoted_member', 'groups_notification_promoted_member', 10, 2 ); 219 177 220 ?> -
trunk/bp-groups/bp-groups-templatetags.php
r536 r540 313 313 if ( !$admins = &$groups_template->group->admins ) 314 314 $admins = $groups_template->group->get_administrators(); 315 315 316 316 if ( $admins ) { 317 317 if ( $full_list ) { ?> … … 338 338 } 339 339 340 function bp_group_list_mods( $full_list = true ) { 341 global $groups_template, $group_mods; 342 343 if ( $group_mods ) { 344 if ( $full_list ) { ?> 345 <ul id="group-mods" class="mods-list"> 346 <?php for ( $i = 0; $i < count($group_mods); $i++ ) { ?> 347 <li> 348 <?php echo bp_core_get_avatar( $group_mods[$i]->user_id, 1, false, 36, 36 ) ?> 349 <h5><?php echo bp_core_get_userlink( $group_mods[$i]->user_id ) ?></h5> 350 <span class="activity"><?php _e( 'Group Mod', 'buddypress' ) ?></span> 351 <div class="clear"></div> 352 </li> 353 <?php } ?> 354 </ul> 355 <?php } else { ?> 356 <?php for ( $i = 0; $i < count($admins); $i++ ) { ?> 357 <?php echo bp_core_get_userlink( $group_mods[$i]->user_id ) . ' ' ?> 358 <?php } ?> 359 <?php } ?> 360 <?php } else { ?> 361 <span class="activity">No Admin</span> 362 <?php } ?> 363 364 <?php 365 } 366 340 367 function bp_group_all_members_permalink() { 341 368 global $groups_template, $bp; … … 457 484 } 458 485 486 function bp_group_admin_memberlist( $admin_list = false ) { 487 global $groups_template; 488 489 $admins = groups_get_group_admins( $groups_template->group->id ); 490 ?> 491 <?php if ( $admins ) { ?> 492 <ul id="admins-list" class="item-list<?php if ( $admin_list ) { ?> single-line<?php } ?>"> 493 <?php foreach ( $admins as $admin ) { ?> 494 <?php if ( $admin_list ) { ?> 495 <li> 496 <?php echo bp_core_get_avatar( $admin->user_id, 1, false, 30, 30 ) ?> 497 <h5><?php echo bp_core_get_userlink( $admin->user_id ) ?></h5> 498 </li> 499 <?php } else { ?> 500 <li> 501 <?php echo bp_core_get_avatar( $admin->user_id, 1 ) ?> 502 <h5><?php echo bp_core_get_userlink( $admin->user_id ) ?></h5> 503 <span class="activity"><?php echo bp_core_get_last_activity( strtotime( $admin->date_modified ), __( 'joined %s ago', 'buddypress') ); ?></span> 504 505 <?php if ( function_exists( 'friends_install' ) ) : ?> 506 <div class="action"> 507 <?php bp_add_friend_button( $admin->user_id ) ?> 508 </div> 509 <?php endif; ?> 510 </li> 511 <?php } ?> 512 <?php } ?> 513 </ul> 514 <?php } else { ?> 515 <div id="message" class="info"> 516 <?php _e( 'This group has no administrators', 'buddypress' ); ?> 517 </div> 518 <?php } 519 } 520 521 function bp_group_mod_memberlist( $admin_list = false ) { 522 global $groups_template, $group_mods; 523 ?> 524 <?php if ( $group_mods ) { ?> 525 <ul id="mods-list" class="item-list<?php if ( $admin_list ) { ?> single-line<?php } ?>"> 526 <?php foreach ( $group_mods as $mod ) { ?> 527 <?php if ( $admin_list ) { ?> 528 <li> 529 <?php echo bp_core_get_avatar( $mod->user_id, 1, false, 30, 30 ) ?> 530 <h5><?php echo bp_core_get_userlink( $mod->user_id ) ?> <span class="small"> — <a href="<?php bp_group_member_ban_link() ?>"><?php _e( 'Kick & Ban', 'buddypress' ) ?></a> | <a href="<?php bp_group_member_demote_link($mod->user_id) ?>"><?php _e( 'Demote to Member', 'buddypress' ) ?></a></span></h5> 531 </li> 532 <?php } else { ?> 533 <li> 534 <?php echo bp_core_get_avatar( $mod->user_id, 1 ) ?> 535 <h5><?php echo bp_core_get_userlink( $mod->user_id ) ?></h5> 536 <span class="activity"><?php echo bp_core_get_last_activity( strtotime( $mod->date_modified ), __( 'joined %s ago', 'buddypress') ); ?></span> 537 538 <?php if ( function_exists( 'friends_install' ) ) : ?> 539 <div class="action"> 540 <?php bp_add_friend_button( $mod->user_id ) ?> 541 </div> 542 <?php endif; ?> 543 </li> 544 <?php } ?> 545 <?php } ?> 546 </ul> 547 <?php } else { ?> 548 <div id="message" class="info"> 549 <p><?php _e( 'This group has no moderators', 'buddypress' ); ?></p> 550 </div> 551 <?php } 552 } 553 554 function bp_group_has_moderators() { 555 global $group_mods, $groups_template; 556 557 $group_mods = groups_get_group_mods( $groups_template->group->id ); 558 return $group_mods; 559 } 560 561 function bp_group_member_promote_link() { 562 global $members_template, $groups_template, $bp; 563 564 echo bp_group_permalink( $groups_template->group, false ) . '/admin/manage-members/promote/' . $members_template->member->user_id; 565 } 566 567 function bp_group_member_demote_link( $user_id = false) { 568 global $members_template, $groups_template, $bp; 569 570 if ( !$user_id ) 571 $user_id = $members_template->member->user_id; 572 573 echo bp_group_permalink( $groups_template->group, false ) . '/admin/manage-members/demote/' . $user_id; 574 } 575 576 function bp_group_member_ban_link() { 577 global $members_template, $groups_template, $bp; 578 579 echo bp_group_permalink( $groups_template->group, false ) . '/admin/manage-members/ban/' . $members_template->member->user_id; 580 } 581 582 function bp_group_member_unban_link() { 583 global $members_template, $groups_template, $bp; 584 585 echo bp_group_permalink( $groups_template->group, false ) . '/admin/manage-members/unban/' . $members_template->member->user_id; 586 } 587 459 588 function bp_group_admin_tabs() { 460 589 global $bp, $groups_template; … … 462 591 $current_tab = $bp['action_variables'][0]; 463 592 ?> 464 <li<?php if ( $current_tab == 'edit-details' || $current_tab == '' ) : ?> class="current"<?php endif; ?>><a href="<?php echo $bp['root_domain'] . '/' . $bp['groups']['slug'] ?>/<?php echo $groups_template->group->slug ?>/admin/edit-details"><?php _e('Edit Details', 'buddypress') ?></a></li> 465 <li<?php if ( $current_tab == 'group-settings' ) : ?> class="current"<?php endif; ?>><a href="<?php echo $bp['root_domain'] . '/' . $bp['groups']['slug'] ?>/<?php echo $groups_template->group->slug ?>/admin/group-settings"><?php _e('Group Settings', 'buddypress') ?></a></li> 466 <li<?php if ( $current_tab == 'manage-members' ) : ?> class="current"<?php endif; ?>><a href="<?php echo $bp['root_domain'] . '/' . $bp['groups']['slug'] ?>/<?php echo $groups_template->group->slug ?>/admin/manage-members"><?php _e('Manage Members', 'buddypress') ?></a></li> 467 468 <?php if ( $groups_template->group->status == 'private' ) : ?> 593 <?php if ( $bp['is_item_admin'] || $bp['is_item_mod'] ) { ?> 594 <li<?php if ( $current_tab == 'edit-details' || $current_tab == '' ) : ?> class="current"<?php endif; ?>><a href="<?php echo $bp['root_domain'] . '/' . $bp['groups']['slug'] ?>/<?php echo $groups_template->group->slug ?>/admin/edit-details"><?php _e('Edit Details', 'buddypress') ?></a></li> 595 <?php } ?> 596 597 <?php if ( $bp['is_item_admin'] ) { ?> 598 <li<?php if ( $current_tab == 'group-settings' ) : ?> class="current"<?php endif; ?>><a href="<?php echo $bp['root_domain'] . '/' . $bp['groups']['slug'] ?>/<?php echo $groups_template->group->slug ?>/admin/group-settings"><?php _e('Group Settings', 'buddypress') ?></a></li> 599 <?php } ?> 600 601 <?php if ( $bp['is_item_admin'] ) { ?> 602 <li<?php if ( $current_tab == 'manage-members' ) : ?> class="current"<?php endif; ?>><a href="<?php echo $bp['root_domain'] . '/' . $bp['groups']['slug'] ?>/<?php echo $groups_template->group->slug ?>/admin/manage-members"><?php _e('Manage Members', 'buddypress') ?></a></li> 603 <?php } ?> 604 605 <?php if ( $bp['is_item_admin'] && $groups_template->group->status == 'private' ) : ?> 469 606 <li<?php if ( $current_tab == 'membership-requests' ) : ?> class="current"<?php endif; ?>><a href="<?php echo $bp['root_domain'] . '/' . $bp['groups']['slug'] ?>/<?php echo $groups_template->group->slug ?>/admin/membership-requests"><?php _e('Membership Requests', 'buddypress') ?></a></li> 470 607 <?php endif; ?> 471 472 <li<?php if ( $current_tab == 'delete-group' ) : ?> class="current"<?php endif; ?>><a href="<?php echo $bp['root_domain'] . '/' . $bp['groups']['slug'] ?>/<?php echo $groups_template->group->slug ?>/admin/delete-group"><?php _e('Delete Group', 'buddypress') ?></a></li> 608 609 <?php if ( $bp['is_item_admin'] ) { ?> 610 <li<?php if ( $current_tab == 'delete-group' ) : ?> class="current"<?php endif; ?>><a href="<?php echo $bp['root_domain'] . '/' . $bp['groups']['slug'] ?>/<?php echo $groups_template->group->slug ?>/admin/delete-group"><?php _e('Delete Group', 'buddypress') ?></a></li> 611 <?php } ?> 473 612 474 613 <?php … … 680 819 } 681 820 682 function bp_group_list_members() {683 global $groups_template, $bp;684 685 for ( $i = 0; $i < count($groups_template->group->user_dataset); $i++ ) {686 $member = new BP_Groups_Member( $groups_template->group->user_dataset[$i]->user_id, $groups_template->group->id );687 688 ?><li id="uid-<?php echo $user->id ?>">689 <?php echo $member->user->avatar_thumb ?>690 <p><?php echo $member->user->user_link ?> <?php if ( $member->user_title ) { ?><?php echo '<span class="small">- ' . $member->user_title . '</span>' ?><?php } ?></p>691 <span class="activity"><?php echo sprintf( __( 'joined %s ago', 'buddypress' ), bp_core_time_since( strtotime( $member->date_modified ) ) ); ?></span>692 <?php if ( bp_exists('friends') && function_exists('bp_add_friend_button') ) { ?>693 <div class="action">694 <?php bp_add_friend_button( $member->user->id ) ?>695 </div>696 <?php } ?>697 </li>698 <?php699 }700 }701 702 821 function bp_group_accept_invite_link() { 703 822 global $groups_template, $bp; … … 775 894 global $bp, $groups_template; 776 895 777 if ( !is_user_logged_in() || BP_Groups_Member::check_is_member( $bp['loggedin_userid'], $groups_template->group->id ) )896 if ( !is_user_logged_in() || BP_Groups_Member::check_is_member( $bp['loggedin_userid'], $groups_template->group->id ) || groups_is_user_banned( $bp['loggedin_userid'], $groups_template->group->id ) ) 778 897 return false; 779 898 … … 852 971 var $total_member_count; 853 972 854 function bp_groups_group_members_template( $group_id ) {973 function bp_groups_group_members_template( $group_id, $num_per_page, $exclude_admins_mods, $exclude_banned ) { 855 974 global $bp; 856 975 857 976 $this->pag_page = isset( $_REQUEST['mlpage'] ) ? intval( $_REQUEST['mlpage'] ) : 1; 858 $this->pag_num = isset( $_REQUEST['num'] ) ? intval( $_REQUEST['num'] ) : 5;859 860 $members = BP_Groups_Member::get_all_for_group( $group_id, $this->pag_num, $this->pag_page );977 $this->pag_num = isset( $_REQUEST['num'] ) ? intval( $_REQUEST['num'] ) : $num_per_page; 978 979 $members = BP_Groups_Member::get_all_for_group( $group_id, $this->pag_num, $this->pag_page, $exclude_admins_mods, $exclude_banned ); 861 980 862 981 $this->total_member_count = $members['count']; … … 922 1041 } 923 1042 924 function bp_group_has_members( $group_id = false ) {1043 function bp_group_has_members( $group_id = false, $num_per_page = 5, $exclude_admins_mods = true, $exclude_banned = true ) { 925 1044 global $members_template, $groups_template; 926 1045 927 if ( !$group_id ) 928 $group_id = $groups_template->group->id; 929 930 $members_template = new BP_Groups_Group_Members_Template( $group_id ); 1046 if ( !$groups_template ) 1047 $groups_template->group = new BP_Groups_Group( $group_id ); 1048 1049 1050 $members_template = new BP_Groups_Group_Members_Template( $groups_template->group->id, $num_per_page, $exclude_admins_mods, $exclude_banned ); 931 1051 932 1052 return $members_template->has_members(); … … 951 1071 } 952 1072 1073 function bp_group_member_avatar_mini( $width = 30, $height = 30 ) { 1074 global $members_template; 1075 1076 echo bp_core_get_avatar( $members_template->member->user_id, 1, false, $width, $height ); 1077 } 1078 953 1079 function bp_group_member_link() { 954 1080 global $members_template; 955 1081 956 1082 echo bp_core_get_userlink( $members_template->member->user_id ); 1083 } 1084 1085 function bp_group_member_is_banned() { 1086 global $members_template, $groups_template; 1087 1088 return groups_is_user_banned( $members_template->member->user_id, $groups_template->group->id ); 957 1089 } 958 1090 … … 990 1122 global $members_template; 991 1123 echo $members_template->pag_links; 992 wp_nonce_field( 'bp_groups_member_list' );1124 wp_nonce_field( 'bp_groups_member_list', '_member_pag_nonce' ); 993 1125 } 994 1126 … … 1000 1132 1001 1133 echo sprintf( __( 'Viewing members %d to %d (%d total members)', 'buddypress' ), $from_num, $to_num, $members_template->total_member_count ); 1134 } 1135 1136 function bp_group_member_admin_pagination() { 1137 global $members_template; 1138 echo $members_template->pag_links; 1139 wp_nonce_field( 'bp_groups_member_admin_list', '_member_admin_pag_nonce' ); 1002 1140 } 1003 1141 … … 1020 1158 var $total_request_count; 1021 1159 1022 function bp_groups_membership_requests_template( $group_id ) {1160 function bp_groups_membership_requests_template( $group_id, $num_per_page ) { 1023 1161 global $bp; 1024 1162 1025 1163 $this->pag_page = isset( $_REQUEST['mrpage'] ) ? intval( $_REQUEST['mrpage'] ) : 1; 1026 $this->pag_num = isset( $_REQUEST['num'] ) ? intval( $_REQUEST['num'] ) : 5;1164 $this->pag_num = isset( $_REQUEST['num'] ) ? intval( $_REQUEST['num'] ) : $num_per_page; 1027 1165 1028 1166 $this->requests = BP_Groups_Group::get_membership_requests( $group_id, $this->pag_num, $this->pag_page ); … … 1088 1226 } 1089 1227 1090 function bp_group_has_membership_requests( ) {1228 function bp_group_has_membership_requests( $num_per_page = 5 ) { 1091 1229 global $requests_template, $groups_template; 1092 1230 1093 $requests_template = new BP_Groups_Membership_Requests_Template( $groups_template->group->id );1231 $requests_template = new BP_Groups_Membership_Requests_Template( $groups_template->group->id, $num_per_page ); 1094 1232 1095 1233 return $requests_template->has_requests(); -
trunk/bp-groups/js/general.js
r531 r540 210 210 action: 'get_group_members', 211 211 'cookie': encodeURIComponent(document.cookie), 212 '_wpnonce': jQuery("input#_ wpnonce").val(),212 '_wpnonce': jQuery("input#_member_pag_nonce").val(), 213 213 'group_id': jQuery("#group_id").val(), 214 214 'mlpage': mlpage[1], … … 232 232 } 233 233 ); 234 235 jQuery("div#member-admin-pagination a").livequery('click', 236 function() { 237 jQuery('#ajax-loader').toggle(); 238 239 var mlpage = jQuery(this).attr('href'); 240 mlpage = mlpage.split('='); 241 242 jQuery.post( ajaxurl, { 243 action: 'get_group_members_admin', 244 'cookie': encodeURIComponent(document.cookie), 245 '_wpnonce': jQuery("input#_member_admin_pag_nonce").val(), 246 'group_id': jQuery("#group_id").val(), 247 'mlpage': mlpage[1], 248 'num': 5 249 }, 250 function(response) 251 { 252 response = response.substr(0, response.length-1); 253 254 jQuery("form#group-members-form").fadeOut(200, 255 function() { 256 jQuery("form#group-members-form").html(response); 257 jQuery("form#group-members-form").fadeIn(200); 258 } 259 ); 260 261 return false; 262 }); 263 264 return false; 265 } 266 ); 234 267 }); -
trunk/bp-messages.php
r527 r540 334 334 } 335 335 336 function messages_format_notifications( $action, $item_id, $ total_items ) {336 function messages_format_notifications( $action, $item_id, $secondary_item_id, $total_items ) { 337 337 global $bp; 338 338
Note: See TracChangeset
for help on using the changeset viewer.