Warning: The author of this contribution does not provide support for it anymore.

Notify topic starter on moderator action

(Updated) I made this compatible with prime trash bin mod - Notify topic starter on moderator action

(Updated) I made this compatible with prime trash bin mod

by PiperB » Wed Mar 15, 2017 1:04 am

I updated and changed the code below. I've made a very simple change that will now only show the notify check box and explanation option if it's for a file deletion and only if the user has permissions to permanently delete

....because why would you trust someone to notify your users if you don't trust them enough to permanently delete things? Anyhow, as it stands with my fix before this new update, the options were showing up to notify topic author of deletion on un-delete and user post delete confirmation pages and well, that's not what this mod is for.

If you have already previously installed the version I had here before, then the change will be very simple if you just example the replacement code, you will see that I just moved the "<!-- ENDIF -->" to include the code added from this mod so that it hides the options if a user does not have permissions to permanently delete and also if they are not deleting unlike before as I previously stated.

I made this compatible with prime trash bin mod, I know some of you may still be wanting this.

Make all of the usual file edits that you normally would, if you haven't already that is, and if you have, leave them alone unless you want to mod subsilver2 which I created edits for and that is found here.
https://www.phpbb.com/customise/db/mod/ ... pic/174386

Now, on to the prime trash bin compatibility with this.

//Prosilver edits begin
Open: styles/prosilver/template/prime_delete_confirm.html

Find:

Code: Select all

				<!-- IF S_CAN_DELETE_FOREVER --><dd><label for="delete_forever"><input type="checkbox" name="delete_forever" id="delete_forever" onclick="delete_forever_changed(this)" />{L_PRIME_DELETE_FOREVER}</label></dd><!-- ENDIF -->
</dl>
Replace with:

Code: Select all

				<!-- IF S_CAN_DELETE_FOREVER --><dd><label for="delete_forever"><input type="checkbox" name="delete_forever" id="delete_forever" onclick="delete_forever_changed(this)" />{L_PRIME_DELETE_FOREVER}</label></dd>
				<dd><br /><br /><input type="checkbox" name="nts_delete" id="nts_delete" checked="checked" />{L_DELETE_TOPIC_NOTIFY}</dd>
			</dl>
			<dl>
		<dd><br /><label for="nts_delete_reason" class="gen">{L_DELETE_REASON_PD}</label></dd>
	       </dl>
		   	<dl>
		<dd><label for="nts_delete_reason"><textarea name="nts_delete_reason" id="nts_delete_reason" class="inputbox" cols="40" rows="3"></textarea></label><br /><br /><span>{L_DELETE_EXPLAIN_NOTIFY}</span></dd>
	        </dl>
			   <!-- ENDIF -->
Save the file.
//End prosilver edit

//Subsilver2 edits begin
Open: styles/subsilver2/template/prime_delete_confirm.html

Find:

Code: Select all

						<!-- IF S_CAN_DELETE_FOREVER --><tr><td align="center"><label for="delete_forever"><input type="checkbox" class="radio" name="delete_forever" id="delete_forever" onclick="delete_forever_changed(this)" /><span class="gen">{L_PRIME_DELETE_FOREVER}</span></label></td></tr><!-- ENDIF --><br /><br />
Replace with:

Code: Select all

						<!-- IF S_CAN_DELETE_FOREVER --><tr><td align="center"><label for="delete_forever"><input type="checkbox" class="radio" name="delete_forever" id="delete_forever" onclick="delete_forever_changed(this)" /><span class="gen">{L_PRIME_DELETE_FOREVER}</span></label></td></tr><br /><br />
						<tr><td align="center"><input type="checkbox" class="radio" name="nts_delete" id="nts_delete" checked="checked" /><span class="gen">{L_DELETE_TOPIC_NOTIFY}</span></td></tr>
						
						<tr>
		<td align="center"><br /><label for="nts_delete_reason" class="gen">{L_DELETE_REASON_PD}</label></td>
	</tr>
	<tr>
		<td align="center"><label for="nts_delete_reason"><textarea name="nts_delete_reason" id="nts_delete_reason" class="inputbox" cols="40" rows="3"></textarea></label><br /><br /><span>{L_DELETE_EXPLAIN_NOTIFY}</span></td>
	</tr><!-- ENDIF -->
Save the file changes.
//End Subsilver2 edits.


I made some language changes in my subsilver2 edits linked above, but those are optional so if you want to add them you just go over to the other topic linked above and make the changes.

//For the rest of the language edits that go with making this compatible with prime trash bin mod continue here.

Open: language/en/mcp.php

Find:

Code: Select all

	'DELETE_REASON'				=> 'Reason for deleting this topic',
Add after: (on a new blank line. | Note: PD is short for prime delete)

Code: Select all

	'DELETE_REASON_PD'			=> 'Reason to topic starter for deleting this topic',
Save the file changes.

Open: language/en/mods/prime_trash_bin_b.php

Find:

Code: Select all

	'PRIME_DELETE_TOPIC_REASON'			=> 'Please enter a reason for the deletion',
Add after: (on a new blank line)

Code: Select all

	'PRIME_DELETE_TOPIC_REASON_EXPLAIN'	=> '(This reason is only for the admin log)',
Save the file.

That is it, no additional files are included. It works like a charm.

Here is a screen shot of delete being pressed on the topic page either from the delete button or the quick mod tools, same result. Both work through the prime trash bin mod (prime_delete_confirm.html) for this with my file edits.
1.png

When you delete files to the trash bin and then permanently delete as before, that is when it's using the notify topic starter mod file mcp_delete_topic.html, and when you do the delete from the topic page it is using the prime_delete_confirm.html with the newly created edits for this mod here.

This is how it looks after being sent to the trash bin and then choosing to permanently delete it. Using the mods original file with my newly created subsilver2 edits. (mcp_delete_topic.htm)
2.png

The photos I posted here were screen shots of X-treme purple, a subsilver2 based style that some people find difficult to work with, lol.

Anyhow Enjoy all of you out there still hanging on to the mods! :)

Edit:

Prosilver
5.png
5.png (11.29 KiB) Viewed 74 times
Subsilver2
4.png
Note: click the images to see full size.
<!-- IF U_LOVE_NOTEPAD++ -->
[td class=statement]I Notepad++ ![/td]
<!-- ENDNEVER --> <!-- tee hee --> :P
Whoa ooo whoa ooo whoa I'm a Lady!
User avatar
PiperB
Registered User
Posts: 173
Joined: Mon Nov 07, 2016 6:54 pm
Contact:

Re: (Updated) I made this compatible with prime trash bin mo

by PiperB » Mon Jul 31, 2017 6:01 pm

If you want to hide the notify options on the deleting of posts when using the edit/delete post checkbox, or the delete button in viewtopic and have it only show if the first post/ actual topic is being deleted then follow along.

Note: You will need to have done the compatibility edits above already for these below finds to show up when searching for them. LOL

Open: /includes/prime_trash_bin_b.php
Find:

Code: Select all

		trigger_error('USER_CANNOT_DELETE');
	}
Add After: (On a new blank line)

Code: Select all

//Begin We hide the notify option if it's not the first post of the topic, no need to notify the topic starter of deleted posts of others.
if ($mode == 'quickmod' || $mode == 'topic_view' || ($mode == 'delete' && $post_data['topic_first_post_id'] == $post_data['post_id']))
{
	$template->assign_var('S_TOPIC_FIRST', true);
}
//End Hide notify if not topic start.
Save the file.

//Prosilver edits
Open: /styles/prosilver/template/prime_delete_comfirm.html

Find:

Code: Select all

				<dd><br /><br /><input type="checkbox" name="nts_delete" id="nts_delete" checked="checked" />{L_DELETE_TOPIC_NOTIFY}</dd>
			</dl>
			<dl>
		<dd><br /><label for="nts_delete_reason" class="gen">{L_DELETE_REASON_PD}</label></dd>
	       </dl>
		   	<dl>
		<dd><label for="nts_delete_reason"><textarea name="nts_delete_reason" id="nts_delete_reason" class="inputbox" cols="40" rows="3"></textarea></label><br /><br /><span>{L_DELETE_EXPLAIN_NOTIFY}</span></dd>
	        </dl>
			   <!-- ENDIF -->
Replace with:

Code: Select all

	<!-- IF S_TOPIC_FIRST --><dd><br /><br /><input type="checkbox" name="nts_delete" id="nts_delete" checked="checked" />{L_DELETE_TOPIC_NOTIFY}</dd>
			</dl>
			<dl>
		<dd><br /><label for="nts_delete_reason" class="gen">{L_DELETE_REASON_PD}</label></dd>
	       </dl>
		   	<dl>
		<dd><label for="nts_delete_reason"><textarea name="nts_delete_reason" id="nts_delete_reason" class="inputbox" cols="40" rows="3"></textarea></label><br /><br /><span>{L_DELETE_EXPLAIN_NOTIFY}</span></dd>
	        </dl>
			   <!-- ENDIF --><!-- ENDIF -->
Save the file.

//Subsilver2 edits
Open: /styles/Subsilver2/template/prime_delete_comfirm.html

Find:

Code: Select all

				             <tr><td align="center"><input type="checkbox" class="radio" name="nts_delete" id="nts_delete" checked="checked" /><span class="gen">{L_DELETE_TOPIC_NOTIFY}</span></td></tr>
						
						<tr>
		<td align="center"><br /><label for="nts_delete_reason" class="gen">{L_DELETE_REASON_PD}</label></td>
	</tr>
	<tr>
		<td align="center"><label for="nts_delete_reason"><textarea name="nts_delete_reason" id="nts_delete_reason" class="inputbox" cols="40" rows="3"></textarea></label><br /><br /><span>{L_DELETE_EXPLAIN_NOTIFY}</span></td>
	</tr><!-- ENDIF -->
Replace with:

Code: Select all

				<!-- IF S_TOPIC_FIRST --><tr><td align="center"><input type="checkbox" class="radio" name="nts_delete" id="nts_delete" checked="checked" /><span class="gen">{L_DELETE_TOPIC_NOTIFY}</span></td></tr>
						
						<tr>
		<td align="center"><br /><label for="nts_delete_reason" class="gen">{L_DELETE_REASON_PD}</label></td>
	</tr>
	<tr>
		<td align="center"><label for="nts_delete_reason"><textarea name="nts_delete_reason" id="nts_delete_reason" class="inputbox" cols="40" rows="3"></textarea></label><br /><br /><span>{L_DELETE_EXPLAIN_NOTIFY}</span></td>
	</tr><!-- ENDIF --><!-- ENDIF -->
Save the file.

Clear your cache and refresh your templates.

Enjoy! ;)

Now your notification options will only show up for deleting of topics, instead of both topics and posts and again this only hides it when using the delete checkbox while editing a post, or when you click the button to delete a post instead of a topic.
<!-- IF U_LOVE_NOTEPAD++ -->
[td class=statement]I Notepad++ ![/td]
<!-- ENDNEVER --> <!-- tee hee --> :P
Whoa ooo whoa ooo whoa I'm a Lady!
User avatar
PiperB
Registered User
Posts: 173
Joined: Mon Nov 07, 2016 6:54 pm
Contact: