Changeset 14083
- Timestamp:
- 11/25/2024 03:54:32 PM (2 months ago)
- Location:
- branches/14.0/src/bp-templates/bp-legacy
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/14.0/src/bp-templates/bp-legacy/buddypress-functions.php
r14060 r14083 712 712 */ 713 713 function bp_legacy_theme_ajax_querystring( $query_string, $object ) { 714 if ( empty( $object ) ) 714 if ( empty( $object ) ) { 715 715 return ''; 716 } 716 717 717 718 // Set up the cookies passed on this AJAX request. Store a local var to avoid conflicts. … … 720 721 str_replace( '; ', '&', urldecode( $_POST['cookie'] ) ) 721 722 ); 723 } elseif ( ! empty( $_POST['data']['bp_heartbeat'] ) ) { 724 $_BP_COOKIE = bp_parse_args( 725 str_replace( '; ', '&', urldecode( $_POST['data']['bp_heartbeat'] ) ) 726 ); 722 727 } else { 723 728 $_BP_COOKIE = &$_COOKIE; … … 755 760 756 761 // Activity stream scope only on activity directory. 757 if ( 'all' != $_BP_COOKIE['bp-' . $object . '-scope'] && ! bp_displayed_user_id() && ! bp_is_single_item() ) 762 if ( 'all' != $_BP_COOKIE['bp-' . $object . '-scope'] && ! bp_displayed_user_id() && ! bp_is_single_item() ) { 758 763 $qs[] = 'scope=' . urlencode( $_BP_COOKIE['bp-' . $object . '-scope'] ); 764 } 759 765 } 760 766 761 767 // If page and search_terms have been passed via the AJAX post request, use those. 762 if ( ! empty( $_POST['page'] ) && '-1' != $_POST['page'] ) 768 if ( ! empty( $_POST['page'] ) && '-1' != $_POST['page'] ) { 763 769 $qs[] = 'page=' . absint( $_POST['page'] ); 770 } 764 771 765 772 // Excludes activity just posted and avoids duplicate ids. … … 779 786 780 787 $object_search_text = bp_get_search_default_text( $object ); 781 if ( ! empty( $_POST['search_terms'] ) && is_string( $_POST['search_terms'] ) && $object_search_text != $_POST['search_terms'] && 'false' != $_POST['search_terms'] && 'undefined' != $_POST['search_terms'] ) 788 if ( ! empty( $_POST['search_terms'] ) && is_string( $_POST['search_terms'] ) && $object_search_text != $_POST['search_terms'] && 'false' != $_POST['search_terms'] && 'undefined' != $_POST['search_terms'] ) { 782 789 $qs[] = 'search_terms=' . urlencode( $_POST['search_terms'] ); 790 } 783 791 784 792 // Now pass the querystring to override default values. … … 786 794 787 795 $object_filter = ''; 788 if ( isset( $_BP_COOKIE['bp-' . $object . '-filter'] ) ) 796 if ( isset( $_BP_COOKIE['bp-' . $object . '-filter'] ) ) { 789 797 $object_filter = $_BP_COOKIE['bp-' . $object . '-filter']; 798 } 790 799 791 800 $object_scope = ''; 792 if ( isset( $_BP_COOKIE['bp-' . $object . '-scope'] ) ) 801 if ( isset( $_BP_COOKIE['bp-' . $object . '-scope'] ) ) { 793 802 $object_scope = $_BP_COOKIE['bp-' . $object . '-scope']; 803 } 794 804 795 805 $object_page = ''; 796 if ( isset( $_BP_COOKIE['bp-' . $object . '-page'] ) ) 806 if ( isset( $_BP_COOKIE['bp-' . $object . '-page'] ) ) { 797 807 $object_page = $_BP_COOKIE['bp-' . $object . '-page']; 808 } 798 809 799 810 $object_search_terms = ''; 800 if ( isset( $_BP_COOKIE['bp-' . $object . '-search-terms'] ) ) 811 if ( isset( $_BP_COOKIE['bp-' . $object . '-search-terms'] ) ) { 801 812 $object_search_terms = $_BP_COOKIE['bp-' . $object . '-search-terms']; 813 } 802 814 803 815 $object_extras = ''; 804 if ( isset( $_BP_COOKIE['bp-' . $object . '-extras'] ) ) 816 if ( isset( $_BP_COOKIE['bp-' . $object . '-extras'] ) ) { 805 817 $object_extras = $_BP_COOKIE['bp-' . $object . '-extras']; 818 } 806 819 807 820 /** -
branches/14.0/src/bp-templates/bp-legacy/js/buddypress.js
r13344 r14083 1756 1756 1757 1757 data.bp_activity_last_recorded = activity_last_recorded; 1758 data.bp_heartbeat = bp_get_cookies() || encodeURIComponent( jq.param( { 'bp-activity-scope': null } ) ); 1758 1759 1759 1760 last_recorded_search = bp_get_querystring('s');
Note: See TracChangeset
for help on using the changeset viewer.