MyBB Community Forums

Full Version: Automatic Subscriptions for all members - The Short Version
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3
If you want all your users to be subscribed to every thread and forum, this is for you.
This tutorial makes the most minor edits. There are better ways to do this, however they require you to remove and replace code in the templates instead of putting in a few very minor additions.

Step 1: Eliminate the user's ability to change their subscription mode
In User Control Panel Templates->usercp_options
Change:
<tr>
<td colspan="2"><span class="smalltext"><label for="subscriptionmethod">{$lang->subscription_method}</label></span></td>
</tr>
<tr>
<td colspan="2">
	<select name="subscriptionmethod" id="subscriptionmethod">
		<option value="0" {$no_subscribe_selected}>{$lang->no_auto_subscribe}</option>
		<option value="1" {$no_email_subscribe_selected}>{$lang->no_email_subscribe}</option>
		<option value="2" {$instant_email_subscribe_selected}>{$lang->instant_email_subscribe}</option>
	</select>
</td>
</tr>

To:
<tr style="display:none">
<td colspan="2"><span class="smalltext"><label for="subscriptionmethod">{$lang->subscription_method}</label></span></td>
</tr>
<tr style="display:none">
<td colspan="2">
	<select name="subscriptionmethod" id="subscriptionmethod">
		<option value="0" {$no_subscribe_selected}>{$lang->no_auto_subscribe}</option>
		<option value="1" {$no_email_subscribe_selected}>{$lang->no_email_subscribe}</option>
		<option value="2" {$instant_email_subscribe_selected}>{$lang->instant_email_subscribe}</option>
	</select>
</td>
</tr>

Which simply inserts
style="display:none"
for both <tr> tags that house the thread subscriptions code.

Step 2: Set it up so that new members are created with default subscription mode of your choice.
In Member Templates->member_register
Change:
<tr>
<td colspan="2"><span class="smalltext"><label for="subscriptionmethod">{$lang->subscription_method}</label></span></td>
</tr>
<tr>
<td colspan="2">
	<select name="subscriptionmethod" id="subscriptionmethod">
		<option value="0" {$no_subscribe_selected}>{$lang->no_auto_subscribe}</option>
		<option value="1" {$no_email_subscribe_selected}>{$lang->no_email_subscribe}</option>
		<option value="2" {$instant_email_subscribe_selected}>{$lang->instant_email_subscribe}</option>
	</select>
</td>
</tr>

To:
<tr style="display:none">
<td colspan="2"><span class="smalltext"><label for="subscriptionmethod">{$lang->subscription_method}</label></span></td>
</tr>
<tr style="display:none">
<td colspan="2">
	<select name="subscriptionmethod" id="subscriptionmethod">
		<option value="0">{$lang->no_auto_subscribe}</option>
		<option value="1">{$lang->no_email_subscribe}</option>
		<option value="2" selected="selected">{$lang->instant_email_subscribe}</option>
	</select>
</td>
</tr>

Which is the exact same edit as above. Now however you need to choose which of the subscription methods you want to use. I've put the default to "Instant Email" in the above example.

Step 3: Make it so they cannot unsubscribe on a per-thread basis
In Show Thread Templates->showthread
Change:
<li class="subscription_{$add_remove_subscription}"><a href="usercp2.php?action={$add_remove_subscription}subscription&amp;tid={$tid}&amp;my_post_key={$mybb->post_code}">{$add_remove_subscription_text}</a></li>

To:
<li class="subscription_{$add_remove_subscription}" style="display:none"><a href="usercp2.php?action={$add_remove_subscription}subscription&amp;tid={$tid}&amp;my_post_key={$mybb->post_code}">{$add_remove_subscription_text}</a></li>

Which, once again simply addes the style="display:none", this time however it is to the li tag.

Step 4: SQL Query to affect all current users
For all users, including your initial Admin account:
UPDATE mybb_users SET subscriptionmethod = '2' WHERE subscriptionmethod != '2';
For all users except the initial Admin account:
UPDATE mybb_users SET subscriptionmethod = '2' WHERE uid != 1 AND subscriptionmethod != '2';

In Summary
This is the simplest way to do it. A more proper way would be to replace the various selects with a simple:
<input type="hidden"....
bit of code for the subscription method. However, as stated above, that is a much larger change to each template.

Please keep your comments relevant. Please let me know if you think anything is missing from this tutorial.
Thanks!
while a good tutorial, please be conscious of your users wishes before doing this. i dont think most folks want to be autosubscribed to everything. if i want it, i will subscribe. dont waste my bandwidth and email box quota with mails i dont want. why should i have to deselect the subscribe option for every post i make
(2011-10-23, 08:00 PM)pavemen Wrote: [ -> ]while a good tutorial, please be conscious of your users wishes before doing this. i dont think most folks want to be autosubscribed to everything. if i want it, i will subscribe. dont waste my bandwidth and email box quota with mails i dont want. why should i have to deselect the subscribe option for every post i make

Actually this removes the option for that as well Wink

I had a specific request for this from a closed membership board that requires every member to be subscribed to every thread, otherwise I would never have made it. You definitely have some good points about not wanting it, I would immediately change my email address to a throw away one on such a forum, and cease active membership.
Does this mod do all this:

http://mods.mybb.com/view/automatic-subscriptions

Or is it something different? Their wording is confusing me. They make me feel like ALL users will get emails about ALL new threads or something? Or do they mean any new thread they start or reply to will get emails (subscribed).

Please help Smile
It seems like they do the exact same thing, however the plugin gives it as a user configurable option and this does not.
I want to make sure that all users are automatically enrolled in the forum (see photo). and then delete the link above to each topic, as yuo can see in the photo.
I like this idea a lot, but I don't see where subscribes users to certain forums? I would like to sign users up for a couple "main" forums where they get notified by email. Can this be done easily?

Thanks,
Brian
(2013-06-08, 03:54 AM)kramsman Wrote: [ -> ]I like this idea a lot, but I don't see where subscribes users to certain forums? I would like to sign users up for a couple "main" forums where they get notified by email. Can this be done easily?

Thanks,
Brian

Not with this mod. This does it for every single forum and thread. Sorry.
In Step 2, when i place Display "None}, it stops showing any option for thread subscription. I do not see anything like Instant email notification during registration.
Pages: 1 2 3