Skip to:
Content
Pages
Categories
Search
Top
Bottom

Forum Replies Created

Viewing 5 replies - 1 through 5 (of 5 total)

  • t.schwarz
    Participant

    @tschwarz-1

    No, in BuddyPress, I can create the notifications, I would just like to offer the user to not receive them if they opt out. Somehow this is difficult, apparently.


    t.schwarz
    Participant

    @tschwarz-1

    Thanks for the reply @shanebp and the idea – but how would I determine whether to show only the filtered IDs or the entire list? I’d still need that info (the GET variable in my approach) to switch between the two bp_ajax_querystrings, wouldn’t I?


    t.schwarz
    Participant

    @tschwarz-1

    In case anyone is interested, this is how I solved it:

    Using the first route, I needed to get the $_GET in Javascript and then add it to the bp.nouveau.requestObject when the variable is present. That way the variable is included in the ajax $_POST using the activity-loop template. Then I can simply query for the meta value and only show activities that have the specified value.


    t.schwarz
    Participant

    @tschwarz-1

    This is how I got this done after serious research…

    This goes into your main js – source partly: https://support.themosaurus.com/forums/topic/add-a-pagination-on-top-of-buddypress-member-list/

    
    //add history state
    jQuery(document).on("mouseup touchend", ".bp-pagination a.page-numbers", function () {
       history.pushState({}, "Member directory - Page " + jQuery(this).text(), jQuery(this).attr("href"));
    });
    
    if (jQuery('body').hasClass('directory members')) {
       const params = new Proxy(new URLSearchParams(window.location.search), {
          get: (searchParams, prop) => searchParams.get(prop),
       });
       let value = params.upage; // upage being the passed pagination value
    
       var myCustomQueryData = {
         object: 'members',
         page: value || 1
       };
       
       bp.Nouveau.objectRequest(myCustomQueryData);
    }
    

    Hope this helps


    t.schwarz
    Participant

    @tschwarz-1

    Thanks!

Viewing 5 replies - 1 through 5 (of 5 total)
Skip to toolbar