| @@ -21,29 +21,17 @@ | ||
| 21 | 21 | endif; |
| 22 | 22 | |
| 23 | 23 | if ($group=='all') $users= get_users () ; |
| 24 | 24 | if ($group == 'nogroup') $users = get_users( array( 'meta_key' => 'private_group','meta_compare' => 'NOT EXISTS' )) ; |
| 25 | - if (substr($group,0,5) =='group') { | |
| 26 | - $users1 = get_users( array( 'meta_key' => 'private_group', 'meta_value' => $group )) ; | |
| 27 | - $filtercheck='*'.$group.'*' ; | |
| 28 | - $users2 = get_users( array( | |
| 29 | - 'meta_key' => 'private_group', | |
| 30 | - 'meta_value' => '*'.$group.'*', | |
| 31 | - 'meta_compare' => 'LIKE' | |
| 32 | - ) | |
| 33 | - ) ; | |
| 34 | - $users=array_merge($users1,$users2); | |
| 35 | - | |
| 36 | - } | |
| 37 | - | |
| 25 | + if (substr($group,0,5) =='group') $users = get_users( array( 'meta_key' => 'private_group', 'meta_value' => $group )) ; | |
| 26 | + | |
| 27 | + $title = 'User Management' ; | |
| 28 | + | |
| 38 | 29 | ?> |
| 39 | 30 | |
| 40 | - <div class="icon32" id="icon-users"><br></div> | |
| 41 | - <p> <b> | |
| 42 | - <?php _e('Warning : The "bulk actions" CANNOT be used to set a multiple groups group against a user or users' , 'bbp-private-groups' ) ; ?></b> </p> | |
| 43 | - <p> <b> | |
| 44 | - <?php _e( 'Edit users at individual level if allocating multiple groups to users.' , 'bbp-private-groups' ) ; ?> | |
| 45 | - </b></p> | |
| 31 | + <div class="icon32" id="icon-users"><br></div><h2><?php echo $title ?></h2> | |
| 32 | + <p> <b>Warning : The 'bulk actions' CANNOT be used to set a multiple groups group against a user or users</b> </p> | |
| 33 | + <p> <b> Edit users at individual level if allocating multiple groups to users </b></p> | |
| 46 | 34 | |
| 47 | 35 | |
| 48 | 36 | <form method="post"> |
| 49 | 37 | |
| @@ -50,10 +38,10 @@ | ||
| 50 | 38 | <?php wp_nonce_field( 'confirm-bulk-action', 'confirm-bulk-action-nonce' ) ?> |
| 51 | 39 | |
| 52 | 40 | <div class="tablenav top"> |
| 53 | 41 | <select name="action"> |
| 54 | - <option value=""><?php _e( 'Bulk Actions', 'bbp-private-groups' ); ?></option> | |
| 55 | - <option value="no-group"> <?php _e( 'No-Group', 'bbp-private-groups') ?></option> | |
| 42 | + <option value=""><?php _e( 'Bulk Actions' ); ?></option> | |
| 43 | + <option value="no-group"> <?php _e( 'No-Group') ?></option> | |
| 56 | 44 | <?php |
| 57 | 45 | //sets up the groups as actions |
| 58 | 46 | $count=count ($rpg_groups) ; |
| 59 | 47 | for ($i = 0 ; $i < $count ; ++$i) { |
| @@ -59,22 +47,21 @@ | ||
| 59 | 47 | for ($i = 0 ; $i < $count ; ++$i) { |
| 60 | 48 | $g=$i+1 ; |
| 61 | 49 | $name="group".$g ; |
| 62 | 50 | $item=$name.' '.$rpg_groups[$name] ; |
| 63 | - $display=__( 'Group', 'bbp-private-groups' ).$g.' '.$rpg_groups[$name] ; | |
| 64 | 51 | ?> |
| 65 | - <option value="<?php echo $name ?>"><?php echo $display ?></option> | |
| 52 | + <option value="<?php echo $name ?>"><?php echo $item ?></option> | |
| 66 | 53 | <?php |
| 67 | 54 | } |
| 68 | 55 | ?> |
| 69 | 56 | </select> |
| 70 | - <input type="submit" value="<?php _e( 'Apply' , 'bbp-private-groups' ); ?>" class="button action doaction" name=""> | |
| 57 | + <input type="submit" value="<?php _e( 'Apply' ); ?>" class="button action doaction" name=""> | |
| 71 | 58 | |
| 72 | 59 | |
| 73 | 60 | <select name="action2"> |
| 74 | - <option value=""><?php _e( 'Filter user list' , 'bbp-private-groups' ); ?></option> | |
| 75 | - <option value="filterall"> <?php _e( 'All Groups' , 'bbp-private-groups') ?></option> | |
| 76 | - <option value="filternogroup"> <?php _e( 'No-Group-set' , 'bbp-private-groups' ) ?></option> | |
| 61 | + <option value=""><?php _e( 'Filter user list' ); ?></option> | |
| 62 | + <option value="filterall"> <?php _e( 'All Groups') ?></option> | |
| 63 | + <option value="filternogroup"> <?php _e( 'No-Group-set') ?></option> | |
| 77 | 64 | <?php |
| 78 | 65 | //sets up the groups as actions |
| 79 | 66 | for ($i = 0 ; $i < $count ; ++$i) { |
| 80 | 67 | $g=$i+1 ; |
| @@ -80,16 +67,15 @@ | ||
| 80 | 67 | $g=$i+1 ; |
| 81 | 68 | $name="group".$g ; |
| 82 | 69 | $name2="filtergroup".$g ; |
| 83 | 70 | $item=$name.' '.$rpg_groups[$name] ; |
| 84 | - $display=__( 'Group', 'bbp-private-groups' ).$g.' '.$rpg_groups[$name] ; | |
| 85 | 71 | ?> |
| 86 | - <option value="<?php echo $name2 ?>"><?php echo $display ?></option> | |
| 72 | + <option value="<?php echo $name2 ?>"><?php echo $item ?></option> | |
| 87 | 73 | <?php |
| 88 | 74 | } |
| 89 | 75 | ?> |
| 90 | 76 | </select> |
| 91 | - <input type="submit" value="<?php _e( 'Filter' , 'bbp-private-groups' ); ?>" class="button action doaction" name="" > | |
| 77 | + <input type="submit" value="<?php _e( 'Filter' ); ?>" class="button action doaction" name="" > | |
| 92 | 78 | </div> |
| 93 | 79 | |
| 94 | 80 | <table class="widefat"> |
| 95 | 81 | <thead> |
| @@ -94,12 +80,12 @@ | ||
| 94 | 80 | <table class="widefat"> |
| 95 | 81 | <thead> |
| 96 | 82 | <tr> |
| 97 | 83 | <th id="cb"><input type="checkbox" name="check-all" valle="Check all"></th> |
| 98 | - <th id="gravatar"><?php _e( 'Gravatar', 'bbp-private-groups' ); ?></th> | |
| 99 | - <th id="display_name"><?php _e( 'Name', 'bbp-private-groups' ); ?></th> | |
| 100 | - <th id="private_group"><?php _e( 'Private Group(s)', 'bbp-private-groups' ); ?></th> | |
| 101 | - <th id="role"><?php _e( 'Wordpress & bbPress Roles', 'bbp-private-groups' ); ?></th> | |
| 84 | + <th id="gravatar"><?php _e( 'Gravatar', 'confirm-user-registration' ); ?></th> | |
| 85 | + <th id="display_name"><?php _e( 'Name', 'private_groups' ); ?></th> | |
| 86 | + <th id="private_group"><?php _e( 'Private Group(s)', 'private_groups' ); ?></th> | |
| 87 | + <th id="role"><?php _e( 'Wordpress & bbPress Roles', 'private_groups' ); ?></th> | |
| 102 | 88 | |
| 103 | 89 | |
| 104 | 90 | </tr> |
| 105 | 91 | </thead> |
| @@ -123,9 +109,9 @@ | ||
| 123 | 109 | <td> |
| 124 | 110 | <a href="user-edit.php?user_id=<?php echo $user->ID ?>"><?php echo $user->display_name ?></a> |
| 125 | 111 | <div class="row-actions"> |
| 126 | 112 | <?php if ( current_user_can( 'edit_user', $user->ID ) ) : ?> |
| 127 | - <span class="edit"><a href="<?php echo admin_url( 'user-edit.php?user_id=' . $user->ID ) ?>"><?php _e( 'Edit', 'bbp-private-groups' ); ?></a> | |
| 113 | + <span class="edit"><a href="<?php echo admin_url( 'user-edit.php?user_id=' . $user->ID ) ?>"><?php _e( 'Edit' ); ?></a> | |
| 128 | 114 | <?php endif; ?> |
| 129 | 115 | <?php if ( current_user_can( 'edit_user', $user->ID ) && current_user_can( 'delete_user', $user->ID ) && $user_ID != $user->ID ) : ?> |
| 130 | 116 | | </span> |
| 131 | 117 | <?php endif; ?> |
| @@ -136,24 +122,18 @@ | ||
| 136 | 122 | </td> |
| 137 | 123 | |
| 138 | 124 | <td><?php |
| 139 | 125 | //if no groups |
| 140 | - if ($private_group == '') _e ('no group set', 'bbp-private-groups') ; | |
| 126 | + if ($private_group == '') echo 'no group set' ; | |
| 141 | 127 | //if multiple groups |
| 142 | 128 | elseif (strpos($private_group, '*')!== FALSE) { |
| 143 | - foreach ( $rpg_groups as $group => $details ) { | |
| 144 | - if (strpos($private_group, '*'.$group.'*') !== FALSE) { | |
| 145 | - $groupname=__('Group','bbp-private-groups').substr($group,5,strlen($group)) ; | |
| 146 | - echo $groupname." ".$details.'<br>' ; | |
| 147 | - } | |
| 148 | - } | |
| 129 | + foreach ( $rpg_groups as $group => $details ) { | |
| 130 | + if (strpos($private_group, '*'.$group.'*') !== FALSE) echo $group." ".$details.'<br>' ; ; | |
| 131 | + | |
| 149 | 132 | } |
| 133 | + } | |
| 150 | 134 | //if only one group |
| 151 | - | |
| 152 | - else { | |
| 153 | - $groupname=__('Group','bbp-private-groups').substr($private_group,5,strlen($private_group)) ; | |
| 154 | - echo $groupname.' '.$rpg_groups[$private_group] ; | |
| 155 | - } | |
| 135 | + else echo $private_group.' '.$rpg_groups[$private_group] ; | |
| 156 | 136 | ?> |
| 157 | 137 | </td> |
| 158 | 138 | <td> |
| 159 | 139 | <?php |
| @@ -161,9 +141,9 @@ | ||
| 161 | 141 | |
| 162 | 142 | foreach ( $user_data->roles as $role ) : |
| 163 | 143 | if ((substr($role,0,4)) == 'bbp_') $role = substr($role,4,strlen($role)) ; |
| 164 | 144 | |
| 165 | - echo _x( ucfirst( $role ), 'bbp-private-groups' ) . '<br>'; | |
| 145 | + echo _x( ucfirst( $role ), 'User role' ) . '<br>'; | |
| 166 | 146 | |
| 167 | 147 | endforeach; |
| 168 | 148 | |
| 169 | 149 | endif; |
| @@ -168,8 +148,10 @@ | ||
| 168 | 148 | |
| 169 | 149 | endif; |
| 170 | 150 | ?> |
| 171 | 151 | </td> |
| 152 | + <?php //<td><?php echo $user_registered ?> | |
| 153 | + <?php //</td> ?> | |
| 172 | 154 | |
| 173 | 155 | |
| 174 | 156 | </tr> |
| 175 | 157 | <?php |
| @@ -179,9 +161,9 @@ | ||
| 179 | 161 | else : |
| 180 | 162 | |
| 181 | 163 | ?> |
| 182 | 164 | <tr> |
| 183 | - <td colspan="6"><strong><?php _e( 'No Users found', 'bbp-private-groups' ); ?></strong></td> | |
| 165 | + <td colspan="6"><strong><?php _e( 'No Users found', 'private_groups' ); ?></strong></td> | |
| 184 | 166 | </tr> |
| 185 | 167 | <?php |
| 186 | 168 | |
| 187 | 169 | endif; |
| @@ -213,11 +195,11 @@ | ||
| 213 | 195 | |
| 214 | 196 | ?> |
| 215 | 197 | <div class="updated message"> |
| 216 | 198 | <?php if ( 1 == count( $user_ids) ) : ?> |
| 217 | - <p><?php _e( '1 user amended', 'bbp-private-groups' ) ?></p> | |
| 199 | + <p><?php _e( '1 user amended', 'confirm-user-registration' ) ?></p> | |
| 218 | 200 | <?php else : ?> |
| 219 | - <p><?php echo count( $user_ids ) . ' ' . __( 'users amended', 'bbp-private-groups' ) ?></p> | |
| 201 | + <p><?php echo count( $user_ids ) . ' ' . __( 'users amended', 'private groups' ) ?></p> | |
| 220 | 202 | <?php endif; ?> |
| 221 | 203 | </div> |
| 222 | 204 | <?php |
| 223 | 205 | |
| @@ -243,11 +225,11 @@ | ||
| 243 | 225 | |
| 244 | 226 | ?> |
| 245 | 227 | <div class="updated message"> |
| 246 | 228 | <?php if ( 1 == count( $user_ids) ) : ?> |
| 247 | - <p><?php _e( '1 user amended', 'bbp-private-groups' ) ?></p> | |
| 229 | + <p><?php _e( '1 user amended', 'confirm-user-registration' ) ?></p> | |
| 248 | 230 | <?php else : ?> |
| 249 | - <p><?php echo count( $user_ids ) . ' ' . __( 'users amended', 'bbp-private-groups' ) ?></p> | |
| 231 | + <p><?php echo count( $user_ids ) . ' ' . __( 'users amended', 'private groups' ) ?></p> | |
| 250 | 232 | <?php endif; ?> |
| 251 | 233 | </div> |
| 252 | 234 | <?php |
| 253 | 235 | |