We currently have a database of users interested in a particular activity. It contains their name and other information about them. I'd like to start a second database in which we can track the activity of each user. It would have the user's name, the activity they participated in and the date they participated.
We would be able to search the second database to determine which users participated in which activities during a certain time period.
Can this be done with toolset?
Hello and thank you for contacting the Toolset support.
Assuming that the users will interact with the system, and will have a user/password to log in to the system, you can create two custom post types and a one-to-many relationship between them:
- Activity post type: This will represent the different activities. A post per activity.
- Participation post type: This sill represent a user's participation in an activity. It will contain the date of the user's participation in custom fields. Maybe one custom field(participation date/time), or two(participation start and end date/times). Each user will be the author of their own participation's post.
- One-to-many relationships: An activity can have multiple participations.
Read more about relationships here https://toolset.com/related-lesson/post-relationships/
For the search page, you can create a view that will filter participation posts, and you can add search filters to check if a participation post is between two dates.
Read more about building search views here https://toolset.com/related-lesson/custom-search/
And about Date query filters here:
- https://toolset.com/documentation/user-guides/views/filtering-views-query-by-date/
- https://toolset.com/documentation/user-guides/views/date-filters/
If the users will not have a user entry in the system, so, they can't be authors of posts, then, we'll need to represent the users using a 3rd custom post type(Members), and we can link them to the participation post using a One-to-many relationship, where each Member can have multiple relationships.
I hope this makes sense and gives you some insights. Let me know if you have any questions or if you want to add any details.
Side note: I believe the following articles are worth to mention:
- https://toolset.com/documentation/programmer-reference/how-to-import-a-database-into-wordpress/
- https://toolset.com/course-lesson/how-to-create-custom-searches-and-relationships-for-users/
My issue is resolved now. Thank you!