Forum Replies Created
-
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.
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?
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.
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
Thanks!