Skip to:
Content

bbPress.org

Opened 10 years ago

Closed 9 years ago

Last modified 9 years ago

#2299 closed task (blessed) (fixed)

Forum topic notifications

Reported by: blg002's profile blg002 Owned by: mordauk's profile mordauk
Milestone: 2.5 Priority: high
Severity: normal Version: 2.2.3
Component: API - Subscriptions Keywords: early
Cc: stephen@…, gawain.lynch@…, pippin@…, info@…, jmdodd@…

Description

Similarly to how you can subscribe to specific forum *topics*. I would like to offer my users the ability to subscribe to entire *forums* i.e. be notified whenever a new topic is posted in a specific forum.

Attachments (6)

Screen Shot 2013-04-17 at 11.41.55 PM.png (40.9 KB) - added by mordauk 10 years ago.
forum-subscriptions.patch (24.6 KB) - added by mordauk 10 years ago.
forum-subscriptions2.diff (45.1 KB) - added by mordauk 10 years ago.
forum-subscriptions.diff (57.2 KB) - added by netweb 9 years ago.
forum-subscriptions.2.diff (57.3 KB) - added by mordauk 9 years ago.
forum-subscriptions.3.diff (70.4 KB) - added by netweb 9 years ago.

Download all attachments as: .zip

Change History (38)

#1 @netweb
10 years ago

  • Cc stephen@… added
  • Component changed from General to Subscriptions
  • Version changed from 2.2 to 2.2.3

#2 @gawain
10 years ago

  • Cc gawain.lynch@… added

#3 @johnjamesjacoby
10 years ago

  • Milestone changed from Awaiting Review to Future Release

There's a plugin for this out there. Might be value in having this in core, so moving to future release incase anyone wants to pick it up and write it as a feature.

#4 @mordauk
10 years ago

  • Cc pippin@… added

I'd love to see this make it in and would be willing to start on a patch.

Some details to think about when a user subscribes to an entire forum:

  • Do the Subscribe links show on individual topics?
  • Do all topics in the forum show unsubscribe links allow for individual topics to be excluded?

#5 @mordauk
10 years ago

Ignore those two questions above, I was thinking forum subscriptions would include new replies in forum topics, but now I realize it should probably just be for new topics.

#6 @mordauk
10 years ago

Where do we think the Subscribe / Unsubscribe link should go for Forums? The first place I thought of was next to the Topic column, as shown in the attached screenshot, though I'm not sure it makes sense.

#7 @mordauk
10 years ago

[forum-subscriptions.patch](http://bbpress.trac.wordpress.org/attachment/ticket/2299/forum-subscriptions.patch) is a mostly working patch.

Notes:

  • JS hasn't been patched to update forum subscriptions with ajax.
  • bbp_is_user_subscribed() is a bit messy. I'd like to clean it up more and get rid of some of the nested ifs.
  • Improvements for backwards compatibility need to be made, since I modified some of the existing function names.
Version 0, edited 10 years ago by mordauk (next)

#8 @mordauk
10 years ago

The additional bbp_get_forum_subscribers() function may not be necessary since the existing bbp_get_subscribers() function could be used instead.

I renamed bbp_get_user_subscribed_topic_ids() to bbp_get_user_subscribed_ids() since it retrieves ID numbers for both topics and forums.

#9 @mordauk
10 years ago

How do we feel about renaming topic.js to forums.js (or bbpress.js) to be more general and allow the Forum subscription handler to be in the same file?

#10 @wdfee
10 years ago

  • Cc info@… added

#11 in reply to: ↑ description @quan_flo
10 years ago

Replying to blg002:

Similarly to how you can subscribe to specific forum *topics*. I would like to offer my users the ability to subscribe to entire *forums* i.e. be notified whenever a new topic is posted in a specific forum.

+1 for this feature request (notify about new topics (not replies) in a subscribed forum.
would be happy to see this feature in bbpress

#12 @jmdodd
10 years ago

  • Cc jmdodd@… added

#13 @mordauk
10 years ago

New patch completely reworked.

#14 @mordauk
10 years ago

  • Milestone changed from Future Release to 2.5
  • Owner set to mordauk

#15 @johnjamesjacoby
9 years ago

  • Keywords early added
  • Priority changed from normal to high
  • Type changed from enhancement to task

#16 follow-ups: @mordauk
9 years ago

Anyone feel like testing out http://bbpress.trac.wordpress.org/attachment/ticket/2299/forum-subscriptions2.diff and providing some feedback?

#17 in reply to: ↑ 16 @quan_flo
9 years ago

Replying to mordauk:

Anyone feel like testing out http://bbpress.trac.wordpress.org/attachment/ticket/2299/forum-subscriptions2.diff and providing some feedback?

If this works, will it be part of 2.5 or 2.4.x?

#18 @mordauk
9 years ago

It is planned for 2.5.

#19 in reply to: ↑ 16 @johnjamesjacoby
9 years ago

Replying to mordauk:

Anyone feel like testing out http://bbpress.trac.wordpress.org/attachment/ticket/2299/forum-subscriptions2.diff and providing some feedback?

I will tomorrow evening.

#20 follow-up: @netweb
9 years ago

Nice work, I had a look around and play on the weekend and works really well.

I think we just need to decide on what to do with bbPress' .js files

Option 1: Two javascript files bbpress.js and minified bbpress.min.js

  • Merge topic.js into \bbPress\templates\default\js\bbpress.js
  • Merge reply.js into \bbPress\templates\default\js\bbpress.js
  • Include the forum js requirements of this patch

Option 2: Six javascript files and minified versions

  • \bbPress\templates\default\js\forum.js forum.min.js
  • \bbPress\templates\default\js\topic.js topic.min.js
  • \bbPress\templates\default\js\reply.js reply.min.js

#21 @johnjamesjacoby
9 years ago

I'm fine with having two JS files as long as the non-mini is documented thoroughly. This way we can just always enqueue it, and skip the juggling of maybe-its-JS, maybe-it's-broken when using things like shortcodes.

Last edited 9 years ago by johnjamesjacoby (previous) (diff)

#22 @netweb
9 years ago

Updated patch incoming...

#23 @netweb
9 years ago

Latest patch forum-subscriptions.diff​ based on forum-subscriptions2.diff

  • PHPDoc updates
  • Standardized order of functions, 'Forums' before 'Topics'
  • includes/users/functions.php NOT updated (Will do this tomorrow)
  • .js files remain as they were in previous patch (i.e. not merged into bbpress.js)

@ToDo

  • Add additional changes per includes/core/actions.php#227 (including repair tools to 'Remove trashed forums from user subscriptions')
  • Update the includes/users/functions.php patch (Primarily clearer PHPDoc's)
  • Audit function name changes and function naming consistency, examples:
    • bbp_notify_subscribers -> bbp_notify_topic_subscribers / bbp_notify_forum_subscribers
    • bbp_pre_notify_subscribers -> bbp_pre_notify_topic_subscribers / bbp_pre_notify_forum_subscribers
    • bbp_subscription_mail_headers -> bbp_topic_subscription_mail_headers / bbp_forum_subscription_mail_headers
    • _bbp_subscriptions -> _bbp_topic_subscriptions / _bbp_forum_subscriptions
    • bbp_is_user_subscribed -> bbp_is_user_subscribed_to_topic / bbp_is_user_subscribed_to_forum
  • Check subscriptions though forum hierarchy (eg. If you subscribe to a category are you subscribed to all child forums, if not add support for this or remove to ability to subscribe to categories and/or forum parents)

#24 in reply to: ↑ 20 @mordauk
9 years ago

Replying to netweb:

Nice work, I had a look around and play on the weekend and works really well.

I think we just need to decide on what to do with bbPress' .js files

Option 1: Two javascript files bbpress.js and minified bbpress.min.js

  • Merge topic.js into \bbPress\templates\default\js\bbpress.js
  • Merge reply.js into \bbPress\templates\default\js\bbpress.js
  • Include the forum js requirements of this patch

Option 2: Six javascript files and minified versions

  • \bbPress\templates\default\js\forum.js forum.min.js
  • \bbPress\templates\default\js\topic.js topic.min.js
  • \bbPress\templates\default\js\reply.js reply.min.js

I'd prefer having just the two (bbpress.js and bbpress.min.js).

#25 follow-up: @mordauk
9 years ago

forum-subscriptions.2.diff is an updated version with better standardization of includes/users/functions.php

#27 in reply to: ↑ 25 @netweb
9 years ago

In forum-subscriptions.3.diff

  • PHPDoc fixes includes/users/functions.php
  • Added 'Repair Tool' Remove trashed forums from user subscriptions bbp_admin_repair_user_forum_subscriptions to includes/admin/tools.php

#28 @johnjamesjacoby
9 years ago

In 5156:

Forum Subscriptions - Allow users to subscribe to new topics in specific forums.

  • Code largely lifted from existing Topics Subscriptions, and is based largely on forum-subscriptions.2.diff from mordauk, with edits for code consistency across bbPress components.
  • Refactor existing ambiguous function names into base functions for both forum and topic subscriptions.
  • Include new functions for getting and outputting subscriptions.
  • Modify user-subscriptions.php to show subscribed forums. This includes a modification to content-single-forum.php to include the "Unsubscribe" link if looking at a user profile page.
  • Modify templates/default/bbpress-functions.php to enqueue new JS file to handle forum subscription ajax.
  • Rename HTML element classes from bbp-topic-action to bbp-row-actions to better accommodate forum subscriptions (and any future actions.)
  • BuddyPress tested, JJJ approved.
  • See #2299. Props mordauk, netweb for the considerable effort.
  • More to do here, largely from forum-subscriptions.3.diff

#29 @johnjamesjacoby
9 years ago

In 5157:

Forum Subscriptions:

  • Update @since and @deprecated to r5156.
  • Introduce tool for removing trashed and deleted forums from user subscriptions.
  • See #2299. Props netweb.

#30 @johnjamesjacoby
9 years ago

  • Resolution set to fixed
  • Status changed from new to closed

Forum subscriptions are in. Going to mark this as fixed. New bug; new ticket please.

Thanks everyone! Awesome work.

#31 @mordauk
9 years ago

Heck yeah!

#32 @netweb
9 years ago

In 5159:

Fix copy pasta in user profile subscriptions template. See #2299

Note: See TracTickets for help on using tickets.