Changeset 2422 for trunk/bp-themes/bp-default/_inc/ajax.php
- Timestamp:
- 01/24/2010 02:29:57 PM (16 years ago)
- File:
-
- 1 edited
-
trunk/bp-themes/bp-default/_inc/ajax.php (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-themes/bp-default/_inc/ajax.php
r2413 r2422 10 10 */ 11 11 12 function bp_dtheme_content_filter() { 13 global $bp; 14 15 $content = esc_attr( $_POST['content'] ); 16 $type = esc_attr( $_POST['type'] ); 12 function bp_dtheme_object_filter() { 13 global $bp; 14 15 $object = esc_attr( $_POST['object'] ); 17 16 $filter = esc_attr( $_POST['filter'] ); 18 17 $page = esc_attr( $_POST['page'] ); 19 18 $search_terms = esc_attr( $_POST['search_terms'] ); 20 19 20 /** 21 * Scope is the scope of results to use, either all (everything) or personal (just mine). 22 * For example if the object is groups, it would be all groups, or just groups I belong to. 23 */ 24 $scope = esc_attr( $_POST['scope'] ); 25 21 26 /* Plugins can pass extra parameters and use the bp_dtheme_ajax_querystring_content_filter filter to parse them */ 22 27 $extras = esc_attr( $_POST['extras'] ); … … 29 34 $filter = 'active'; 30 35 31 if ( empty( $type ) )32 $type = 'all';33 34 36 $bp->ajax_querystring = 'type=' . $filter . '&page=' . $page; 35 37 … … 37 39 $bp->ajax_querystring .= '&search_terms=' . $search_terms; 38 40 39 if ( $ type != 'all' || $bp->displayed_user->id ) {41 if ( $scope != 'all' || $bp->displayed_user->id ) { 40 42 $user_id = ( $bp->displayed_user->id ) ? $bp->displayed_user->id : $bp->loggedin_user->id; 41 43 $bp->ajax_querystring .= '&user_id=' . $user_id; … … 44 46 $bp->ajax_querystring = apply_filters( 'bp_dtheme_ajax_querystring_content_filter', $bp->ajax_querystring, $extras ); 45 47 46 locate_template( array( "$ content/$content-loop.php" ), true );47 } 48 add_action( 'wp_ajax_members_filter', 'bp_dtheme_ content_filter' );49 add_action( 'wp_ajax_groups_filter', 'bp_dtheme_ content_filter' );50 add_action( 'wp_ajax_blogs_filter', 'bp_dtheme_ content_filter' );51 add_action( 'wp_ajax_forums_filter', 'bp_dtheme_ content_filter' );48 locate_template( array( "$object/$object-loop.php" ), true ); 49 } 50 add_action( 'wp_ajax_members_filter', 'bp_dtheme_object_filter' ); 51 add_action( 'wp_ajax_groups_filter', 'bp_dtheme_object_filter' ); 52 add_action( 'wp_ajax_blogs_filter', 'bp_dtheme_object_filter' ); 53 add_action( 'wp_ajax_forums_filter', 'bp_dtheme_object_filter' ); 52 54 53 55 function bp_dtheme_post_update() {
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)