By sfeldkamp on
Spent the morning looking through the modules section and reading up on Views. I'd like to implement a view that will display a user's read items and one that displays the unread items. Does any such module exist already? If not could such a view be created with a combination of existing modules, or would I have to create an entirely new module from scratch?
I considered CCK, but I don't think that could work, what is really needed is some sort of xref table for users and nodes. My understanding is that CCK is just a single value per node. Correct?
Comments
Well it seems like I ought
Well it seems like I ought to be able to do this by enabling the tracker module and some sort of Argument Handling Code in the Views module. I'll post the solution if I figure it out. Any help in the meantime is appreciated...
Figured it out
And I'll post the solution here in case anyone else is struggling against this sort of thing...
In the views_user.inc file in views/modules:
I added the following sub-array to the filters array. This defines the filter for the Views_UI.module.
then I created this function
In the end the solution didn't have anything to do with the tracker module (I think history table is populated regardless of whether or not that module is enabled) or Arguments since the variable current user's uid was not passed in through the url (or added programmatically to the $arguments array). Not bad for my first ever PHP code block.
Edit: One final note: apparently history records are discarded after 30days if the node hasn't been updated. I'll add in some logic so that it only looks for unread items from the past 30 days or so. You could also do this with a secondary filter or other criteria in Views.