News:

Want to get involved in developing SMF, then why not lend a hand on our github!

Main Menu

Enhanced PM System

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

Previous topic - Next topic

Ninja ZX-10RR

It *looks* like one of the edits to the /Sources/PersonalMessage.php to me, I don't really have time to check since I gotta go but it looked that. Don't really have time in the following days either >_<
Quote from: BeastMode topic=525177.msg3720020#msg3720020
It's so powerful that on this post and even in the two PMs you sent me,you still answered my question very quickly and you're apologizing for the delay. You're the #1 support I've probably ever encountered man, so much respect for that. Thank you, and get better soon.

I'll keep this in my siggy for a while just to remind me that someone appreciated what I did while others didn't.

♥ Jess ♥

STOP EDITING MY PROFILE

RSI

Hi,

I'm getting the error below whenever PM's are sent or read, not sure which, but I've determined it is this mod.

URL: http://mydomain/index.php?action=pm;sa=send;f=inbox;pmsg=207;u=all
Error: in_array() expects parameter 2 to be array, null given
File: /home/me/public_html/Sources/PersonalMessage.php
Line: 1972

Any ideas as to what it is and how to correct it.

dougiefresh

@RSI: This section needs to be changed from:
// Remove any recipients that have the current user in their pm ignore list:
foreach ($context['recipients']['to'] as $id => $user)
{
if (in_array($user_info['id'], $user['pm_ignore_list']))
{
$context['send_log']['failed'][] = sprintf($txt['pm_error_ignored_by_user'], $user['name']);
unset($context['recipients']['to'][$id]);
}
}
foreach ($context['recipients']['bcc'] as $id => $user)
{
if (in_array($user_info['id'], $user['pm_ignore_list']))
{
$context['send_log']['failed'][] = sprintf($txt['pm_error_ignored_by_user'], $user['name']);
unset($context['recipients']['bcc'][$id]);
}
}

to the following code:
// Remove any recipients that have the current user in their pm ignore list:
if (!empty($context['recipients']['to']))
{
foreach ($context['recipients']['to'] as $id => $user)
{
if (in_array($user_info['id'], $user['pm_ignore_list']))
{
$context['send_log']['failed'][] = sprintf($txt['pm_error_ignored_by_user'], $user['name']);
unset($context['recipients']['to'][$id]);
}
}
}
if (!empty($context['recipients']['bcc']))
{
foreach ($context['recipients']['bcc'] as $id => $user)
{
if (in_array($user_info['id'], $user['pm_ignore_list']))
{
$context['send_log']['failed'][] = sprintf($txt['pm_error_ignored_by_user'], $user['name']);
unset($context['recipients']['bcc'][$id]);
}
}
}

That should get rid of those pesky error messages....  :P  A mod update will be issued shortly.

RSI

I just tried that and now when I reply to a PM I'm getting the 2 errors below in the log.

http://mydomain.com/index.php?action=pm;sa=send;f=inbox;pmsg=209;u=all
2: in_array() expects parameter 2 to be array, null given
File: /home/me/public_html/Sources/PersonalMessage.php
Line: 1974

http://mydomain.com/index.php?action=pm;sa=send;f=inbox;pmsg=209;u=all
8: Undefined index: pm_ignore_list
File: /home/me/public_html/Sources/PersonalMessage.php
Line: 1974

dougiefresh

Can you try replacing the code I gave you with this?  This adds some additional error checking to the mix:
// Remove any recipients that have the current user in their pm ignore list:
if (!empty($context['recipients']['to']))
{
foreach ($context['recipients']['to'] as $id => $user)
{
if (isset($user['pm_ignore_list']) && is_array($user['pm_ignore_list']) && in_array($user_info['id'], $user['pm_ignore_list']))
{
$context['send_log']['failed'][] = sprintf($txt['pm_error_ignored_by_user'], $user['name']);
unset($context['recipients']['to'][$id]);
}
}
}
if (!empty($context['recipients']['bcc']))
{
foreach ($context['recipients']['bcc'] as $id => $user)
{
if (isset($user['pm_ignore_list']) && is_array($user['pm_ignore_list']) && in_array($user_info['id'], $user['pm_ignore_list']))
{
$context['send_log']['failed'][] = sprintf($txt['pm_error_ignored_by_user'], $user['name']);
unset($context['recipients']['bcc'][$id]);
}
}
}

RSI

Quote from: dougiefresh on March 05, 2015, 11:25:16 AM
Can you try replacing the code I gave you with this?  This adds some additional error checking to the mix:
// Remove any recipients that have the current user in their pm ignore list:
if (!empty($context['recipients']['to']))
{
foreach ($context['recipients']['to'] as $id => $user)
{
if (isset($user['pm_ignore_list']) && is_array($user['pm_ignore_list']) && in_array($user_info['id'], $user['pm_ignore_list']))
{
$context['send_log']['failed'][] = sprintf($txt['pm_error_ignored_by_user'], $user['name']);
unset($context['recipients']['to'][$id]);
}
}
}
if (!empty($context['recipients']['bcc']))
{
foreach ($context['recipients']['bcc'] as $id => $user)
{
if (isset($user['pm_ignore_list']) && is_array($user['pm_ignore_list']) && in_array($user_info['id'], $user['pm_ignore_list']))
{
$context['send_log']['failed'][] = sprintf($txt['pm_error_ignored_by_user'], $user['name']);
unset($context['recipients']['bcc'][$id]);
}
}
}


K, it looks like the errors may be gone now. Let me play with it for a while to make sure.

dougiefresh

Sure.  Thanks for the bug report!

RSI

It looks like that did it. Myself and one of my members sent PM's back and forth and I even deleted one in the outbox and then resent it and I'm not seeing any more errors in the log, but if anything comes up I will let you know.

P.S. Doesn't look like they have added the necessary Outbox in v2.1 either so this mod will be needed when its ready.

dougiefresh

Quote from: RSI on March 05, 2015, 12:56:02 PM
It looks like that did it. Myself and one of my members sent PM's back and forth and I even deleted one in the outbox and then resent it and I'm not seeing any more errors in the log, but if anything comes up I will let you know.
That's good to know!  Thanks!

Quote from: RSI on March 05, 2015, 12:56:02 PM
P.S. Doesn't look like they have added the necessary Outbox in v2.1 either so this mod will be needed when its ready.
Thanks for reminding me of the monumental task ahead of me  :P  I do plan on releasing a SMF 2.1 version at some point....

dougiefresh

Uploaded v2.8 - March 5th, 2015
o Fixed bug where element is used before checking to see if it has been defined yet.
o Unfixed "bug" in the Manage Rules page that allowed users to assign more than one action to a Rule.
o Unfixed "bug" in function ApplyRules that allowed one PM to be put in multiple folders.
o POLICY CHANGE: Upgrade only possible from version 2.6 and 2.7.




@RSI: You should be able to upgrade to the latest v2.8, ignoring the first operation that fails due to having already made the correction/modification to the code....

Geor'G

It would be convenient to have a "quick reply" in a dialogue mode.

p.s. Thank you for mod.

dougiefresh

Let me see what I can do.

dougiefresh

UPDATE:  I haven't done anything with the quick reply request yet.  However, I've been working on making this mod compatible with SMF 2.1 Beta 1.  Once I get that conversion completed, I'll look into the quick reply request.  I'll also work on a few other features that may or may not make it into the next mod release....

dougiefresh

UPDATE: The changes for making this mod compatible with SMF 2.1 Beta 1 have been completed.  I'm going to start looking into the quick reply request now...

dougiefresh

Quote from: Geor'G on April 12, 2015, 09:16:52 PM
It would be convenient to have a "quick reply" in a dialogue mode.

p.s. Thank you for mod.
I can already see that building the quick reply code and template is going to be fun....  :o

MancerCorp

thanks for this mod - I am yet to install but by all accounts it looks like you have added a lot of core functionality there - congrats.

This may sound a little weird, but I am looking for a mod that will convert a submitted forum post (we review all posts before they go public) in to a private message (and possibly the same in reverse... a PM in to a post).

WHY? - We are attempting to set up SMF as our complete communications portal for our business (we administer the online ordering for many suppliers in a virtual mall arrangement) and a lot of our visitors / customers aren't tech savvy. It will make it easier if they didn't have to work out which to use when contacting us... We want them to mostly use the posting method, so we can display the answers we give to them on technical enquiries etc in the boards, but would like to deal with posts they submit of a private or sensitive nature, as PMs (specific order details, special pricing offerred etc.), sure we could just copy the contents over of any sensitive subject posts in to a reply to their PM and then delete the post at moderation stage, but it would be cleaner to have it logged as coming from them in the first place.

any ideas?

dougiefresh

The only mod that currently exists to make PMs also a post is Post PM.  That might work for ya....

I could make the PM to post functionality work in my mod, specifically as you have described.  However, I would probably have to seek permission from the author of the mod in order to do so.  The post to PM functionality is a bit more difficult.  It would require modifying the posting code to do so.  Again, doable, but probably difficult...

dougiefresh

UPDATE: PM Quick Reply is now working for SMF 2.0.x-line.  I just need to get the template working for SMF 2.1 Beta 1 now....  Still need to make a profile option like that of the Quick Reply for posts. 

PM Quick Reply has also been submitted as a separate mod, for those interested in this functionality without the rest of the Enhanced PM System mod.  As of this writing, it's still waiting for approval....  (Was submitted yesterday) 

MancerCorp

hey thet's great news... keep me... posted (sic)

dougiefresh

Quote from: MancerCorp on May 07, 2015, 11:32:08 PM
This may sound a little weird, but I am looking for a mod that will convert a submitted forum post (we review all posts before they go public) in to a private message (and possibly the same in reverse... a PM in to a post).

WHY? - We are attempting to set up SMF as our complete communications portal for our business (we administer the online ordering for many suppliers in a virtual mall arrangement) and a lot of our visitors / customers aren't tech savvy. It will make it easier if they didn't have to work out which to use when contacting us... We want them to mostly use the posting method, so we can display the answers we give to them on technical enquiries etc in the boards, but would like to deal with posts they submit of a private or sensitive nature, as PMs (specific order details, special pricing offerred etc.), sure we could just copy the contents over of any sensitive subject posts in to a reply to their PM and then delete the post at moderation stage, but it would be cleaner to have it logged as coming from them in the first place.
I've had some time to think about this particular request.  The problem I'm having is to me, it doesn't really fit into the grand scheme of this mod real well, nor would the new functionality be easy to integrate into this mod....  I personally think it would be better suited as a seperate mod, that could complement this mod....

Advertisement: