News:

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

Main Menu

PM Receipt Confirmation

Started by Pause, December 09, 2004, 07:18:21 AM

Previous topic - Next topic

Pause

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?
"You and me, inside that box, now." - The Doctor

Bite Fusion
Fusion Web Network
VG Fusion
Wrestling Fusion + Wrestling Fusion Forums

Trekkie101

Hope not, that bugs the living daylights out of me, drives me mad having to click CANCEL at everymessage, its actually never really worked.

Pause

Quote from: Trekkie101 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.
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...
"You and me, inside that box, now." - The Doctor

Bite Fusion
Fusion Web Network
VG Fusion
Wrestling Fusion + Wrestling Fusion Forums

orange

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.

Oldiesmann

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
// 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
// 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
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
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
<div style="overflow: auto; width: 100%;">', $message['body'], '</div>

Add after
';
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
Christian Metal Fans

FaSan

Little Bug.

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

ryanbsoftware

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. ;)

FaSan

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

Sanandreas

Quote from: Oldiesmann 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
// 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
// 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
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
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
<div style="overflow: auto; width: 100%;">', $message['body'], '</div>

Add after
';
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 [nofollow] 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 ;)

Kaon

Definitly, a way to know if a PM was read will be really interesting.

Sanandreas

#10
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 [nofollow] 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:
Quotewhile ($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.. ???
;)

xenovanis

add an


echo '


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

Sanandreas

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
;)


rojamaia



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


WraithWatcher

Quote from: malinaobenny 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



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

spicyjoe

hey i installed this modification and its pretty good.. but how can i make the alert comes out when the page is loaded finish?

SleePy

id like to note that for rc2.
its Sources/PersonalMessage.php
Themes/default/PersonalMesssage.template.php

and
Sources/PersonalMessage.php

Find

             // 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

           // 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 ~ GitHub Profile ~ Join us on IRC @ Libera.chat/#smf ~ Support the SMF Support team!

RvG

should be part on a standard smf install :)

Cebby

#18
OK - trying to make this work for 1.1.2...

In PersonalMessage.php, this string is found twice:

$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:

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:

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



Advertisement: