MyBB Community Forums

Full Version: how to Subscribe all members to topics when they post a reply
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
how to Subscribe all members to topics when they post a reply auto and force all members to follow the topics they post replis so the my alert plugin give them alerts for new other replis
and change the default Subscribe mode for all old and new members
thank you in advance
try this one.

(2011-10-18, 04:01 AM)Dylan M. Wrote: [ -> ]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.
step 3 not found in my theme i use flow theme
also my hosting service have some problems at cpanle i cannot acces
aint any thing from settings for now till the cpanle is fixed and thanks a lot for the help
no problem i just did it
i hope it works as i wish
thanks again
looks great i have installed it
i have one seggustion if you would like to hear since i think its the plugin is under your name so you create it right ?
add some settings in admin pannel to control how to make things work easyer Smile and find a way to solve the manual template Editing
thank you so much
sorry if my suggestion is bad
What settings would you require?

Also, I wish I could make the template change automatic, the issue is there's nothing I can use for the find/replace to make the template change with the plugin Sad
sorry i do not reply as soon as possible
if someone started a topic and i post a reply
each next reply of this topic alret me in my alert plugin
this is all Smile