Enhanced PM System

Started by dougiefresh, April 20, 2014, 04:30:16 PM

Previous topic - Next topic

NekoJonez

There are some options I would love to have on my forum as an admin, but there are some I dislike. There should be an option for the settings man.
Retro video game blogger, writer, actor, podcaster and general amazing dude.

Twitter
My Blog

Arantor


ExSpirit

Quote from: dougiefresh on August 27, 2014, 01:41:13 PM
Quote from: SilverWings on August 27, 2014, 02:06:42 AM
I managed to make all modification which you wrote, but the bug with URL still exists, so those changes don't fix it. I have now installed latest mod version on clean SMF and tested if this is fixed (so that if it was I would compare files and see the changes), but this problem still exists even with latest version 2.1:

If I am in my inbox and before I click on some conversation if other person sends another new message in that conversation and after that I click on link to open conversation (without refreshing page) I get error "You are not allowed to access this section", so I have to go back to inbox and click the link again. The problem is that when new message arrives in conversation, pmid changes in URL, so old one no longer works.
Okay.  Lemme investigate this issue.
I have the same problem. I click on conversation and get error, because someone already replied.

ExSpirit

And about the sorting order of messages in conversation list I changed in PersonalMessages.php from this:

ORDER BY ' . ($_GET['sort'] == 'pm.id_pm' && $context['folder'] != 'sent' ? 'id_pm' : '{raw:sort}') . ($descending ? ' DESC' : ' ASC') . (empty($_GET['pmsg']) ? '

to this:

ORDER BY ' . ($_GET['sort'] == 'pm.id_pm' && $context['folder'] != 'sent' ? 'id_pm' : '{raw:sort}') . ($descending ? ' DESC' : ' DESC') . (empty($_GET['pmsg']) ? '

...and new conversations are now on top (no longer on bottom) which is what I wanted, but there's one more problem with this - if I have more conversations so that pages are generated, I am always placed on last page when I go to inbox, so if I have 20 pages and I click on inbox I am thrown to last page (20) where old messages are shown, instead on first page so that I can see new messages on top. Any idea how can I fix this problem?

dougiefresh

#84
Quote from: NekoJonez on August 31, 2014, 12:20:45 PM
There are some options I would love to have on my forum as an admin, but there are some I dislike. There should be an option for the settings man.
Please be specific in what you want.  The worst that will happen is I'll say no to the options.  And "an option for the settings"?  Please explain.

EDIT: If the "option" that you are wanting is available in another mod, I'll point to it if I'm aware of such a mod......

Quote from: ExSpirit on September 01, 2014, 05:47:29 AM
Quote from: dougiefresh on August 27, 2014, 01:41:13 PM
Quote from: SilverWings on August 27, 2014, 02:06:42 AM
I managed to make all modification which you wrote, but the bug with URL still exists, so those changes don't fix it. I have now installed latest mod version on clean SMF and tested if this is fixed (so that if it was I would compare files and see the changes), but this problem still exists even with latest version 2.1:

If I am in my inbox and before I click on some conversation if other person sends another new message in that conversation and after that I click on link to open conversation (without refreshing page) I get error "You are not allowed to access this section", so I have to go back to inbox and click the link again. The problem is that when new message arrives in conversation, pmid changes in URL, so old one no longer works.
Okay.  Lemme investigate this issue.
I have the same problem. I click on conversation and get error, because someone already replied.
I managed to fix this issue for the next version.

Quote from: ExSpirit on September 03, 2014, 08:18:36 AM
And about the sorting order of messages in conversation list I changed in PersonalMessages.php from this:

ORDER BY ' . ($_GET['sort'] == 'pm.id_pm' && $context['folder'] != 'sent' ? 'id_pm' : '{raw:sort}') . ($descending ? ' DESC' : ' ASC') . (empty($_GET['pmsg']) ? '

to this:

ORDER BY ' . ($_GET['sort'] == 'pm.id_pm' && $context['folder'] != 'sent' ? 'id_pm' : '{raw:sort}') . ($descending ? ' DESC' : ' DESC') . (empty($_GET['pmsg']) ? '

...and new conversations are now on top (no longer on bottom) which is what I wanted, but there's one more problem with this - if I have more conversations so that pages are generated, I am always placed on last page when I go to inbox, so if I have 20 pages and I click on inbox I am thrown to last page (20) where old messages are shown, instead on first page so that I can see new messages on top. Any idea how can I fix this problem?
Well, my first thought is that you're using the wrong value for start variable passed.  But I'd have to look at the code a lot more to answer this question.

SilverWings

Quote from: dougiefresh on September 05, 2014, 10:39:57 AM
I managed to fix this issue for the next version.
Great, can you please write what should be changed to fix this?

dougiefresh

In PersonalMessage.php, replace this:
Code (Find) Select
// ... but wait - what if we want to start from a specific message?
if (isset($_GET['pmid']))
{
$pmID = (int) $_GET['pmid'];

// Make sure you have access to this PM.
if (!isAccessiblePM($pmID, $context['folder'] == 'sent' || $context['folder'] == 'unread' ? 'outbox' : 'inbox'))

with this:
Code (Replace) Select
// ... but wait - what if we want to start from a specific message?
if (isset($_GET['pmid']))
{
$pmID = (int) $_GET['pmid'];

// Make sure you have access to this PM.
if (!isAccessiblePM($pmID, $context['folder'] == 'sent' ? 'outbox' : 'inbox'))


Then find this:
Code (Find) Select
// Sanitize and validate pmsg variable if set.
if (isset($_GET['pmsg']))
{
$pmsg = (int) $_GET['pmsg'];

if (!isAccessiblePM($pmsg, $context['folder'] == 'sent' || $context['folder'] == 'unread' ? 'outbox' : 'inbox'))

and replace with this:
Code (Replace) Select
// Sanitize and validate pmsg variable if set.
if (isset($_GET['pmsg']))
{
$pmsg = (int) $_GET['pmsg'];

if (!isAccessiblePM($pmsg, $context['folder'] == 'sent' ? 'outbox' : 'inbox'))


These changes revert the code back to stock code.....

SilverWings

I made those changes, but it's still the same - I am still getting "You are not allowed to access this section" error after clicking on conversation.

dougiefresh

Hmmmm.....  I thought I had it cause my test actually succeeded....

ExSpirit

#89
Quote from: dougiefresh on September 05, 2014, 09:20:54 PM
Hmmmm.....  I thought I had it cause my test actually succeeded....
Same here - the same problem still exists.

Quote from: dougiefresh on September 05, 2014, 10:39:57 AM
Well, my first thought is that you're using the wrong value for start variable passed.  But I'd have to look at the code a lot more to answer this question.
I think I got this to work now, I made those changes:

I replaced this:
        if (!is_numeric($_GET['start']) || $_GET['start'] >= $max_messages)

With this:
if (!is_numeric($_GET['start'])) $_GET['start'] = 0;
else if (!is_numeric($_GET['start']) || $_GET['start'] >= $max_messages)


And what I already changed before:

Replaced this:
ORDER BY ' . ($_GET['sort'] == 'pm.id_pm' && $context['folder'] != 'sent' ? 'id_pm' : '{raw:sort}') . ($descending ? ' DESC' : ' ASC') . (empty($_GET['pmsg']) ? '

With this:
ORDER BY ' . ($_GET['sort'] == 'pm.id_pm' && $context['folder'] != 'sent' ? 'id_pm' : '{raw:sort}') . ($descending ? ' DESC' : ' DESC') . (empty($_GET['pmsg']) ? '

I haven't tested much but so far newest messages are on top and when I go ti inbox I start with first page, not last.

Jeff B

I have an odd problem after installing this modification. I have no submit button on the message search!  Any ideas?

dougiefresh

Quote from: Jeff B on September 06, 2014, 02:12:47 PM
I have an odd problem after installing this modification. I have no submit button on the message search!  Any ideas?
That's not good....  Can't believe I forgot that issue cause I fixed it in my Search Sent Personal Messages (PMs) mod.  I'll fix it for the next version.

Quote from: ExSpirit on September 06, 2014, 03:37:34 AM
Quote from: dougiefresh on September 05, 2014, 09:20:54 PM
Hmmmm.....  I thought I had it cause my test actually succeeded....
Same here - the same problem still exists.

Quote from: dougiefresh on September 05, 2014, 10:39:57 AM
Well, my first thought is that you're using the wrong value for start variable passed.  But I'd have to look at the code a lot more to answer this question.
I think I got this to work now, I made those changes:

I replaced this:
        if (!is_numeric($_GET['start']) || $_GET['start'] >= $max_messages)

With this:
if (!is_numeric($_GET['start'])) $_GET['start'] = 0;
else if (!is_numeric($_GET['start']) || $_GET['start'] >= $max_messages)


And what I already changed before:

Replaced this:
ORDER BY ' . ($_GET['sort'] == 'pm.id_pm' && $context['folder'] != 'sent' ? 'id_pm' : '{raw:sort}') . ($descending ? ' DESC' : ' ASC') . (empty($_GET['pmsg']) ? '

With this:
ORDER BY ' . ($_GET['sort'] == 'pm.id_pm' && $context['folder'] != 'sent' ? 'id_pm' : '{raw:sort}') . ($descending ? ' DESC' : ' DESC') . (empty($_GET['pmsg']) ? '

I haven't tested much but so far newest messages are on top and when I go ti inbox I start with first page, not last.
Cool....  Mind if I incorporate these changes into the mod?  Will have to make a switch or something so that the option is MUCH more user-friendly....

Jeff B

Is the fix to my issue in the code above? 

ExSpirit

Quote from: dougiefresh on September 06, 2014, 04:44:36 PM
Cool....  Mind if I incorporate these changes into the mod?  Will have to make a switch or something so that the option is MUCH more user-friendly....
Sure, you can do that.

dougiefresh

Quote from: Jeff B on September 06, 2014, 06:03:21 PM
Is the fix to my issue in the code above?
Unfortunately, no.   ExSpirit did a feature-request and shared how he did it in his code.  I haven't had much time to do much today.....

NekoJonez

Quote from: dougiefresh on September 05, 2014, 10:39:57 AM
Quote from: NekoJonez on August 31, 2014, 12:20:45 PM
There are some options I would love to have on my forum as an admin, but there are some I dislike. There should be an option for the settings man.
Please be specific in what you want.  The worst that will happen is I'll say no to the options.  And "an option for the settings"?  Please explain.

EDIT: If the "option" that you are wanting is available in another mod, I'll point to it if I'm aware of such a mod......

I'll post or pm you a list, if I find the time. So, don't loose sleep over it or something ;)
Retro video game blogger, writer, actor, podcaster and general amazing dude.

Twitter
My Blog

dougiefresh

#96
Quote from: NekoJonez on September 07, 2014, 08:09:05 AM
Quote from: dougiefresh on September 05, 2014, 10:39:57 AM
Quote from: NekoJonez on August 31, 2014, 12:20:45 PM
There are some options I would love to have on my forum as an admin, but there are some I dislike. There should be an option for the settings man.
Please be specific in what you want.  The worst that will happen is I'll say no to the options.  And "an option for the settings"?  Please explain.

EDIT: If the "option" that you are wanting is available in another mod, I'll point to it if I'm aware of such a mod......

I'll post or pm you a list, if I find the time. So, don't lose sleep over it or something ;)
Sound like a plan to me!  Don't worry, I lose sleep over other things  ::)

EDIT: Prefer that you post it, since you already posted you want to see "some options"  :P

SilverWings

dougiefresh do you have any new update for below bug?

QuoteIf I am in my inbox and before I click on some conversation if other person sends another new message in that conversation and after that I click on link to open conversation (without refreshing page) I get error "You are not allowed to access this section", so I have to go back to inbox and click the link again. The problem is that when new message arrives in conversation, pmid changes in URL, so old one no longer works.

shadowandlight

Hello, when trying to install 2.1 of this mod, I am seeing the following errors.... ( I had 1.6 installed and I am trying to upgrade, I uninstalled 1.6 already).

http://i.imgur.com/blfTOF7.png
http://i.imgur.com/bAgyuLD.png
http://i.imgur.com/CobVw0P.png

edit - here is my installed mods
http://i.imgur.com/VoJl1Ud.png

dougiefresh

Quote from: shadowandlight on September 07, 2014, 02:40:19 PM
Hello, when trying to install 2.1 of this mod, I am seeing the following errors.... ( I had 1.6 installed and I am trying to upgrade, I uninstalled 1.6 already).

http://i.imgur.com/blfTOF7.png
http://i.imgur.com/bAgyuLD.png
http://i.imgur.com/CobVw0P.png

edit - here is my installed mods
http://i.imgur.com/VoJl1Ud.png
It isn't PM attachments mod, Personal Messages to Membergroups, SimplePortal, eNotify, nor either Eve mod.  The others I didn't check cause their title doesn't seem like it would affect this mod....  I can't check PM to XMPP because I can't find it, but since the obvious ones aren't conflicting with the Enhanced PM system, I would assume it's that one.

Quote from: SilverWings on September 07, 2014, 12:38:30 PM
dougiefresh do you have any new update for below bug?
Nope.

Advertisement: