Advertisement:

Author Topic: PM Receipt Confirmation  (Read 61787 times)

Offline Pause

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 1,618
  • Official Cheesecake
PM Receipt Confirmation
« on: December 09, 2004, 07:18:21 AM »
I noticed in VBulletin when you send pm's, you can request a read receipt for the message (or you can choose not to), is there any way that this would be able to be done for SMF?

Offline Trekkie101

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 8,157
  • Gender: Male
  • Ad Astra!
    • https://www.facebook.com/DLRPRoundup on Facebook
    • @dlrproundup on Twitter
    • DLRP Roundup
Re: PM Receipt Confirmation
« Reply #1 on: December 09, 2004, 09:57:33 AM »
Hope not, that bugs the living daylights out of me, drives me mad having to click CANCEL at everymessage, its actually never really worked.

Offline Pause

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 1,618
  • Official Cheesecake
Re: PM Receipt Confirmation
« Reply #2 on: December 10, 2004, 05:54:28 AM »
Hope not, that bugs the living daylights out of me, drives me mad having to click CANCEL at everymessage, its actually never really worked.
Well, if there was one made for SMF, then there'd obviously have to be an option to disable receipt confirmation in the admin panel...

Offline orange

  • Jr. Member
  • **
  • Posts: 111
  • Gender: Male
Re: PM Receipt Confirmation
« Reply #3 on: December 10, 2004, 01:20:22 PM »
With the way that PM Inbox currently works I don't think it'd be that useful -- it'd just say that the user has viewed their PM's, not that they've read your particular message.

However, I can definitely see the benefits of this feature if combined with some sort of PM Inbox revamp so that you have to click on a particular message to read it.

Offline Oldiesmann

  • Developer
  • SMF Super Hero
  • *
  • Posts: 24,814
  • Gender: Male
  • Ask me about the function DB :)
    • oldiesmann on Facebook
    • Oldiesmann on GitHub
    • http://www.linkedin.com/in/michaeleshom on LinkedIn
    • @oldiesmann on Twitter
    • Archie Comics Fan Forum
Re: PM Receipt Confirmation
« Reply #4 on: December 11, 2004, 07:01:56 PM »
It would be much simpler to have SMF look at the is_read field in the im_recipients table...

Something like this perhaps?

Sources/InstantMessage.php

Find
Code: [Select]
// Get recipients (don't include bcc-recipients for your inbox, you're not supposed to know :P).
$request = db_query("
SELECT pmr.ID_PM, mem_to.ID_MEMBER AS ID_MEMBER_TO, mem_to.realName AS toName, pmr.bcc
FROM {$db_prefix}im_recipients AS pmr
LEFT JOIN {$db_prefix}members AS mem_to ON (mem_to.ID_MEMBER = pmr.ID_MEMBER)
WHERE pmr.ID_PM IN (" . implode(', ', $pms) . ")" . ($context['folder'] == 'outbox' ? '' : "
AND pmr.bcc = 0"), __FILE__, __LINE__);

Replace
Code: [Select]
// Get recipients (don't include bcc-recipients for your inbox, you're not supposed to know :P).
$request = db_query("
SELECT pmr.ID_PM, mem_to.ID_MEMBER AS ID_MEMBER_TO, mem_to.realName AS toName, pmr.bcc" . ($context['folder'] == 'outbox' ? ", pmr.is_read" : '') . "
FROM {$db_prefix}im_recipients AS pmr
LEFT JOIN {$db_prefix}members AS mem_to ON (mem_to.ID_MEMBER = pmr.ID_MEMBER)
WHERE pmr.ID_PM IN (" . implode(', ', $pms) . ")" . ($context['folder'] == 'outbox' ? '' : "
AND pmr.bcc = 0"), __FILE__, __LINE__);

Find
Code: [Select]
while ($row = mysql_fetch_assoc($request))
$recipients[$row['ID_PM']][empty($row['bcc']) ? 'to' : 'bcc'][] = empty($row['ID_MEMBER_TO']) ? $txt[28] : '<a href="' . $scripturl . '?action=profile;u=' . $row['ID_MEMBER_TO'] . '">' . $row['toName'] . '</a>';

Replace
Code: [Select]
while ($row = mysql_fetch_assoc($request))
{
$recipients[$row['ID_PM']][empty($row['bcc']) ? 'to' : 'bcc'][] = empty($row['ID_MEMBER_TO']) ? $txt[28] : '<a href="' . $scripturl . '?action=profile;u=' . $row['ID_MEMBER_TO'] . '">' . $row['toName'] . '</a>';
if($context['folder'] == 'outbox')
{
$recipients[$row['ID_PM']]['is_read'] = $row['is_read'];
}
}
            

Themes/default/InstantMessage.template.php

Find
Code: [Select]
<div style="overflow: auto; width: 100%;">', $message['body'], '</div>
Add after
Code: [Select]
';
if($context['folder'] == 'outbox')
{
echo '<br />';
foreach($message['recipients']['to'] as $person)
{
echo $person . ($message['recipients']['is_read'] == '1' ? ' has' : ' hasn\'t') . ' read this message.<br />';
}
}

That should work... If it doesn't, let me know and I'll try to fix it :)
Michael Eshom
Webmaster / SMF Lead Developer
oldiesmann@simplemachines.org

Offline FaSan

  • Sophist Member
  • *****
  • Posts: 1,053
  • Gender: Male
  • http://www.smitaly.net
    • SMitaly - Supporto a SMF
Re: PM Receipt Confirmation
« Reply #5 on: December 13, 2004, 06:00:10 AM »
Little Bug.

It's notify as read if the read as bcc user

ryanbsoftware

  • Guest
Re: PM Receipt Confirmation
« Reply #6 on: December 13, 2004, 11:53:18 AM »
hmm, what about a message tracker like IPB with just a checkbox to see if the pm was read or not and posssibly even when it was read. ;)

Offline FaSan

  • Sophist Member
  • *****
  • Posts: 1,053
  • Gender: Male
  • http://www.smitaly.net
    • SMitaly - Supporto a SMF
Re: PM Receipt Confirmation
« Reply #7 on: January 09, 2005, 03:26:42 PM »
If a IM with two or more recipients (on to:), the script report all unread.

If the last recipient read the im, all recipents reporting on read message.



FaSan

Offline Sanandreas

  • Semi-Newbie
  • *
  • Posts: 16
Re: PM Receipt Confirmation
« Reply #8 on: August 23, 2005, 05:42:49 PM »
It would be much simpler to have SMF look at the is_read field in the im_recipients table...

Something like this perhaps?

Sources/InstantMessage.php

Find
Code: [Select]
// Get recipients (don't include bcc-recipients for your inbox, you're not supposed to know :P).
$request = db_query("
SELECT pmr.ID_PM, mem_to.ID_MEMBER AS ID_MEMBER_TO, mem_to.realName AS toName, pmr.bcc
FROM {$db_prefix}im_recipients AS pmr
LEFT JOIN {$db_prefix}members AS mem_to ON (mem_to.ID_MEMBER = pmr.ID_MEMBER)
WHERE pmr.ID_PM IN (" . implode(', ', $pms) . ")" . ($context['folder'] == 'outbox' ? '' : "
AND pmr.bcc = 0"), __FILE__, __LINE__);

Replace
Code: [Select]
// Get recipients (don't include bcc-recipients for your inbox, you're not supposed to know :P).
$request = db_query("
SELECT pmr.ID_PM, mem_to.ID_MEMBER AS ID_MEMBER_TO, mem_to.realName AS toName, pmr.bcc" . ($context['folder'] == 'outbox' ? ", pmr.is_read" : '') . "
FROM {$db_prefix}im_recipients AS pmr
LEFT JOIN {$db_prefix}members AS mem_to ON (mem_to.ID_MEMBER = pmr.ID_MEMBER)
WHERE pmr.ID_PM IN (" . implode(', ', $pms) . ")" . ($context['folder'] == 'outbox' ? '' : "
AND pmr.bcc = 0"), __FILE__, __LINE__);

Find
Code: [Select]
while ($row = mysql_fetch_assoc($request))
$recipients[$row['ID_PM']][empty($row['bcc']) ? 'to' : 'bcc'][] = empty($row['ID_MEMBER_TO']) ? $txt[28] : '<a href="' . $scripturl . '?action=profile;u=' . $row['ID_MEMBER_TO'] . '">' . $row['toName'] . '</a>';

Replace
Code: [Select]
while ($row = mysql_fetch_assoc($request))
{
$recipients[$row['ID_PM']][empty($row['bcc']) ? 'to' : 'bcc'][] = empty($row['ID_MEMBER_TO']) ? $txt[28] : '<a href="' . $scripturl . '?action=profile;u=' . $row['ID_MEMBER_TO'] . '">' . $row['toName'] . '</a>';
if($context['folder'] == 'outbox')
{
$recipients[$row['ID_PM']]['is_read'] = $row['is_read'];
}
}
            

Themes/default/InstantMessage.template.php

Find
Code: [Select]
<div style="overflow: auto; width: 100%;">', $message['body'], '</div>
Add after
Code: [Select]
';
if($context['folder'] == 'outbox')
{
echo '<br />';
foreach($message['recipients']['to'] as $person)
{
echo $person . ($message['recipients']['is_read'] == '1' ? ' has' : ' hasn\'t') . ' read this message.<br />';
}
}

That should work... If it doesn't, let me know and I'll try to fix it :)

Hello.
I tried to modify as suggested above,but unfortunately it did not work for me :(

Also...now I am getting the following error:

Parse error: parse error, unexpected T_ELSE in /membri/stormforum/smf/Sources/InstantMessage.php on line 272

and do not know why.No way to get PM's  working now:everything messed up!
MemberColorMod has been installed.

Any suggestion please about how to fix the parse error mentioned above and most important to get mp working?

Thanks ;)

Offline Kaon

  • Semi-Newbie
  • *
  • Posts: 54
Re: PM Receipt Confirmation
« Reply #9 on: August 24, 2005, 04:32:11 AM »
Definitly, a way to know if a PM was read will be really interesting.

Offline Sanandreas

  • Semi-Newbie
  • *
  • Posts: 16
Re: PM Receipt Confirmation
« Reply #10 on: August 24, 2005, 06:49:34 AM »
Quote from: Sanandreas

Hello.
I tried to modify as suggested above,but unfortunately it did not work for me :(

Also...now I am getting the following error:

Parse error: parse error, unexpected T_ELSE in /membri/stormforum/smf/Sources/InstantMessage.php on line 272

and do not know why.No way to get PM's  working now:everything messed up!
MemberColorMod has been installed.

Any suggestion please about how to fix the parse error mentioned above and most important to get mp working?

Thanks ;)

Hello again.. ;)
Found a way to fix the problem above...

Modifying this:
Quote
while ($row = mysql_fetch_assoc($request))

      {

         $recipients[$row['ID_PM']][empty($row['bcc']) ? 'to' : 'bcc'][] = empty($row['ID_MEMBER_TO']) ? $txt[28] : '<a href="' . $scripturl . '?action=profile;u=' . $row['ID_MEMBER_TO'] . '">' . $row['toName'] . '</a>';

         if($context['folder'] == 'outbox')

         {

            $recipients[$row['ID_PM']]['is_read'] = $row['is_read'];

         }

      }

the last bracket has to be deleted and error is fixed


the last  suggested modify...

Quote
</td>

                        </tr></table>

                        <hr width="100%" size="1" class="hrcolor" />

                        <div style="overflow: auto; width: 100%;">', $message['body'], '</div>

';
if($context['folder'] == 'outbox')

{

   echo '<br />';

   foreach($message['recipients']['to'] as $person)

   {

      echo $person . ($message['recipients']['is_read'] == '1' ? ' has' : ' hasn\'t') . ' read this message.<br />';

   }

}




                     </td>  (line 228)

                  </tr>

                  <tr class="', $windowcss, '">

                     <td valign="bottom" class="smalltext" width="85%">';

the following error occurs:
Parse error: parse error, unexpected '<' in /membri/stormforum/smf/Themes/default/InstantMessage.template.php on line 228

Feels like there is something more to add or delete.. ???
 ;)
« Last Edit: August 24, 2005, 06:59:42 AM by Sanandreas »

Offline xenovanis

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 12,988
  • Gender: Female
Re: PM Receipt Confirmation
« Reply #11 on: August 24, 2005, 09:30:03 AM »
add an

Code: [Select]
echo '
between } en </td> on line 227.
"Insanity: doing the same thing over and over again and expecting different results."

Offline Sanandreas

  • Semi-Newbie
  • *
  • Posts: 16
Re: PM Receipt Confirmation
« Reply #12 on: August 24, 2005, 10:10:02 AM »
Ciao again ;)
@Xenovanis:
I just did as you suggested and now the whole thing works great,like a charm :) :) :)
Thank you very much for your help,it has been really useful
 ;)


Offline rojamaia

  • Semi-Newbie
  • *
  • Posts: 83
Re: PM Receipt Confirmation
« Reply #13 on: August 27, 2005, 02:43:37 AM »


hi! this one is a good hack! a lot of users will really appreciate this.  and hope that this comes in the next releases.

i just have one more request to you guys, though...  can you please make an edit at the first code post, and note that it's edited and final, so that others will not have to follow the edits down the responses anymore?  thanks a lot!  :D


Offline WraithWatcher

  • Semi-Newbie
  • *
  • Posts: 17
Re: PM Receipt Confirmation
« Reply #14 on: December 14, 2005, 07:36:42 AM »


hi! this one is a good hack! a lot of users will really appreciate this.  and hope that this comes in the next releases.

i just have one more request to you guys, though...  can you please make an edit at the first code post, and note that it's edited and final, so that others will not have to follow the edits down the responses anymore?  thanks a lot!  :D



Has this been done or do I need to follow each of the steps above???  Thanks :D

Offline spicyjoe

  • Semi-Newbie
  • *
  • Posts: 69
Re: PM Receipt Confirmation
« Reply #15 on: January 19, 2006, 07:14:53 AM »
hey i installed this modification and its pretty good.. but how can i make the alert comes out when the page is loaded finish?

Offline SleePy

  • Site Team Lead
  • SMF Master
  • *
  • Posts: 29,928
  • Gender: Male
  • Thats his happy face.
    • jdarwood007 on GitHub
    • @jdarwood on Twitter
    • SleePy Code - My personal site
Re: PM Receipt Confirmation
« Reply #16 on: January 20, 2006, 11:04:55 PM »
id like to note that for rc2.
its Sources/PersonalMessage.php
Themes/default/PersonalMesssage.template.php

and
Sources/PersonalMessage.php

Find
Code: [Select]
             // Get recipients (don't include bcc-recipients for your inbox, you're not supposed to know :P).
          $request = db_query("
                      SELECT pmr.ID_PM, mem_to.ID_MEMBER AS ID_MEMBER_TO, mem_to.realName AS toName, pmr.bcc
                        FROM {$db_prefix}pm_recipients AS pmr
                             LEFT JOIN {$db_prefix}members AS mem_to ON (mem_to.ID_MEMBER = pmr.ID_MEMBER)
                        WHERE pmr.ID_PM IN (" . implode(', ', $pms) . ")" . ($context['folder'] == 'outbox' ? '' : "
                               AND pmr.bcc = 0"), __FILE__, __LINE__);

Replace
Code: [Select]
           // Get recipients (don't include bcc-recipients for your inbox, you're not supposed to know :P).
          $request = db_query("
                      SELECT pmr.ID_PM, mem_to.ID_MEMBER AS ID_MEMBER_TO, mem_to.realName AS toName, pmr.bcc" . ($context['folder'] == 'outbox' ? ", pmr.is_read" : '') . "
                     FROM {$db_prefix}pm_recipients AS pmr
                             LEFT JOIN {$db_prefix}members AS mem_to ON (mem_to.ID_MEMBER = pmr.ID_MEMBER)
                        WHERE pmr.ID_PM IN (" . implode(', ', $pms) . ")" . ($context['folder'] == 'outbox' ? '' : "
                               AND pmr.bcc = 0"), __FILE__, __LINE__);

all that needs done to work with rc2 is this line:
                     FROM {$db_prefix}im_recipients AS pmr
changed to
                     FROM {$db_prefix}pm_recipients AS pmr

Jeremy D — Site Team / SMF Developer
Support the SMF Support team!
Profiles:
GitHub

Offline RvG

  • Jr. Member
  • **
  • Posts: 150
  • Gender: Male
Re: PM Receipt Confirmation
« Reply #17 on: January 06, 2007, 01:50:02 PM »
should be part on a standard smf install :)

Offline Cebby

  • Semi-Newbie
  • *
  • Posts: 12
Re: PM Receipt Confirmation
« Reply #18 on: April 14, 2007, 11:28:59 PM »
OK - trying to make this work for 1.1.2...

In PersonalMessage.php, this string is found twice:

Code: [Select]
$recipients[$row['ID_PM']][empty($row['bcc']) ? 'to' : 'bcc'][] = empty($row['ID_MEMBER_TO']) ? $txt[28] : '<a href="' . $scripturl . '?action=profile;u=' . $row['ID_MEMBER_TO'] . '">' . $row['toName'] . '</a>';

Which is a part of this code that was to be searched for per the post by Oldiesmann:

Code: [Select]
while ($row = mysql_fetch_assoc($request))
$recipients[$row['ID_PM']][empty($row['bcc']) ? 'to' : 'bcc'][] = empty($row['ID_MEMBER_TO']) ? $txt[28] : '<a href="' . $scripturl . '?action=profile;u=' . $row['ID_MEMBER_TO'] . '">' . $row['toName'] . '</a>';

BUT, it is not found exactly as shown.

What we have instead is THIS in two places:

Code: [Select]
while ($row = mysql_fetch_assoc($request))
{
if ($context['folder'] == 'outbox' || empty($row['bcc']))
$recipients[$row['ID_PM']][empty($row['bcc']) ? 'to' : 'bcc'][] = empty($row['ID_MEMBER_TO']) ? $txt[28] : '<a href="' . $scripturl . '?action=profile;u=' . $row['ID_MEMBER_TO'] . '">' . $row['toName'] . '</a>';

if ($row['ID_MEMBER_TO'] == $ID_MEMBER && $context['folder'] != 'outbox')
{
$context['message_replied'][$row['ID_PM']] = $row['is_read'] & 2;

I made the template edit (put it right under where it says when the message was sent instead of in the message body per the template edit listed in this thread - if anyone is interested, I'll post up).

The problem is that it doesn't show as "has read", only as "hasn't read" (even though I'm sure the message has been read).

Can anyone help fine tune this for 1.1.2?  I really need this mod!!

TIA

« Last Edit: April 14, 2007, 11:30:58 PM by Cebby »

Offline MarkoWeb

  • SMF Hero
  • ******
  • Posts: 2,690
  • Gender: Male
    • A2-Soft.Com - Web Portal
Re: PM Receipt Confirmation
« Reply #19 on: April 17, 2007, 06:26:52 PM »
1.1.2?