Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /*** i commented on http://buddydev.com/buddypress/making-buddypress-activity-searchable/ ***/
- /***** the src-activity.js file *****/
- ?>
- jQuery(document).ready(function($){
- if( $('form#search-form #search-which').length ) {
- if ( '' != $.cookie('bp-activity-search-terms') ) {
- $('form#search-form #search-which option[value="activity"]').prop( 'selected', true );
- $('form#search-form #search-terms').val( $.cookie('bp-activity-search-terms') );
- }
- $('#search-submit').click(function(){
- if( $('form#search-form #search-which').val() == "activity" ) {
- search_terms = $('form#search-form #search-terms').val();
- if(search_terms.length == 0)
- $.cookie( 'bp-activity-search-terms', '', {path: '/'} );
- else
- $.cookie( 'bp-activity-search-terms', search_terms, {path: '/'} );
- } else {
- $.cookie( 'bp-activity-search-terms', '', {path: '/'} );
- }
- })
- }
- });
- <?php
- /***** now lines 65 to 67 replacement in your class final code ******/
- $_BP_COOKIE = &$_COOKIE;
- if ( isset( $_BP_COOKIE['bp-activity-search-terms'] ) && !empty( $_BP_COOKIE['bp-activity-search-terms'] ) ) {
- if( empty($qs) )
- $qs="search_terms=".$_BP_COOKIE['bp-activity-search-terms'];
- else
- $qs .= "&search_terms=".$_BP_COOKIE['bp-activity-search-terms'];
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement