2

I'm in the process of setting up a new member based site. I'm avoiding the Forum module as the templating system is difficult at best to style and many of the functions are overkill for our requirements.

I've found many add-ons that help with PM, user settings, SAEF WYSIWYG, nice dates etc but the one thing I haven't found is just how to show each user the new entries AND new comments since their last visit.

Spitting out a list of entries by last-comment date and by entry-date is fine but I'm really trying to highlight to each user, new info (comments or entries) since their last visit - think of it as "un-read".

Does anyone have any ideas or have done something similar have any pointers on how I can go about achieving this?

3

Since Last Visit

"Attempts to point out various actions that have happened since a visitor's last visit to your site." http://devot-ee.com/add-ons/since-last-visit

Otherwise you'd need to roll your own plugin that taps into the Session Class: http://ellislab.com/expressionengine/user-guide/development/usage/session.html Specifically looking at this variable: last_visit and then returning it to the template. You could then use it to display channel:entries by utilising the "start_on" parameter.

Alas Comment tag outputs aren't as powerful :( the best I could find is using the exp:comment:entries tag: http://ellislab.com/expressionengine/user-guide/modules/comment/#displaying-recent-comments

An alternative would be again to create your own plugin that output a list of entry_id's or comment_id's (separated by |).

1

You question isn't much clear to me but I think you should read this article http://www.sidd3.com/calculating-member-since-time-in-expressionengine/.

Which can give a little pointer how to get last visit via SQL. I hope, it would help. Please share your further finding over it.

0

I ended up tapping into Solspace Favorites (was already using it for actual favourites). I then created a new module/extension that tapped into Solspace Favorites hooks and DB – on either a new entry/comment the module/extension would:

  1. Delete all entries in the Favorite collection where the entry_id = entry_id and the collection = 'read/unread' collection
  2. Create array of members active in the last X weeks
  3. Loop through active members array and add entries for the members into Favorites Collection = 'read/unread'

With that I can spit out a list of entries using normal exp:channel:entries tag and using the Solspace Favorites tags {exp:favorites:info collection="Read-Unread" entry_id="{entry_id}"}class="u-not-read"{/exp:favorites:info}see if any entry is 'Favorited' OR effectively 'unread'.

When a user visits an entry - there is a module tag that simply passes the entries ID to the module and it deletes the members entry from the Solspace Favorites table where entry_id, member_id and collection are all equal.

Thanks to the EE community, special thanks to @iain, @mjingo + @low

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.