I would really like to have a way to show if readers are already subscribed to the journal or not within the enrollment.tpl
Right now it is quite the hassle to compare the reader list with the list of individual subscriptions.
Is there any chance to easily compare this or should I go the php-route and taylor me a SQL-query looking for users that are subscribers and readers that are not?
Thanks for the help! It’s greatly appreciated!
for now I went the php-route and made a file with the following query:
SELECT * FROM `users` WHERE `users`.`user_id` NOT IN (SELECT `user_id` FROM `subscriptions`)
This gives me all the readers/users who are not subscribers at the moment.
Is there any way to add this query elegantly to either the enrollment.tpl or the individualSubscriptions.tpl?
You would need to…
- Edit pages/manager/PeopleHandler.inc.php in the
people function, which is what prepares to display the
enrollment.tpl template. Find what functions are used to fetch lists of users. These are
- Edit these functions to add a join to see whether the user is a subscriber or not and give that data to the returned objects.
enrollment.tpl to present that data.
If you’ve got someone handy with PHP, it’s not a huge modification. Let me know if you decide to try this and get stuck.
Public Knowledge Project Team