I created this patch in response to a site that was looking to have members only content, but still tease anonymous users with the recent activity of the site -- ie to show its an active site in the members section.

This patch creates a new setting under admin/settings/activity/settings that enables this feature. Messages shown to anonymous users are stripped of any links and then links are bolded.

If your site, allows anonymous to view some content then this setting should be disabled.

Patch is on the 6.x-2.x-dev head:
activity.admin.inc - 1.1.2.40
activity.module - 1.1.2.2.2.30.2.31.2.88
views/activity_views_handler_field_message.inc - 1.1.2.6

CommentFileSizeAuthor
#1 activity-anon-view-787442.patch3.06 KBrecrit

Comments

recrit’s picture

StatusFileSize
new3.06 KB

here's file

Scott Reynolds’s picture

Status: Needs review » Closed (works as designed)

Eek, I don't see any good reason to make this part of the module. I would suggest that you create a separate module that form alters the activity settings to put your setting there. And then to do a hook_views_data_alter() and switch out Activity's message handler with your own provided in the module.

This way you don't have to maintain a patch on your site and the upgrade path is easy and clean.

edit: I should also note that surfacing Activity that happens on private nodes to anon users, even with the anchor tags removed, is a security concern. And its probably not particularly fair to your users.

recrit’s picture

thanks for the feedback... definitely want to keep it easy and clean. My implementation was very narrow in scope for the messages (ie just titles showing), but I see how it could get out of hand since anything can go into the messages.