Simple Machines Community Forum

Customizing SMF => Modifications and Packages => Topic started by: dougiefresh on March 09, 2017, 09:44:20 AM

Title: Seperate Unread PMs
Post by: dougiefresh on March 09, 2017, 09:44:20 AM
Link to Mod (https://custom.simplemachines.org/mods/index.php?mod=4141)



SEPARATE UNREAD PMS v1.10
By Dougiefresh (http://www.simplemachines.org/community/index.php?action=profile;u=253913) -> Link to Mod (http://custom.simplemachines.org/mods/index.php?mod=4141)



Introduction
This mod separates all unread sent PMs from the "already read" sent PMs and places them in the new Outbox folder.

Admin Settings
There are no settings available for this mod.  To remove it, you must uninstall it.

Legacy Disclaimer
This mod was part of the now-discontinued Enhanced PM System (http://www.simplemachines.org/community/index.php?topic=521508.0).

Related Discussions
o PM outbox/sent like phpbb (http://www.simplemachines.org/community/index.php?topic=128571)
o Private Message Email Notification (http://www.simplemachines.org/community/index.php?topic=426840)

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

Translators
o Spanish Latin translation by Rock Lee (http://www.simplemachines.org/community/index.php?action=profile;u=322597)

Changelog
The changelog can be viewed at XPtsp.com (http://www.xptsp.com/board/free-modifications/separated-unread-pms/?tab=1).

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.
Title: Re: Seperate Unread PMs into Outbox folder
Post by: Shambles on March 09, 2017, 10:14:09 AM
I would have called it "SEPARATE UNREAD PMS" myself  ;)
Title: Re: Seperate Unread PMs
Post by: digger on March 10, 2017, 03:44:35 PM
Russian language files.
Title: Re: Seperate Unread PMs
Post by: digger on March 10, 2017, 06:23:06 PM
Sent Items and Outbox folders shows all messages as "from me". I do not see the recipients nicknames, it is very inconvenient.
Title: Re: Seperate Unread PMs
Post by: Steve on March 10, 2017, 07:52:23 PM
As Shambles not so subtlety hinted, 'separate' is misspelled in your mod title Dougie. :P
Title: Re: Seperate Unread PMs
Post by: dougiefresh on March 11, 2017, 06:56:27 AM
@digger:  I will look into the bug report.

@Shambles and @Steve:  Whoops, just now noticed that that is misspelled....  I'll fix it for the next version.  Thanks!
Title: Re: Separate Unread PMs
Post by: dougiefresh on March 11, 2017, 09:43:15 PM
Uploaded v1.1 - March 11th, 2017
o Added support for SMF 2.1 Beta 2.
o Fixed undefined error when using context variable without folder.
o Fixed issue where "To:" was shown in Inbox and "From:" for Sent and Outbox.
o Added Russian translation, courtsey of digger (http://www.simplemachines.org/community/index.php?action=profile;u=97557)!



Quote from: Shambles on March 09, 2017, 10:14:09 AM
I would have called it "SEPARATE UNREAD PMS" myself  ;)
Quote from: Steve on March 10, 2017, 07:52:23 PM
As Shambles not so subtlety hinted, 'separate' is misspelled in your mod title Dougie. :P
Thank for the misspelling notification, and sorry that I missed it  :P O:)

Quote from: digger on March 10, 2017, 06:23:06 PM
Sent Items and Outbox folders shows all messages as "from me". I do not see the recipients nicknames, it is very inconvenient.
This bug report has been fixed.  Sorry I missed that one!  Also thank you for the Russian translation!  It's been incorporated into the mod!
Title: Re: Separate Unread PMs
Post by: dougiefresh on March 13, 2017, 11:20:57 AM
Uploaded v1.2 - March 13th, 2017
o Fixed documentation issue within the readme.txt file.
o No other changes made to the mod.




I received this PM from someone, and I thought I should share the contents:
QuoteI think it said let you know. So, I installed your separated unread mod and I get the out box but all the PM's seem to go to the inbox anyway and not the outbox.

Unless I am mistaken, if I send you a pm, and eventually log in, all unread PM's should end up in the outbox??
My response to this question was this:
QuoteThe mod is intended to seperate out the unread outgoing PMs from the "already read" sent PMs.  Incoming PMs still go to the Inbox.  Sorry that this wasn't clear.

I hope this answers this question for everybody, and the mod description has been updated so that it is clear as to what this mod is intended to do....
Title: Re: Separate Unread PMs
Post by: Steve on March 13, 2017, 02:28:23 PM
Couldn't this mod and your other one (Edit Unread PMs (http://www.simplemachines.org/community/index.php?topic=552728.0)) just be combined into one mod or do you think there would be enough demand for one or the other to warrant keeping them as two separate mods?
Title: Re: Separate Unread PMs
Post by: dougiefresh on March 13, 2017, 04:37:52 PM
Quote from: Steve on March 13, 2017, 02:28:23 PM
Couldn't this mod and your other one (Edit Unread PMs (http://www.simplemachines.org/community/index.php?topic=552728.0)) just be combined into one mod or do you think there would be enough demand for one or the other to warrant keeping them as two separate mods?
Yup, it could, but it won't be combined (at least, not anytime soon by me).  Part of the problem with my Enhanced PM System (http://www.simplemachines.org/community/index.php?topic=521508.0) mod was the fact that the different functions interfaced as a complete mod; diagnosing why one particular part wasn't working or giving weird results was getting ridiculous!  I decided to break that mod down into separate pieces so that if one part had problems, I could more easily fix them.  Also, adding features related to each mod is much easier when I don't have to wade through a humugous mod to look for the cause....
Title: Re: Separate Unread PMs
Post by: Steve on March 13, 2017, 08:43:43 PM
Ah, makes sense. Thanks for the explanation. :)
Title: Re: Separate Unread PMs
Post by: Dave J on March 18, 2017, 02:51:20 AM
No disrespect meant Dougie but I have renamed my version to 'Unread' as it makes sense in the fact the PM has been sent just not read.

If anyone else wants to do that just go to

/Themes/default/languages/PersonalMessage.english.php

Find

$txt['unread_items'] = 'Outbox';

Change to

$txt['unread_items'] = 'Unread';
Title: Re: Separate Unread PMs
Post by: Steve on March 18, 2017, 08:58:28 AM
Outbox makes perfect sense to me. Think of it as if you're sitting at a desk and you have two places for things to be done. One is the Inbox for you and the other is the Outbox for things you've finished and need to be sent/picked up/whatever. Then if it occurs to you that you need to make a change to an item in the Outbox you can do that, as long as it hasn't been sent/picked up/whatever (or in this case, read).
Title: Re: Separate Unread PMs
Post by: Dave J on March 18, 2017, 09:53:44 AM
Quote from: Steve on March 18, 2017, 08:58:28 AM
Outbox makes perfect sense to me. Think of it as if you're sitting at a desk and you have two places for things to be done. One is the Inbox for you and the other is the Outbox for things you've finished and need to be sent/picked up/whatever. Then if it occurs to you that you need to make a change to an item in the Outbox you can do that, as long as it hasn't been sent/picked up/whatever (or in this case, read).

So your saying Steve, that if the recipient hasn't read the PM then it can be edited, is that right? If so there is no comments relating to that in the description

For me personally I only want to know if someone has read what I've sent or not.
Title: Re: Separate Unread PMs
Post by: dougiefresh on March 18, 2017, 10:09:08 AM
Quote from: Steve on March 18, 2017, 08:58:28 AM
Outbox makes perfect sense to me. Think of it as if you're sitting at a desk and you have two places for things to be done. One is the Inbox for you and the other is the Outbox for things you've finished and need to be sent/picked up/whatever. Then if it occurs to you that you need to make a change to an item in the Outbox you can do that, as long as it hasn't been sent/picked up/whatever (or in this case, read).
Thank you for explaining the idea behind combining this mod and the Edit Unread PMs (http://custom.simplemachines.org/mods/index.php?mod=4140) mod so perfectly.....

Quote from: davejo on March 18, 2017, 02:51:20 AM
No disrespect meant Dougie but I have renamed my version to 'Unread' as it makes sense in the fact the PM has been sent just not read.
Why would I think it's disrespectful?  I might be able to add an option to make that change automatically within the mod.....

Quote from: davejo on March 18, 2017, 09:53:44 AM
So your saying Steve, that if the recipient hasn't read the PM then it can be edited, is that right? If so there is no comments relating to that in the description
If you've installed the Edit Unread PMs (http://custom.simplemachines.org/mods/index.php?mod=4140) mod, then yes, you can edit any PM that hasn't been read.  This mod only seperates the unread outgoing PMs from those that have been read....
Title: Re: Separate Unread PMs
Post by: Dave J on March 18, 2017, 01:27:30 PM
Thanks for the reply and explanation Dougie

I do not have the 'Edit Unread PM's' mod installed and I'm happy with the way this functions.
Title: Re: Separate Unread PMs
Post by: Steve on March 18, 2017, 05:00:04 PM
Quote from: davejo on March 18, 2017, 09:53:44 AMSo your saying Steve, that if the recipient hasn't read the PM then it can be edited, is that right?

Sorry about that. My explanation didn't make it clear that this mod on its own doesn't allow editing of sent items.

@ Dougie - you're welcome.
Title: Re: Separate Unread PMs
Post by: Dave J on March 18, 2017, 05:20:39 PM
Quote from: Steve on March 18, 2017, 05:00:04 PM


Sorry about that. My explanation didn't make it clear that this mod on its own doesn't allow editing of sent items.

@ Dougie - you're welcome.

No problem Steve
Title: Re: Separate Unread PMs
Post by: dougiefresh on March 30, 2017, 09:47:00 AM
Uploaded v1.3 - March 30th, 2017
o Fixed installation issue that conflicts with Search Sent Personal Messages (PMs) (http://www.simplemachines.org/community/index.php?topic=524832.0)
Title: Re: Separate Unread PMs
Post by: chrishicks on March 30, 2017, 12:09:27 PM
Two quick questions.

1. I think I'm looking at this mod correctly but I just want to be sure(it's my birthday today so I'm a whopping one day older than I was yesterday so I need help in my old age :)). If I install this would it counter those "I didn't read the message until ____" when they actually read it say hours/days earlier people correct? I have a few members who you can see reading their messages in Who's Online yet they will claim it takes them days to do so when asked. It's really annoying at times.

2. I want to install the Edit Unread along with the Search Sent mods so should I install one particular mod before another or does the order not matter?
Title: Re: Separate Unread PMs
Post by: chrishicks on March 31, 2017, 09:48:12 AM
Ok, I decided to just take a whirl at installing both this and Separate Unread PMs with installing this one first. This mod seemed to install just fine but I didn't send/retrieve/fully test but there were no errors in the logs when at least visiting my PM box. There were 2 "errors" that were ignored but they weren't flagged as a "don't install this mod!!" kind of flag. Looking at the code shown I'm guessing it is related to the attachments mod so I just ran with it.

My issue came when I installed the Separate mod next. Again there were no errors during install but I completely lost access to my Inbox. The link was still there but when clicking it I just got stuck in Sent. Outbox was just a clone of Sent as well. I also lost 1 sent message that was unread. It was just gone because Outbox was mirroring Sent. I start looking at the edits and all seemed alright but since I was getting pressed for time I decided to just uninstall it and mess with it another time. When I went to uninstall however it failed telling me there were errors. I didn't do any other installs between installing and uninstalling so I just opened up that file in my browser and found the failed edit and I didn't see an issue as to why it would fail. It was exactly the same that the uninstall was calling for. I just went ahead with removing it and then made that manual change afterwards.

I head back to my PM box and I still don't have access to my inbox. The Outbox is gone but I'm stuck in Sent no matter what I try. I go ahead and uninstall the Edit mod and everything is back to normal or at least looks that way. Now through this entire time there was never a single error in the log and everything appears to be working just as it was prior to installing the 2 mods so I'm not sure what went wrong but for me something did somewhere but when I have a good few hours to mess around with it I'll try installing them both again and see what happens. Worse case I break something and I just have to upload the original files from a backup which I almost thought I was going to be doing yesterday after that first failure during uninstall. 
Title: Re: Separate Unread PMs
Post by: dougiefresh on March 31, 2017, 10:03:14 AM
Quote from: chrishicks on March 31, 2017, 09:48:12 AM
Ok, I decided to just take a whirl at installing both this and Separate Unread PMs with installing this one first.
I'm going to assume you intended to post in the Search Sent PM mod thread, since you posted in the Separate Unread PMs mod thread....

Quote from: chrishicks on March 31, 2017, 09:48:12 AM
This mod seemed to install just fine but I didn't send/retrieve/fully test but there were no errors in the logs when at least visiting my PM box. There were 2 "errors" that were ignored but they weren't flagged as a "don't install this mod!!" kind of flag. Looking at the code shown I'm guessing it is related to the attachments mod so I just ran with it.

My issue came when I installed the Separate mod next. Again there were no errors during install but I completely lost access to my Inbox. The link was still there but when clicking it I just got stuck in Sent. Outbox was just a clone of Sent as well. I also lost 1 sent message that was unread. It was just gone because Outbox was mirroring Sent. I start looking at the edits and all seemed alright but since I was getting pressed for time I decided to just uninstall it and mess with it another time. When I went to uninstall however it failed telling me there were errors. I didn't do any other installs between installing and uninstalling so I just opened up that file in my browser and found the failed edit and I didn't see an issue as to why it would fail. It was exactly the same that the uninstall was calling for. I just went ahead with removing it and then made that manual change afterwards.

I head back to my PM box and I still don't have access to my inbox. The Outbox is gone but I'm stuck in Sent no matter what I try. I go ahead and uninstall the Edit mod and everything is back to normal or at least looks that way. Now through this entire time there was never a single error in the log and everything appears to be working just as it was prior to installing the 2 mods so I'm not sure what went wrong but for me something did somewhere but when I have a good few hours to mess around with it I'll try installing them both again and see what happens. Worse case I break something and I just have to upload the original files from a backup which I almost thought I was going to be doing yesterday after that first failure during uninstall. 
Attach your PersonalMessage.php and I'll try to fix it.....

EDIT:  I can confirm that the Separate Unread PMs mod is not the culprit here.  The Separate Unread PMs mod and the Search Sent PMs mod are not compatible with each other at this moment.  I am working to resolve this issue....
Title: Re: Separate Unread PMs
Post by: chrishicks on March 31, 2017, 04:45:55 PM
Quote from: dougiefresh on March 31, 2017, 10:03:14 AM
Quote from: chrishicks on March 31, 2017, 09:48:12 AM
Ok, I decided to just take a whirl at installing both this and Separate Unread PMs with installing this one first.
I'm going to assume you intended to post in the Search Sent PM mod thread, since you posted in the Separate Unread PMs mod thread....


Whoops. I was talking about the Edit Unread PMs and this mod. I got the 2 topics/mods mixed up so I can see where it was pretty confusing. Sorry about that. I never attempted to install the Search PMs yet.

Let me try this again. I installed Edit Unread PMs first and everything was fine. No errors in logs, etc. however I didn't actually test to see if things worked 100%. I never really have with any of your mods because they always just worked for me. I did have the newly added links(edit/unsend) so I figured everything was fine. I hit the logs again and still no errors after navigating around my PM box.

Then I installed this mod(Separate Unread PMs). That's where things went bad and is what I was talking about in my post above. Once Separate Unread PMs was installed I lost access to my inbox. I would click it and would just stay stuck in my sent folder. The outbox folder was exactly the same. I had 2 sent but unread messages and those were both just gone. They weren't in sent or in outbox. I started checking the code edits one by one but decided to uninstall for the time being and that's when it errored out. I manually made the change for the error(it was only one) and carried on. Went back to my inbox and I still couldn't access it. It was the same as it was with Separate Unread PMs installed. I go ahead and uninstall Edit Unread and everything is back to normal.

I didn't get any errors for either mod during install other than the aforementioned 2 that seemed related to the Post and PM Attachments mod which said ignore error when I installed Edit Unread PMs. My installation was pretty much:

1. install Edit Unread PMs
2. navigate PM box - both inbox/sent work
3. check for errors after
4. install Separate Unread PMs
5. go to inbox and can't get it
6. check for errors and see none
7. decide to uninstall Separate Unread and get an error
8. proceed and manually fix error after
9. inbox still broken
10. no errors in logs at all
11. uninstall Edit Unread PMs
12. everything works again

Title: Re: Separate Unread PMs
Post by: zorer on June 14, 2017, 01:45:58 PM
Hi! i installed this mod in a smf 2.0.14 and works great, anyway is possible to add this feature?

Actually we have this:
Outbox when you click then you see the msgs to send

What about this?
OutBox(2) >Number of msg ready to read

Phpbb PM uses this way

Thanks!
Title: Re: Separate Unread PMs
Post by: GL700Wing on June 15, 2017, 10:46:24 PM
I've just discovered an issue with this mod - it references a column in the personal_messages table that doesn't exist - error message is:
Database Error: Unknown column 'pmr.is_read' in 'where clause'

SELECT COUNT(*)
FROM smf_personal_messages
WHERE id_member_from = 2252
AND deleted_by_sender = 0
AND pmr.is_read > 0
AND id_pm > 73783
File: ./Sources/PersonalMessage.php
Line: 595


I've confirmed that the current mod installation does not create this column so to address the issue I've manually added a column to the personal_messages table with the following attributes:
name = is_read
type = tinyint
size = 3
unsigned = true
default = 0
Title: Re: Separate Unread PMs
Post by: dougiefresh on July 05, 2017, 02:15:30 PM
Uploaded v1.4 - July 5th, 2017
o Fixed database query error in Sources\PersonalMessages.php.  Thanks, GL700Wing (https://www.simplemachines.org/community/index.php?action=profile;u=112942)!!!




@GL700Wing:  This update should take care of the bug report you reported!  Thanks again!
Title: Re: Separate Unread PMs
Post by: dougiefresh on July 07, 2017, 11:15:36 PM
Uploaded v1.5 - July 7th, 2017
o Added support for SMF 2.1 Beta 3.
o Removed support for SMF 2.1 Beta 2.
Title: Re: Separate Unread PMs
Post by: dougiefresh on August 04, 2017, 02:24:50 PM
Uploaded v1.6 - August 4th, 2017
o Made changes for compatibilty with Search Sent PMs (http://custom.simplemachines.org/mods/index.php?mod=3888).
Title: Re: Separate Unread PMs
Post by: TheEngineer on January 11, 2018, 08:07:13 AM
Good morning! 

In my upgrade from a (very) outdated version of SMF to 2.0.15, I needed to remove Enhanced PM System.  This appears to provide most of the functionality we loved about the old mod.  I'm getting an error when trying to install the mod though:


Code: (Find) [Select]
WHERE ' . ($context['folder'] == 'sent' ? 'pm.id_member_from = {raw:current_member}

Code: (Replace) [Select]
WHERE ' . ($context['sup_folder'] ? 'pm.id_member_from = {raw:current_member}
AND pmr.is_read ' . ($context['folder'] == 'sent' ? '>' : '=') . '0


Could you please advise?  Thanks!
Title: Re: Separate Unread PMs
Post by: dougiefresh on January 11, 2018, 10:16:33 AM
Uploaded v1.7 - January 11th, 2018
o Added support for SMF 2.0.15.




@TheEngineer:  This update should resolve the install problem with SMF 2.0.15.  Thank you for reporting this bug!
Title: Re: Separate Unread PMs
Post by: TheEngineer on January 11, 2018, 12:37:29 PM
That fixed it.  Thanks!
Title: Re: Separate Unread PMs
Post by: -Rock Lee- on February 21, 2018, 03:44:45 PM
I think I have to approach the branch 2.1 to be able to follow the step :P I hope it serves you.


Regards!
Title: Re: Separate Unread PMs
Post by: dougiefresh on February 21, 2018, 08:00:08 PM
Uploaded v1.8 - February 21th, 2018
o Added Spanish Latin translation by Rock Lee (http://www.simplemachines.org/community/index.php?action=profile;u=322597).




@Rock Lee:  Thanks for the translation!  It's been included in this version!
Title: Re: Separate Unread PMs
Post by: chyyyone on May 31, 2018, 10:29:54 AM
Before I installed this mod everything seemed to work great with your Better Messages Menu. I installed this mod a few days ago and I'm not receiving any errors but I don't know if it's conflicting with your Better Messages Menu because I got a PM yesterday. I read it and all was fine. I logged in this morning and got the popup saying I had a PM but it was the same one I received last night. In the drop down menu it remained showing I had 2 messages in my inbox. I knew the only mod I had installed was the Separate Unread PM's so once I uninstalled it I no longer got I had 2 messages in my inbox showing on the drop down menu. I don't know if it's a problem with one of your mods but thought I should let you know what I experienced. I haven't reinstalled this mod yet. I really liked it though.
Title: Re: Seperate Unread PMs
Post by: dougiefresh on November 02, 2018, 12:08:04 PM
Uploaded v1.9 - October 15th, 2018
o No functionality change.
o Updated documentation to point to new website.
Title: Re: Seperate Unread PMs
Post by: dougiefresh on June 19, 2019, 12:38:10 PM
Uploaded v1.10 - June 19th, 2019[/u]
o Added support for SMF 2.1 RC 2.
o Removed support for SMF 2.1 Beta 3.




@chyyyone:  I'm sorry your bug report went unanswered for so long.  I'll take a look into it....
Title: Re: Seperate Unread PMs
Post by: Dave J on April 09, 2022, 06:34:20 AM
Hi Dougie

Could we have an update for 2.1.1 please?