I have a very complicated Toolset assisted site. Numerous CPTs, relationships, etc.
Users are able to add many different bits of information and other users are able to follow these users.
The most difficult part has been coming up with a way to view a stream of activity that users are creating so that their followers can stay engaged.
i.e.
"Joe has added two new widgets"
"Sue has read A Tale of Two Cities"
I also allow people to just post what's on their mind and users can add comments...
User: Joe
February 3, 2020
Hi, not feeling so great today... anyone have a suggestion for how I can improve my mood?
ADD COMMENT
It's not hard to setup a query like "display all comments by users you are following" or "display all comments by ANY user matching the Horticulture CPT." But it's quite difficult to make a query matching all of the different things these users do on a regular basis.
It's also quite difficult to make an efficient query for a large database of users. Obviously we would only want to display X number of items per view and AJAX load "more" with each click.
Am I way over my head with what Toolset can accomplish? I'm not afraid of complicated PHP programming to make things work.
I'm thinking I would need to record each and every action to some sort of log that has a relationship to the specific user and the item in the log would reference the data that needs to be pulled into the stream. Then query the log for each of the users you are following to grab the new data. Sort it by date descending.
I can't stand the idea of using something like Buddypress or any of the bloated member plugins.
This is a complicated project, but I wanted to develop a proof of concept with Toolset/wordpress before committing to a larger team of programmers for a custom build.
thanks for any insight.
marc
Hello,
Are we talking about WordPress built-in comment systems?
For the problems:
1) "display all comments by users you are following" or "display all comments by ANY user matching the Horticulture CPT."
Toolset Views/Blocks does not support WordPress comment yet, so you will need to setup custom codes to query the comments, for example:
https://codex.wordpress.org/Function_Reference/get_comment
user_id
(integer) The comment author's ID if they are registered
2) It's also quite difficult to make an efficient query for a large database of users. Obviously we would only want to display X number of items per view and AJAX load "more" with each click.
Are we talking about querying WordPress comments or posts/users, if it is comments, same as 1), there isn't such a built-in feature within Toolset, if it is posts/users, you can setup a view with AJAX pagination, see our document:
https://toolset.com/documentation/user-guides/views/views-pagination/