Custom Members-Loop and Pagination issues
-
I have a customised members-loop page which works well except for the pagination links.
If I click on the links it reloads the current page unless I right click and then open in new window and then the links work fine on the new window.
The orginal code uses this code:
<?php if ( bp_has_members( bp_ajax_querystring( 'members' ) ) ) : ?>
I have changed my code to the following:
<?php// if ( bp_has_members( my_custom_ids( 'Leaving Year', $_GET['alumniyear'] ) . '&populate_extras&type=alphabetical' ) ) : ?>
If the alumniyear is present then it filters the members – if no alumniyear is select then all members are shown.
I found the my_custom_ids on here and is shown below:
function my_custom_ids( $field_name, $field_value = '' ) { if ( empty( $field_name ) ) return ''; global $wpdb; $field_id = xprofile_get_field_id_from_name( $field_name ); if ( !empty( $field_id ) ) $query = "SELECT user_id FROM " . $wpdb->prefix . "bp_xprofile_data WHERE field_id = " . $field_id; else return ''; if ( $field_value != '' ) $query .= " AND value LIKE '%" . $field_value . "%'"; /* LIKE is slow. If you're sure the value has not been serialized, you can do this: $query .= " AND value = '" . $field_value . "'"; */ $custom_ids = $wpdb->get_col( $query ); if ( !empty( $custom_ids ) ) { // convert the array to a csv string $custom_ids_str = 'include=' . implode(",", $custom_ids); return $custom_ids_str; } else return ''; } ?>
Anyone any idea on why this is happening?
Thanks
- You must be logged in to reply to this topic.