Changeset 6119 for trunk/bp-groups/bp-groups-classes.php
- Timestamp:
- 06/19/2012 01:09:29 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-groups/bp-groups-classes.php
r6107 r6119 49 49 public $user_has_access; 50 50 51 publicfunction __construct( $id = null ) {51 function __construct( $id = null ) { 52 52 if ( !empty( $id ) ) { 53 53 $this->id = $id; … … 56 56 } 57 57 58 privatefunction populate() {58 function populate() { 59 59 global $wpdb, $bp; 60 60 … … 95 95 } 96 96 97 publicfunction save() {97 function save() { 98 98 global $wpdb, $bp; 99 99 … … 166 166 } 167 167 168 publicfunction delete() {168 function delete() { 169 169 global $wpdb, $bp; 170 170 … … 195 195 /** Static Methods ********************************************************/ 196 196 197 public staticfunction group_exists( $slug, $table_name = false ) {197 function group_exists( $slug, $table_name = false ) { 198 198 global $wpdb, $bp; 199 199 … … 207 207 } 208 208 209 public staticfunction get_id_from_slug( $slug ) {209 function get_id_from_slug( $slug ) { 210 210 return BP_Groups_Group::group_exists( $slug ); 211 211 } … … 216 216 } 217 217 218 public staticfunction filter_user_groups( $filter, $user_id = 0, $order = false, $limit = null, $page = null ) {218 function filter_user_groups( $filter, $user_id = 0, $order = false, $limit = null, $page = null ) { 219 219 global $wpdb, $bp; 220 220 … … 241 241 } 242 242 243 public staticfunction search_groups( $filter, $limit = null, $page = null, $sort_by = false, $order = false ) {243 function search_groups( $filter, $limit = null, $page = null, $sort_by = false, $order = false ) { 244 244 global $wpdb, $bp; 245 245 … … 264 264 } 265 265 266 public staticfunction check_slug( $slug ) {266 function check_slug( $slug ) { 267 267 global $wpdb, $bp; 268 268 … … 270 270 } 271 271 272 public staticfunction get_slug( $group_id ) {272 function get_slug( $group_id ) { 273 273 global $wpdb, $bp; 274 274 … … 276 276 } 277 277 278 public staticfunction has_members( $group_id ) {278 function has_members( $group_id ) { 279 279 global $wpdb, $bp; 280 280 … … 287 287 } 288 288 289 public staticfunction has_membership_requests( $group_id ) {289 function has_membership_requests( $group_id ) { 290 290 global $wpdb, $bp; 291 291 … … 293 293 } 294 294 295 public staticfunction get_membership_requests( $group_id, $limit = null, $page = null ) {295 function get_membership_requests( $group_id, $limit = null, $page = null ) { 296 296 global $wpdb, $bp; 297 297 … … 306 306 } 307 307 308 public staticfunction get( $type = 'newest', $per_page = null, $page = null, $user_id = 0, $search_terms = false, $include = false, $populate_extras = true, $exclude = false, $show_hidden = false ) {308 function get( $type = 'newest', $per_page = null, $page = null, $user_id = 0, $search_terms = false, $include = false, $populate_extras = true, $exclude = false, $show_hidden = false ) { 309 309 global $wpdb, $bp; 310 310 … … 431 431 } 432 432 433 public staticfunction get_by_most_forum_topics( $limit = null, $page = null, $user_id = 0, $search_terms = false, $populate_extras = true, $exclude = false ) {433 function get_by_most_forum_topics( $limit = null, $page = null, $user_id = 0, $search_terms = false, $populate_extras = true, $exclude = false ) { 434 434 global $wpdb, $bp, $bbdb; 435 435 … … 472 472 } 473 473 474 public staticfunction get_by_most_forum_posts( $limit = null, $page = null, $search_terms = false, $populate_extras = true, $exclude = false ) {474 function get_by_most_forum_posts( $limit = null, $page = null, $search_terms = false, $populate_extras = true, $exclude = false ) { 475 475 global $wpdb, $bp, $bbdb; 476 476 … … 513 513 } 514 514 515 public staticfunction get_by_letter( $letter, $limit = null, $page = null, $populate_extras = true, $exclude = false ) {515 function get_by_letter( $letter, $limit = null, $page = null, $populate_extras = true, $exclude = false ) { 516 516 global $wpdb, $bp; 517 517 … … 553 553 } 554 554 555 public staticfunction get_random( $limit = null, $page = null, $user_id = 0, $search_terms = false, $populate_extras = true, $exclude = false ) {555 function get_random( $limit = null, $page = null, $user_id = 0, $search_terms = false, $populate_extras = true, $exclude = false ) { 556 556 global $wpdb, $bp; 557 557 … … 592 592 } 593 593 594 public staticfunction get_group_extras( &$paged_groups, &$group_ids, $type = false ) {594 function get_group_extras( &$paged_groups, &$group_ids, $type = false ) { 595 595 global $bp, $wpdb; 596 596 … … 624 624 } 625 625 626 public staticfunction delete_all_invites( $group_id ) {626 function delete_all_invites( $group_id ) { 627 627 global $wpdb, $bp; 628 628 … … 630 630 } 631 631 632 public staticfunction get_total_group_count() {632 function get_total_group_count() { 633 633 global $wpdb, $bp; 634 634 … … 640 640 } 641 641 642 public staticfunction get_global_forum_topic_count( $type ) {642 function get_global_forum_topic_count( $type ) { 643 643 global $bbdb, $wpdb, $bp; 644 644 … … 651 651 } 652 652 653 public staticfunction get_total_member_count( $group_id ) {653 function get_total_member_count( $group_id ) { 654 654 global $wpdb, $bp; 655 655 … … 666 666 * @return int The topic count 667 667 */ 668 public staticfunction get_global_topic_count( $status = 'public', $search_terms = false ) {668 function get_global_topic_count( $status = 'public', $search_terms = false ) { 669 669 global $bbdb, $wpdb, $bp; 670 670 … … 720 720 var $user; 721 721 722 publicfunction __construct( $user_id = 0, $group_id = 0, $id = false, $populate = true ) {723 722 function __construct( $user_id = 0, $group_id = 0, $id = false, $populate = true ) { 723 724 724 // User and group are not empty, and ID is 725 725 if ( !empty( $user_id ) && !empty( $group_id ) && empty( $id ) ) { … … 742 742 } 743 743 744 privatefunction populate() {744 function populate() { 745 745 global $wpdb, $bp; 746 746 … … 771 771 } 772 772 773 publicfunction save() {773 function save() { 774 774 global $wpdb, $bp; 775 775 … … 809 809 } 810 810 811 publicfunction promote( $status = 'mod' ) {811 function promote( $status = 'mod' ) { 812 812 if ( 'mod' == $status ) { 813 813 $this->is_admin = 0; … … 825 825 } 826 826 827 publicfunction demote() {827 function demote() { 828 828 $this->is_mod = 0; 829 829 $this->is_admin = 0; … … 833 833 } 834 834 835 publicfunction ban() {835 function ban() { 836 836 837 837 if ( !empty( $this->is_admin ) ) … … 850 850 } 851 851 852 publicfunction unban() {852 function unban() { 853 853 854 854 if ( !empty( $this->is_admin ) ) … … 863 863 } 864 864 865 publicfunction accept_invite() {865 function accept_invite() { 866 866 867 867 $this->inviter_id = 0; … … 872 872 } 873 873 874 publicfunction accept_request() {874 function accept_request() { 875 875 876 876 $this->is_confirmed = 1; … … 880 880 } 881 881 882 publicfunction remove() {882 function remove() { 883 883 global $wpdb, $bp; 884 884 … … 899 899 /** Static Methods ********************************************************/ 900 900 901 public staticfunction delete( $user_id, $group_id ) {901 function delete( $user_id, $group_id ) { 902 902 global $wpdb, $bp; 903 903 … … 905 905 } 906 906 907 public staticfunction get_group_ids( $user_id, $limit = false, $page = false ) {907 function get_group_ids( $user_id, $limit = false, $page = false ) { 908 908 global $wpdb, $bp; 909 909 … … 926 926 } 927 927 928 public staticfunction get_recently_joined( $user_id, $limit = false, $page = false, $filter = false ) {928 function get_recently_joined( $user_id, $limit = false, $page = false, $filter = false ) { 929 929 global $wpdb, $bp; 930 930 … … 948 948 } 949 949 950 public staticfunction get_is_admin_of( $user_id, $limit = false, $page = false, $filter = false ) {950 function get_is_admin_of( $user_id, $limit = false, $page = false, $filter = false ) { 951 951 global $wpdb, $bp; 952 952 … … 970 970 } 971 971 972 public staticfunction get_is_mod_of( $user_id, $limit = false, $page = false, $filter = false ) {972 function get_is_mod_of( $user_id, $limit = false, $page = false, $filter = false ) { 973 973 global $wpdb, $bp; 974 974 … … 992 992 } 993 993 994 public staticfunction total_group_count( $user_id = 0 ) {994 function total_group_count( $user_id = 0 ) { 995 995 global $bp, $wpdb; 996 996 … … 1005 1005 } 1006 1006 1007 public staticfunction get_invites( $user_id, $limit = false, $page = false, $exclude = false ) {1007 function get_invites( $user_id, $limit = false, $page = false, $exclude = false ) { 1008 1008 global $wpdb, $bp; 1009 1009 … … 1018 1018 } 1019 1019 1020 public staticfunction check_has_invite( $user_id, $group_id, $type = 'sent' ) {1020 function check_has_invite( $user_id, $group_id, $type = 'sent' ) { 1021 1021 global $wpdb, $bp; 1022 1022 … … 1032 1032 } 1033 1033 1034 public staticfunction delete_invite( $user_id, $group_id ) {1034 function delete_invite( $user_id, $group_id ) { 1035 1035 global $wpdb, $bp; 1036 1036 … … 1041 1041 } 1042 1042 1043 public staticfunction delete_request( $user_id, $group_id ) {1043 function delete_request( $user_id, $group_id ) { 1044 1044 global $wpdb, $bp; 1045 1045 … … 1050 1050 } 1051 1051 1052 public staticfunction check_is_admin( $user_id, $group_id ) {1052 function check_is_admin( $user_id, $group_id ) { 1053 1053 global $wpdb, $bp; 1054 1054 … … 1059 1059 } 1060 1060 1061 public staticfunction check_is_mod( $user_id, $group_id ) {1061 function check_is_mod( $user_id, $group_id ) { 1062 1062 global $wpdb, $bp; 1063 1063 … … 1068 1068 } 1069 1069 1070 public staticfunction check_is_member( $user_id, $group_id ) {1070 function check_is_member( $user_id, $group_id ) { 1071 1071 global $wpdb, $bp; 1072 1072 … … 1077 1077 } 1078 1078 1079 public staticfunction check_is_banned( $user_id, $group_id ) {1079 function check_is_banned( $user_id, $group_id ) { 1080 1080 global $wpdb, $bp; 1081 1081 … … 1095 1095 * @since 1.2.6 1096 1096 */ 1097 public staticfunction check_is_creator( $user_id, $group_id ) {1097 function check_is_creator( $user_id, $group_id ) { 1098 1098 global $bp, $wpdb; 1099 1099 … … 1104 1104 } 1105 1105 1106 public staticfunction check_for_membership_request( $user_id, $group_id ) {1106 function check_for_membership_request( $user_id, $group_id ) { 1107 1107 global $wpdb, $bp; 1108 1108 … … 1113 1113 } 1114 1114 1115 public staticfunction get_random_groups( $user_id, $total_groups = 5 ) {1115 function get_random_groups( $user_id, $total_groups = 5 ) { 1116 1116 global $wpdb, $bp; 1117 1117 … … 1124 1124 } 1125 1125 1126 public staticfunction get_group_member_ids( $group_id ) {1126 function get_group_member_ids( $group_id ) { 1127 1127 global $bp, $wpdb; 1128 1128 … … 1130 1130 } 1131 1131 1132 public staticfunction get_group_administrator_ids( $group_id ) {1132 function get_group_administrator_ids( $group_id ) { 1133 1133 global $bp, $wpdb; 1134 1134 … … 1136 1136 } 1137 1137 1138 public staticfunction get_group_moderator_ids( $group_id ) {1138 function get_group_moderator_ids( $group_id ) { 1139 1139 global $bp, $wpdb; 1140 1140 … … 1142 1142 } 1143 1143 1144 public staticfunction get_all_membership_request_user_ids( $group_id ) {1144 function get_all_membership_request_user_ids( $group_id ) { 1145 1145 global $bp, $wpdb; 1146 1146 … … 1148 1148 } 1149 1149 1150 public staticfunction get_all_for_group( $group_id, $limit = false, $page = false, $exclude_admins_mods = true, $exclude_banned = true, $exclude = false ) {1150 function get_all_for_group( $group_id, $limit = false, $page = false, $exclude_admins_mods = true, $exclude_banned = true, $exclude = false ) { 1151 1151 global $bp, $wpdb; 1152 1152 … … 1200 1200 } 1201 1201 1202 public staticfunction delete_all( $group_id ) {1202 function delete_all( $group_id ) { 1203 1203 global $wpdb, $bp; 1204 1204 … … 1215 1215 * @uses BP_Groups_Member 1216 1216 */ 1217 public staticfunction delete_all_for_user( $user_id ) {1217 function delete_all_for_user( $user_id ) { 1218 1218 global $bp, $wpdb; 1219 1219
Note: See TracChangeset
for help on using the changeset viewer.