buddypress-group-email-subscription icon indicating copy to clipboard operation
buddypress-group-email-subscription copied to clipboard

bbPress: follow/mute single topic

Open wdfee opened this issue 11 years ago • 9 comments

With bbPress 2.3 the Group Email Subscirption works for each forum, but not for each topic yet. I took a look into the function ass_topic_follow_or_mute_link(), here is only line 1077 referring to the retired BP group forums. I'd suggest to change it this way: if(function_exists('bbp_get_topic_id')) $topic_id = bbp_get_topic_id(); else $topic_id = bp_get_the_topic_id(); Sure it has to be hooked into bbPress, too. I did it for now directly in my own theme. Klicking the Link now shows "Error" as linktext, but reloading the page shows that it worked. I'm not sure, why it returns error. Script debugging with firebug shows me that the response is "\nmute" instead of "mute". But before the data "stheid[0]" is "mute". After deactivating and reactivating other plugins it's even worse: response = "\n\nmute". No idea why, I put this twice now in the js: response = response.replace("\n", "");

wdfee avatar Apr 21 '13 14:04 wdfee

Hi fee,

Thanks for the report. We ran out of time to include bbPress 2's feature into the plugin.

If you are able to send a pull request in Github, a patch or some code other than the topic ID referenced above, we can review and see if it's possible to include in the plugin. We have to be wary of people who are still using the older BP bundled forums, so we can't just make changes without thinking of them as well.

r-a-y avatar Apr 27 '13 17:04 r-a-y

Hi ray,

getting more into github is on my todo list, need some time, too. The idea of using the topic id was that the function bbp_get_topic_id() only exists if you use bbPress 2.* (maybe I'm wrong here), otherwise the fallback is bp_get_the_topic_id(), that only exists if you use legacy group forums.

Today I recognized something more that won't work with bbPress 2.3: weekly digests. in bp-activity-subscription-digest.php on line 362 function bp_forums_get_topic_posts() is no more available.

wdfee avatar May 14 '13 07:05 wdfee

Just to update this issue, bbPress 2 has its own "Subscribe" option, which I temporarily disabled in BP groups back in commit 35883df94930974bb3c678f923e97b90a01aad63.

After having a chance to reflect on this, I have reinstated this option for those group members not subscribed to the "All Mail" option in commit 6ef4a3a70848a57ae3a104d3cafd8401b5ed80e5.

This basically emulates the "Follow" option from the old BP legacy forums.

To test this out, pull the latest changes. Then, visit a group and make sure you are not subscribed to the "All Mail" option. Next, click on any BP group forum topic and beside the "Favorite" link, you should now see the "Subscribe" link again.

The caveat here is this is only applicable to those not subscribed to "All Mail", but I think this should be enough to address this issue.

r-a-y avatar Jun 28 '13 02:06 r-a-y

Hi ray, testing your changes: This leads to an Fatal error: Call to undefined function bp_get_the_topic_id() in /[...]/buddypress-group-email-subscription/bp-activity-subscription-functions.php on line 1135. Using my code from above works together with your changes. (sorry for still not getting the pull requests working...).

wdfee avatar Jun 28 '13 11:06 wdfee

Thanks for checking, fee.

What forums are you using? Legacy or bbPress? And what page do you receive this error on?

I'm not sure how you would receive this error unless you are using the do_action( 'bp_before_group_forum_topic_posts' ) hook in a custom bbPress template.

r-a-y avatar Jun 28 '13 17:06 r-a-y

Hi ray, sorry for the confusion, I'm using bbPress 2.3 - I forgot to remove my manually added ass_topic_follow_or_mute_link() in my bbPress template. Ok, so far it's working now (didn't test the digest mails yet).

wdfee avatar Jun 28 '13 20:06 wdfee

updating this issue: now with bbPress 2.5, the bbPress forums have a build-in notifications function, not only for replies if subscribed but also for new topics if subscribed to complete forum. So, the forum notifications are not needed anymore with bbPress 2.5, and no follow/mute link, too. So I think it would be best to remove the disabling with 'All Mail' option, too. And instead remove all forum notification functions if bbPress 2.5 is used. Maybe using function bbp_get_version()?

wdfee avatar Nov 25 '13 20:11 wdfee

Thanks for the update, @wdfee.

I don't want to remove the "All Mail" option because this has other uses other than forum posts. We could probably disable GES' "All Mail" sendout if the item is a bbPress forum post and if the user is subscribed to the bbPress forum. We could probably remove the "New Topics" option from GES.

This does complicate things from a UI perspective though because if you want to subscribe to the bbPress forum, you have to go straight to the group forum page, whereas GES allows you to subscribe on any group page.

Needs some additional thought.

r-a-y avatar Nov 25 '13 21:11 r-a-y

Hi ray, oh I didn't meant to remove the 'All Mail' option, but to remove the disabling of the bbPress functions with it. When 'All Mail' is checked, the subscribe links are off.

wdfee avatar Nov 25 '13 21:11 wdfee