Edit Unread PMs

Started by dougiefresh, March 12, 2017, 06:46:19 AM

Previous topic - Next topic

dougiefresh

Link to Mod



EDIT UNREAD PMs v1.7
By Dougiefresh -> Link to Mod



Introduction
This mod allows permitted membergroups to edit and unsend personal messages, as long as nobody has read them.

This mod has been tested with the PM Attachments mod, and does support adding and removing PM attachments while editing the PM.

Admin Settings
In Admin => Members => Permissions, there are two new permissions:
o Can Edit Unread PMs
o Can Unsend Unread PMs

Legacy Disclaimer
This mod was part of the now-discontinued Enhanced PM System.  It is been seperated from it and built into a newer, hopefully better mod...

This updated mod makes additional checks to make sure nobody has read the PM before you are allowed to edit or unsend it.

Compatibility Notes
This mod was tested on SMF 2.0.13, but should work on SMF 2.1 Beta 3, as well as SMF 2.0 and up.  SMF 1.x is not and will not be supported.

This mod should be installed AFTER the PM Attachments mod!

Related Discussions
o Outbox with editable PMs
o Unsend PM
o Private Message Email Notification

Translators
o Spanish Latin: Rock Lee

Changelog
The changelog can be viewed at XPtsp.com.

License
Copyright (c) 2017 - 2019, Douglas Orend
All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.

2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

dougiefresh

Uploaded v1.1 - March 13th, 2017
o Added support for SMF 2.1 Beta 2.

dougiefresh

#2
Uploaded v1.2 - March 28th, 2017
o Added support for the core theme in SMF 2.0.x.
o Fixed install errors by changing file extension on language_english_20x.txt to .xml.



Quote from: James Gryphon on March 28, 2017, 07:52:59 PM
Edit Unread also chokes when attempting to install after Search (I haven't seen whether it installs with Separate). It also gives me a "Modification parse error" when testing whether it can modify the language_english_20x.xml file.

Also, all of them pretty universally report a multitude of errors with the Core theme's template file.
This should resolve these bug reports concerning this mod.  Thank you for reporting them!

dougiefresh

Uploaded v1.3 - July 5th, 2017
o Added support for SMF 2.1 Beta 3.
o Removed support for SMF 2.1 Beta 2.

Geor'G

The mod does not work correctly!
When you install the mod, the - $context['folder'] variable is reassigned:
$context['folder'] = !isset($_REQUEST['f']) || $_REQUEST['f'] != 'sent' ? 'inbox' : 'sent';
$context['folder'] = !isset($_GET['sa']) || $_GET['sa'] == 'edit' || $_GET['sa'] == 'edit' ? 'sent' : $context['folder'];


This code here is superfluous:
Find: [Select]
$context['folder'] = !isset($_REQUEST['f']) || $_REQUEST['f'] != 'sent' ? 'inbox' : 'sent';
Add After: [Select]
$context['folder'] = !isset($_GET['sa']) || $_GET['sa'] == 'edit' || $_GET['sa'] == 'edit' ? 'sent' : $context['folder'];


RU:
Мод работает неправильно!
При установке мода, переназначается переменная - $context['folder']:
$context['folder'] = !isset($_REQUEST['f']) || $_REQUEST['f'] != 'sent' ? 'inbox' : 'sent';
$context['folder'] = !isset($_GET['sa']) || $_GET['sa'] == 'edit' || $_GET['sa'] == 'edit' ? 'sent' : $context['folder'];



-Rock Lee-

I'm not familiar with the branch 2.1 but I also did the translation into Latin Spanish ... and naturally the 2.0 branch is done.


Regards!
¡Regresando como cual Fenix! ~ Bomber Code
Ayudas - Aportes - Tutoriales - Y mucho mas!!!

dougiefresh

Uploaded v1.4 - February 20th, 2018
o Fixed issue where $context['folder'] was incorrectly reassigned.
o Moved all language files from xml files to php files for better readability.
o Added Spanish Latin translation, courtsey of Rock Lee.
o Added translator section to readme.txt.




@Geor'G:  I think I've fixed the bug report that you mentioned.

@Rock Lee:  I've included your translation in this version!  Thanks very much!

Geor'G

#7
@dougiefresh, thanks, now works.

In the email notification in the mail, comes the contents of the letter.

ru:
В письме с оповещением на почту, приходит содержание письма.


Test:
You have just been sent a personal message by test on My Community.

IMPORTANT: Remember, this is just a notification. Please do not reply to this email.

The message they sent you was:

;) ;) ;) ;) ;) ;) ;) ;) ;) ;) ;) ;) ;)


I think this code should be inserted into the MessagePost() function, into the file PersonalMessage.php.
ru:
Я думаю этот код, надо вставлять в функцию MessagePost(), файла PersonalMessage.php
loadLanguage('EditPMs');
$txt['pm_email'] = substr($txt['pm_email'], 0, strpos($txt['pm_email'], 'MESSAGE'));
$txt['pm_email'] = substr($txt['pm_email'], 0, strrpos($txt['pm_email'], '.'));



Russification.

dougiefresh

Uploaded v1.5 - October 12th, 2018
o No functionality change.
o Updated documentation to point to new website.




@Geor'G:  I apologize for replying so late to your message.  I will incorporate these changes as soon as I get my GitHub repositories uploaded.  If you want, you can create a fork and incorporate those changes yourself and submit a pull request in the meantime.....

dougiefresh

Uploaded v1.6 - October 18th, 2018
o Added Russian translation, courtsey of Geor'G!
o Fixed an issue where message was incorrectly sent when it shouldn't be.




@Geor'G:  Thank you for the suggested bug fix, as well as the Russian translation!  They've been included in this version!

dougiefresh

Uploaded v1.7 - June 19th, 2019
o Added support for SMF 2.1 RC2.
o Removed support for SMF 2.1 Beta 3.

efk

3 Questions:

#1
QuoteThis mod should be installed AFTER the PM Attachments mod!
I guess PM Attachments mod is not obligatory to install since I'm not thinking to install it?

#2
I know users are getting email notifications for new posts/topics, but are they getting emails with content from private messages?

#3
1. Execute Modification ./Sources/ManagePermissions.php Test successful
2. Execute Modification ./Sources/PersonalMessage.php Test successful
1. Add After ./Sources/PersonalMessage.php Test successful
2. Add Before ./Sources/PersonalMessage.php Test successful
3. Add After ./Sources/PersonalMessage.php Test successful
4. Replace ./Sources/PersonalMessage.php Test successful
5. Add After ./Sources/PersonalMessage.php Test successful
6. Add Before ./Sources/PersonalMessage.php Test successful
7. Replace ./Sources/PersonalMessage.php Test successful
8. Replace ./Sources/PersonalMessage.php Test successful
9. Add Before ./Sources/PersonalMessage.php Test successful
10. Add Before ./Sources/PersonalMessage.php Test successful
11. Add Before ./Sources/PersonalMessage.php Test successful
12. Add Before ./Sources/PersonalMessage.php Test successful
13. Replace ./Sources/PersonalMessage.php Test successful
14. Add After ./Sources/PersonalMessage.php Test successful
15. Add After ./Sources/PersonalMessage.php Test successful
16. Add Before ./Sources/PersonalMessage.php Test successful
    >>> 17. Add After ./Sources/PersonalMessage.php Test failed (Ignore Errors) <<<
    >>> 18. Add Before ./Sources/PersonalMessage.php Test failed (Ignore Errors) <<<
3. Execute Modification ./Sources/Subs-Post.php Test successful
4. Execute Modification ./Themes/core/PersonalMessage.template.php Test successful
5. Execute Modification ./Themes/default/PersonalMessage.template.php Test successful

Advertisement: