Ticket #1915: 1915.patch
| File 1915.patch, 9.6 KB (added by , 16 years ago) |
|---|
-
bp-themes/bp-default/_inc/ajax.php
53 53 if ( !empty( $_POST['page'] ) && '-1' != $_POST['page'] ) 54 54 $qs[] = 'page=' . $_POST['page']; 55 55 56 if ( !empty( $_POST['search_terms'] ) && __( 'Search anything...', 'buddypress' ) != $_POST['search_terms'] && 'false' != $_POST['search_terms'] && 'undefined' != $_POST['search_terms'] ) 56 $object_search_text = bp_get_search_default_text( $object ); 57 if ( !empty( $_POST['search_terms'] ) && $object_search_text != $_POST['search_terms'] && 'false' != $_POST['search_terms'] && 'undefined' != $_POST['search_terms'] ) 57 58 $qs[] = 'search_terms=' . $_POST['search_terms']; 58 59 59 60 /* Now pass the querystring to override default values. */ -
bp-core/bp-core-templatetags.php
450 450 function bp_directory_members_search_form() { 451 451 global $bp; 452 452 453 $ search_value = __( 'Search anything...', 'buddypress');454 if ( !empty( $_GET['s'] ) )455 $search_value = $_GET['s'];456 453 $default_search_value = bp_get_search_default_text(); 454 455 $search_value = !empty( $_REQUEST['s'] ) ? $_REQUEST['s'] : $default_search_value; 456 457 457 ?> 458 458 <form action="" method="get" id="search-members-form"> 459 <label><input type="text" name="s" id="members_search" value="<?php echo esc_attr( $search_value ) ?>" onfocus="if (this.value == '<?php _e( 'Search anything...', 'buddypress' ) ?>') {this.value = '';}" onblur="if (this.value == '') {this.value = '<?php _e( 'Search anything...', 'buddypress' )?>';}" /></label>459 <label><input type="text" name="s" id="members_search" value="<?php echo esc_attr( $search_value ) ?>" onfocus="if (this.value == '<?php echo $default_search_value ?>') {this.value = '';}" onblur="if (this.value == '') {this.value = '<?php echo $default_search_value ?>';}" /></label> 460 460 <input type="submit" id="members_search_submit" name="members_search_submit" value="<?php _e( 'Search', 'buddypress' ) ?>" /> 461 461 </form> 462 462 <?php … … 1040 1040 return apply_filters( 'bp_search_form_type_select', $selection_box ); 1041 1041 } 1042 1042 1043 /** 1044 * Get the default text for the search box for a given component. 1045 * 1046 * @global object $bp BuddyPress global settings 1047 * @return string 1048 * @since 1.3 1049 */ 1050 function bp_search_default_text() { 1051 echo bp_get_search_default_text(); 1052 } 1053 function bp_get_search_default_text( $component = false ) { 1054 global $bp; 1055 1056 if ( empty( $component ) ) 1057 $component = $bp->current_component; 1058 1059 return apply_filters( 'bp_search_default_text', $bp->default_search_strings[$component], $component ); 1060 } 1061 1043 1062 function bp_search_form() { 1044 1063 $form = ' 1045 1064 <form action="' . bp_search_form_action() . '" method="post" id="search-form"> -
bp-core/bp-core-classes.php
166 166 } 167 167 } 168 168 169 if ( $search_terms && function_exists( 'xprofile_install' ) ) {169 if ( $search_terms && bp_is_active( 'xprofile' ) ) { 170 170 $search_terms = like_escape( $wpdb->escape( $search_terms ) ); 171 171 $sql['where_searchterms'] = "AND pd.value LIKE '%%$search_terms%%'"; 172 172 } -
bp-blogs.php
25 25 /* Register this in the active components array */ 26 26 $bp->active_components[$bp->blogs->slug] = $bp->blogs->id; 27 27 28 $bp->default_search_strings['blogs'] = __( 'Search Blogs...', 'buddypress' ); 29 28 30 do_action( 'bp_blogs_setup_globals' ); 29 31 } 30 32 add_action( 'bp_setup_globals', 'bp_blogs_setup_globals' ); -
bp-forums.php
27 27 28 28 /* Register this in the active components array */ 29 29 $bp->active_components[$bp->forums->slug] = $bp->forums->id; 30 31 $bp->default_search_strings['forums'] = __( 'Search Forum Topics...', 'buddypress' ); 30 32 31 33 do_action( 'bp_forums_setup' ); 32 34 } -
bp-groups.php
40 40 // Auto join group when non group member performs group activity 41 41 $bp->groups->auto_join = defined( 'BP_DISABLE_AUTO_GROUP_JOIN' ) ? false : true; 42 42 43 $bp->default_search_strings['groups'] = __( 'Search Groups...', 'buddypress' ); 44 43 45 do_action( 'groups_setup_globals' ); 44 46 } 45 47 add_action( 'bp_setup_globals', 'groups_setup_globals' ); -
bp-blogs/bp-blogs-templatetags.php
496 496 } 497 497 498 498 function bp_directory_blogs_search_form() { 499 global $bp; ?> 499 global $bp; 500 501 $default_search_value = bp_get_search_default_text(); 502 503 $search_value = !empty( $_REQUEST['s'] ) ? $_REQUEST['s'] : $default_search_value; 504 505 ?> 500 506 <form action="" method="get" id="search-blogs-form"> 501 <label><input type="text" name="s" id="blogs_search" value="<?php if ( isset( $_GET['s'] ) ) { echo $_GET['s']; } else { _e( 'Search anything...', 'buddypress' ); } ?>" onfocus="if (this.value == '<?php _e( 'Search anything...', 'buddypress' ) ?>') {this.value = '';}" onblur="if (this.value == '') {this.value = '<?php _e( 'Search anything...', 'buddypress' )?>';}" /></label>507 <label><input type="text" name="s" id="blogs_search" value="<?php echo esc_attr( $search_value ) ?>" onfocus="if (this.value == $default_search_value ?>') {this.value = '';}" onblur="if (this.value == '') {this.value = '<?php echo $default_search_value ?>';}" /></label> 502 508 <input type="submit" id="blogs_search_submit" name="blogs_search_submit" value="<?php _e( 'Search', 'buddypress' ) ?>" /> 503 509 </form> 504 510 <?php -
bp-forums/bp-forums-templatetags.php
1025 1025 function bp_directory_forums_search_form() { 1026 1026 global $bp; 1027 1027 1028 $ search_value = __( 'Search anything...', 'buddypress');1029 if ( !empty( $_REQUEST['fs'] ) )1030 $search_value = $_REQUEST['fs'];1028 $default_search_value = bp_get_search_default_text(); 1029 1030 $search_value = !empty( $_REQUEST['fs'] ) ? $_REQUEST['fs'] : $default_search_value; 1031 1031 1032 1032 ?> 1033 1033 <form action="" method="get" id="search-forums-form"> 1034 <label><input type="text" name="s" id="forums_search" value="<?php echo esc_attr( $search_value) ?>" onfocus="if (this.value == '<?php _e( 'Search anything...', 'buddypress' ) ?>') {this.value = '';}" onblur="if (this.value == '') {this.value = '<?php _e( 'Search anything...', 'buddypress' )?>';}" /></label>1034 <label><input type="text" name="s" id="forums_search" value="<?php echo esc_attr( $search_value ) ?>" onfocus="if (this.value == '<?php echo $default_search_value ?>') {this.value = '';}" onblur="if (this.value == '') {this.value = '<?php echo $default_search_value ?>';}" /></label> 1035 1035 <input type="submit" id="forums_search_submit" name="forums_search_submit" value="<?php _e( 'Search', 'buddypress' ) ?>" /> 1036 1036 </form> 1037 1037 <?php -
bp-core.php
81 81 /* The names of the core WordPress pages used to display BuddyPress content */ 82 82 $bp->pages = $bp_pages; 83 83 84 / * Set up the members id and active components entry */84 // Set up the members id and active components entry 85 85 $bp->members->id = 'members'; 86 86 $bp->members->slug = $bp->pages->members->slug; 87 87 $bp->active_components[$bp->members->slug] = $bp->members->id; 88 89 // Set up the default search text for the members component 90 $bp->default_search_strings['members'] = __( 'Search Members...', 'buddypress' ); 88 91 89 92 /* The user ID of the user who is currently logged in. */ 90 93 $bp->loggedin_user->id = $current_user->ID; -
bp-groups/bp-groups-templatetags.php
1810 1810 function bp_directory_groups_search_form() { 1811 1811 global $bp; 1812 1812 1813 $ search_value = __( 'Search anything...', 'buddypress');1814 if ( !empty( $_REQUEST['s'] ) )1815 $search_value = $_REQUEST['s'];1813 $default_search_value = bp_get_search_default_text(); 1814 1815 $search_value = !empty( $_REQUEST['s'] ) ? $_REQUEST['s'] : $default_search_value; 1816 1816 1817 1817 ?> 1818 1818 <form action="" method="get" id="search-groups-form"> 1819 <label><input type="text" name="s" id="groups_search" value="<?php echo esc_attr( $search_value) ?>" onfocus="if (this.value == '<?php _e( 'Search anything...', 'buddypress' ) ?>') {this.value = '';}" onblur="if (this.value == '') {this.value = '<?php _e( 'Search anything...', 'buddypress' )?>';}" /></label>1819 <label><input type="text" name="s" id="groups_search" value="<?php echo esc_attr( $search_value ) ?>" onfocus="if (this.value == '<?php echo $default_search_value ?>') {this.value = '';}" onblur="if (this.value == '') {this.value = '<?php echo $default_search_value ?>';}" /></label> 1820 1820 <input type="submit" id="groups_search_submit" name="groups_search_submit" value="<?php _e( 'Search', 'buddypress' ) ?>" /> 1821 1821 </form> 1822 1822 <?php