Advertisement:

Author Topic: Edit Unread PMs  (Read 1608 times)

Offline dougiefresh

  • SMF Hero
  • ******
  • Posts: 2,671
  • Mod King
    • XPtsp.com Community
Edit Unread PMs
« on: March 12, 2017, 06:46:19 AM »
Link to Mod


EDIT UNREAD PMs v1.4
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 has been removed and can be seen at XPtsp.com.

License
Quote
Copyright (c) 2017, 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.
News: Missing GitHub repository...

My Free Simple Machines mods on XPtsp.com, Simple Machines Customization Site, and at GitHub!
Problem uninstalling mods?  Try Arantor's Sortable Packages (and Installed Time) mod!  It's super helpful!

Offline dougiefresh

  • SMF Hero
  • ******
  • Posts: 2,671
  • Mod King
    • XPtsp.com Community
Re: Edit Unread PMs
« Reply #1 on: March 13, 2017, 01:44:54 PM »
Uploaded v1.1 - March 13th, 2017
o Added support for SMF 2.1 Beta 2.
News: Missing GitHub repository...

My Free Simple Machines mods on XPtsp.com, Simple Machines Customization Site, and at GitHub!
Problem uninstalling mods?  Try Arantor's Sortable Packages (and Installed Time) mod!  It's super helpful!

Offline dougiefresh

  • SMF Hero
  • ******
  • Posts: 2,671
  • Mod King
    • XPtsp.com Community
Re: Edit Unread PMs
« Reply #2 on: March 28, 2017, 09:53:33 PM »
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.


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!
« Last Edit: March 28, 2017, 10:21:31 PM by dougiefresh »
News: Missing GitHub repository...

My Free Simple Machines mods on XPtsp.com, Simple Machines Customization Site, and at GitHub!
Problem uninstalling mods?  Try Arantor's Sortable Packages (and Installed Time) mod!  It's super helpful!

Offline dougiefresh

  • SMF Hero
  • ******
  • Posts: 2,671
  • Mod King
    • XPtsp.com Community
Re: Edit Unread PMs
« Reply #3 on: July 05, 2017, 10:28:42 PM »
Uploaded v1.3 - July 5th, 2017
o Added support for SMF 2.1 Beta 3.
o Removed support for SMF 2.1 Beta 2.
News: Missing GitHub repository...

My Free Simple Machines mods on XPtsp.com, Simple Machines Customization Site, and at GitHub!
Problem uninstalling mods?  Try Arantor's Sortable Packages (and Installed Time) mod!  It's super helpful!

Offline Geor'G

  • Semi-Newbie
  • *
  • Posts: 62
Re: Edit Unread PMs
« Reply #4 on: February 20, 2018, 01:34:18 PM »
The mod does not work correctly!
When you install the mod, the - $context['folder'] variable is reassigned:
Code: [Select]
$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:
Code: [Select]
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']:
Code: [Select]
$context['folder'] = !isset($_REQUEST['f']) || $_REQUEST['f'] != 'sent' ? 'inbox' : 'sent';
$context['folder'] = !isset($_GET['sa']) || $_GET['sa'] == 'edit' || $_GET['sa'] == 'edit' ? 'sent' : $context['folder'];


Offline Rock Lee

  • SMF Hero
  • ******
  • Posts: 1,490
  • Gender: Male
  • Digitalizando un nuevo mundo :D
    • BomberCode.Oficial on Facebook
    • RockLee-BC on GitHub
    • @Bomber_Code on Twitter
    • Bomber Code ~ La nueva era del conocimiento
Re: Edit Unread PMs
« Reply #5 on: February 20, 2018, 02:48:40 PM »
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 © 2018
Ayudas - Aportes - Tutoriales - Y mucho mas!!!

Offline dougiefresh

  • SMF Hero
  • ******
  • Posts: 2,671
  • Mod King
    • XPtsp.com Community
Re: Edit Unread PMs
« Reply #6 on: February 21, 2018, 10:08:28 AM »
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!
News: Missing GitHub repository...

My Free Simple Machines mods on XPtsp.com, Simple Machines Customization Site, and at GitHub!
Problem uninstalling mods?  Try Arantor's Sortable Packages (and Installed Time) mod!  It's super helpful!

Offline Geor'G

  • Semi-Newbie
  • *
  • Posts: 62
Re: Edit Unread PMs
« Reply #7 on: February 22, 2018, 03:45:03 PM »
@dougiefresh, thanks, now works.

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

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


Test:
Code: [Select]
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
Code: [Select]
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.
« Last Edit: February 22, 2018, 04:18:07 PM by Geor'G »