Changeset 3648 for trunk/bp-groups/bp-groups-templatetags.php
- Timestamp:
- 01/03/2011 10:49:11 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-groups/bp-groups-templatetags.php
r3635 r3648 23 23 var $order; 24 24 25 function bp_groups_template( $user_id, $type, $page, $per_page, $max, $slug, $search_terms, $include, $populate_extras, $exclude ) {25 function bp_groups_template( $user_id, $type, $page, $per_page, $max, $slug, $search_terms, $include, $populate_extras, $exclude, $show_hidden ) { 26 26 global $bp; 27 27 28 28 $this->pag_page = isset( $_REQUEST['grpage'] ) ? intval( $_REQUEST['grpage'] ) : $page; 29 29 $this->pag_num = isset( $_REQUEST['num'] ) ? intval( $_REQUEST['num'] ) : $per_page; 30 31 if ( $bp->loggedin_user->is_super_admin || ( is_user_logged_in() && $user_id == $bp->loggedin_user->id ) ) 32 $show_hidden = true; 30 33 31 34 if ( 'invites' == $type ) { … … 36 39 $this->groups = array( $group ); 37 40 } else { 38 $this->groups = groups_get_groups( array( 'type' => $type, 'per_page' => $this->pag_num, 'page' => $this->pag_page, 'user_id' => $user_id, 'search_terms' => $search_terms, 'include' => $include, 'exclude' => $exclude, 'populate_extras' => $populate_extras ) );41 $this->groups = groups_get_groups( array( 'type' => $type, 'per_page' => $this->pag_num, 'page' => $this->pag_page, 'user_id' => $user_id, 'search_terms' => $search_terms, 'include' => $include, 'exclude' => $exclude, 'populate_extras' => $populate_extras, 'show_hidden' => $show_hidden ) ); 39 42 } 40 43 … … 137 140 * pass their parameters directly to the loop. 138 141 */ 142 $slug = false; 139 143 $type = 'active'; 140 $user_id = false; 141 $search_terms = null; 142 $slug = false; 144 $user_id = 0; 143 145 144 146 /* User filtering */ … … 165 167 'per_page' => 20, 166 168 'max' => false, 169 'show_hidden' => false, 167 170 168 171 'user_id' => $user_id, // Pass a user ID to limit to groups this user has joined 169 172 'slug' => $slug, // Pass a group slug to only return that group 170 'search_terms' => $search_terms, // Pass search terms to return only matching groups173 'search_terms' => '', // Pass search terms to return only matching groups 171 174 'include' => false, // Pass comma separated list of group ID's to return only these groups 172 175 'exclude' => false, // Pass comma separated list of group ID's to exclude these groups … … 187 190 } 188 191 189 $groups_template = new BP_Groups_Template( (int)$user_id, $type, (int)$page, (int)$per_page, (int)$max, $slug, $search_terms, $include, (bool)$populate_extras, $exclude );192 $groups_template = new BP_Groups_Template( (int)$user_id, $type, (int)$page, (int)$per_page, (int)$max, $slug, $search_terms, $include, (bool)$populate_extras, $exclude, $show_hidden ); 190 193 return apply_filters( 'bp_has_groups', $groups_template->has_groups(), $groups_template ); 191 194 } … … 1872 1875 global $bp; 1873 1876 1874 $default_search_value = bp_get_search_default_text(); 1875 $search_value = !empty( $_REQUEST['s'] ) ? stripslashes( $_REQUEST['s'] ) : $default_search_value; 1877 $default_search_value = bp_get_search_default_text(); 1878 $search_value = !empty( $_REQUEST['s'] ) ? stripslashes( $_REQUEST['s'] ) : $default_search_value; 1876 1879 1877 1880 ?>
Note: See TracChangeset
for help on using the changeset viewer.