Simple Machines Community Forum

Customizing SMF => Tips and Tricks => Thema gestartet von: Pause in Dezember 09, 2004, 07:18:21 VORMITTAG

Titel: PM Receipt Confirmation
Beitrag von: Pause in Dezember 09, 2004, 07:18:21 VORMITTAG
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?
Titel: Re: PM Receipt Confirmation
Beitrag von: Trekkie101 in Dezember 09, 2004, 09:57:33 VORMITTAG
Hope not, that bugs the living daylights out of me, drives me mad having to click CANCEL at everymessage, its actually never really worked.
Titel: Re: PM Receipt Confirmation
Beitrag von: Pause in Dezember 10, 2004, 05:54:28 VORMITTAG
Zitat von: Trekkie101 in Dezember 09, 2004, 09:57:33 VORMITTAG
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...
Titel: Re: PM Receipt Confirmation
Beitrag von: orange in Dezember 10, 2004, 01:20:22 NACHMITTAGS
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.
Titel: Re: PM Receipt Confirmation
Beitrag von: Oldiesmann in Dezember 11, 2004, 07:01:56 NACHMITTAGS
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 :)
Titel: Re: PM Receipt Confirmation
Beitrag von: FaSan in Dezember 13, 2004, 06:00:10 VORMITTAG
Little Bug.

It's notify as read if the read as bcc user
Titel: Re: PM Receipt Confirmation
Beitrag von: ryanbsoftware in Dezember 13, 2004, 11:53:18 VORMITTAG
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. ;)
Titel: Re: PM Receipt Confirmation
Beitrag von: FaSan in Januar 09, 2005, 03:26:42 NACHMITTAGS
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
Titel: Re: PM Receipt Confirmation
Beitrag von: Sanandreas in August 23, 2005, 05:42:49 NACHMITTAGS
Zitat von: Oldiesmann in Dezember 11, 2004, 07:01:56 NACHMITTAGS
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 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 ;)
Titel: Re: PM Receipt Confirmation
Beitrag von: Kaon in August 24, 2005, 04:32:11 VORMITTAG
Definitly, a way to know if a PM was read will be really interesting.
Titel: Re: PM Receipt Confirmation
Beitrag von: Sanandreas in August 24, 2005, 06:49:34 VORMITTAG
Zitat von: 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:
Zitatwhile ($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...

Zitat</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.. ???
;)
Titel: Re: PM Receipt Confirmation
Beitrag von: xenovanis in August 24, 2005, 09:30:03 VORMITTAG
add an


echo '


between } en </td> on line 227.
Titel: Re: PM Receipt Confirmation
Beitrag von: Sanandreas in August 24, 2005, 10:10:02 VORMITTAG
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
;)

Titel: Re: PM Receipt Confirmation
Beitrag von: rojamaia in August 27, 2005, 02:43:37 VORMITTAG


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

Titel: Re: PM Receipt Confirmation
Beitrag von: WraithWatcher in Dezember 14, 2005, 07:36:42 VORMITTAG
Zitat von: malinaobenny in August 27, 2005, 02:43:37 VORMITTAG


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
Titel: Re: PM Receipt Confirmation
Beitrag von: spicyjoe in Januar 19, 2006, 07:14:53 VORMITTAG
hey i installed this modification and its pretty good.. but how can i make the alert comes out when the page is loaded finish?
Titel: Re: PM Receipt Confirmation
Beitrag von: SleePy in Januar 20, 2006, 11:04:55 NACHMITTAGS
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

Titel: Re: PM Receipt Confirmation
Beitrag von: RvG in Januar 06, 2007, 01:50:02 NACHMITTAGS
should be part on a standard smf install :)
Titel: Re: PM Receipt Confirmation
Beitrag von: Cebby in April 14, 2007, 11:28:59 NACHMITTAGS
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

Titel: Re: PM Receipt Confirmation
Beitrag von: MarkoWeb in April 17, 2007, 06:26:52 NACHMITTAGS
1.1.2?
Titel: Re: PM Receipt Confirmation
Beitrag von: Cebby in April 26, 2007, 04:46:36 NACHMITTAGS
Zitat von: Marko_ in April 17, 2007, 06:26:52 NACHMITTAGS
1.1.2?

1.1.2 = latest SMF release
Titel: Re: PM Receipt Confirmation
Beitrag von: pongsak in Mai 01, 2007, 08:40:00 NACHMITTAGS
1.1.2 it's work for me
only correct 1 site near the original select query, others's same mod. as above.
Titel: Re: PM Receipt Confirmation
Beitrag von: pongsak in Mai 09, 2007, 07:05:13 VORMITTAG
After 1 wk used of this trick, i found that if i send for same member many pms , it shown only read one , the others unread.
But if one by one , it's ok.
Titel: Re: PM Receipt Confirmation
Beitrag von: jaceman in Mai 30, 2007, 07:10:19 NACHMITTAGS
Can anyone help me to implement this?  The thread started years ago and SMF has changed a lot.  I'd like a ready to go mod for this (anything else is probably going to result in me destroying my forum), but am willing to give it an attempt if someone can walk me through it.

I don't know enough about SMF to know what to apply from those who posted in 2005 with those who have posted this year.  I would be EXTREMELY grateful if someone could list all of the files in SMF 1.1.2 that need to be changed to get this working and exactly what those changes are.

Also, if possible, confirm my suspicion.  I am assuming that if I manually update the code to add this NEEDED feature, if we upgrade our forum later I will have to manually make the changes again.  Correct?

Thanks in advance.
Titel: Re: PM Receipt Confirmation
Beitrag von: razorblitz07 in Mai 16, 2008, 01:34:43 VORMITTAG
Resurrecting the topic....

Any way of making the pm read receipt code work for v1.1.5 and higher?
Titel: Re: PM Receipt Confirmation
Beitrag von: icon in Mai 26, 2008, 06:31:28 NACHMITTAGS
could somebody post the final codes needed for this modification?
Titel: Re: PM Receipt Confirmation
Beitrag von: razorblitz07 in Juni 08, 2008, 09:45:41 NACHMITTAGS
Yes, is there a final script for this...one that works with 1.1.5?
Titel: Re: PM Receipt Confirmation
Beitrag von: N3RVE in Juni 20, 2008, 02:07:12 NACHMITTAGS
Someone already requested :)
http://www.simplemachines.org/community/index.php?topic=245428

However, there were Template Changes from SMF 1.1.2 to 1.1.5 (http://www.simplemachines.org/community/index.php?topic=239512.0)

-[n3rve]
Titel: Re: PM Receipt Confirmation
Beitrag von: Kalina in Oktober 27, 2008, 04:01:36 NACHMITTAGS
I just installed this in 1.1.6 and it's working. I will share what I did.

Sources/PersonalMessage.php

Find:
            SELECT pmr.ID_PM, mem_to.ID_MEMBER AS ID_MEMBER_TO, mem_to.realName AS toName, pmr.bcc, pmr.labels, pmr.is_read

Replace:
            SELECT pmr.ID_PM, mem_to.ID_MEMBER AS ID_MEMBER_TO, mem_to.realName AS toName, pmr.bcc, pmr.labels, pmr.is_read" . ($context['folder'] == 'outbox' ? ", pmr.is_read" : '') . "

Find 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>';

Add After Each Instance:
         if($context['folder'] == 'outbox')
         {
            $recipients[$row['ID_PM']]['is_read'] = $row['is_read'];
         }


Themes/default/PersonalMessage.template.php

Find:
                        <div class="personalmessage">', $message['body'], '</div>

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

{

   echo '<br /><div class="windowbg2" style="padding:3px">';

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

   {

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

   }

}
echo '


Now go view a message in your outbox to see how it looks. ;)
Titel: Re: PM Receipt Confirmation
Beitrag von: genieuk in Oktober 27, 2008, 04:43:35 NACHMITTAGS
Very nice,

can you tell me something before i go ahead, when you send a PM to someone do they get asked to send a read recipent PM back or does it just send one back anyway?

Also can this be disabled in admin or can a member disable via there account?

Thank you,
Mathew
Titel: Re: PM Receipt Confirmation
Beitrag von: Kalina in Oktober 27, 2008, 05:09:11 NACHMITTAGS
They don't get asked, it automatically detects if it was read or not, and there's no admin/member options.
Titel: Re: PM Receipt Confirmation
Beitrag von: genieuk in Oktober 27, 2008, 05:19:32 NACHMITTAGS
ok thanks, would be good for member to turn on or off thou as some might get fed up with having a PM back to say they read it specially if they choose to receive an email when they get PM.

Thank you
Mathew
Titel: Re: PM Receipt Confirmation
Beitrag von: Kalina in Oktober 27, 2008, 05:21:25 NACHMITTAGS
I agree but I'm not really a programmer so I wouldn't know how to make it, hopefully someone else does and will! :)

You don't get a pm back btw, it's just placed in your sent pm's content, under what you typed to the other person it will say if they read it or not, no one even knows it's there unless they view their own sent pm's. ;)
Titel: Re: PM Receipt Confirmation
Beitrag von: genieuk in Oktober 27, 2008, 05:52:02 NACHMITTAGS
Zitat von: Kalina in Oktober 27, 2008, 05:21:25 NACHMITTAGS
I agree but I'm not really a programmer so I wouldn't know how to make it, hopefully someone else does and will! :)

You don't get a pm back btw, it's just placed in your sent pm's content, under what you typed to the other person it will say if they read it or not, no one even knows it's there unless they view their own sent pm's. ;)

ah rite, i understand now,

thanks
Mathew
Titel: Re: PM Receipt Confirmation
Beitrag von: fredda88 in Oktober 28, 2008, 05:48:05 NACHMITTAGS
I get:

Template Parse Error!
There was a problem loading the /Themes/default/PersonalMessage.template.php template or language file. Please check the syntax and try again - remember, single quotes (') often have to be escaped with a slash (\). To see more specific error information from PHP, try accessing the file directly.

You may want to try to refresh this page or use the default theme.
--------------------------------------------------------------------------------

parse error, unexpected T_STRING


I double checked what i edited and as far as i can see i followed your example.
Titel: Re: PM Receipt Confirmation
Beitrag von: Kalina in Oktober 28, 2008, 06:03:31 NACHMITTAGS
Zitat von: fredda88 in Oktober 28, 2008, 05:48:05 NACHMITTAGS

I double checked what i edited and as far as i can see i followed your example.

Can you post your PersonalMessage.template.php?
Titel: Re: PM Receipt Confirmation
Beitrag von: fredda88 in Oktober 28, 2008, 07:49:16 NACHMITTAGS
Ok, here it is without the mod!

edit: hmm... can't post that long textfiles, anyway i compared (with ultraedit) the one on the server with a fresh one and there are no differences.

This is how i inserted your mod:

<div class="personalmessage">', $message['body'], '</div>
';
if($context['folder'] == 'outbox')

{

   echo '<br /><div class="windowbg2" style="padding:3px">';

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

   {

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

   }

}
echo '

</td>
</tr>
<tr class="', $windowcss, '">
<td valign="bottom" class="smalltext" width="85%">
', (!empty($modSettings['enableReportPM']) && $context['folder'] != 'outbox' ? '<div align="right"><a href="' . $scripturl . '?action=pm;sa=report;l=' . $context['current_label_id'] . ';pmsg=' . $message['id'] . '" class="smalltext">' . $txt['pm_report_to_admin'] . '</a></div>' : '');
Titel: Re: PM Receipt Confirmation
Beitrag von: SpectroPro in Oktober 30, 2008, 09:18:59 VORMITTAG
Anyone do this for 2b4?  I think it would be a great feature if it added a colum to your sent messages page..  That column would say:  read  or  unread  depending on the status..  This way, you can see at a glance.

Date       Subject            To         Read/Unread


That would be a perfect add-on!!!!

And from an early post..  I agree, the way messages are displayed needs to change..  Just show the subjects and NOT the actual messages under them...  ONLY show messages if the subject is clicked in the list...
Titel: Re: PM Receipt Confirmation
Beitrag von: Kalina in Oktober 30, 2008, 05:55:07 NACHMITTAGS
fredda, you're missing the slash in "hasn't", please use this:

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

{

    echo '<br /><div class="windowbg2" style="padding:3px">';

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

    {

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

    }

}
echo '


I will see if I can edit my post above to fix it.
Titel: Re: PM Receipt Confirmation
Beitrag von: fredda88 in Oktober 30, 2008, 06:13:31 NACHMITTAGS
That did it.

Thanks!
Titel: Re: PM Receipt Confirmation
Beitrag von: Kalina in Oktober 30, 2008, 06:22:39 NACHMITTAGS
Zitat von: SpectroPro in Oktober 30, 2008, 09:18:59 VORMITTAG
Anyone do this for 2b4?  I think it would be a great feature if it added a colum to your sent messages page..  That column would say:  read  or  unread  depending on the status..  This way, you can see at a glance.

Date       Subject            To         Read/Unread
Hi, I just did this for the 1.1.6 version, unfortunately, I have no experience with 2b4, but for anyone who wants it as a column instead, here's how to do it.

Do the same edits above to the other files I listed, but do this instead with this file:

Themes/default/PersonalMessage.template.php

Find
<td align="center" width="24"><input type="checkbox" onclick="invertAll(this, this.form);" class="check" /></td>

Add Above
';
if($context['folder'] == 'outbox')
{
    echo '<td align="center"><b>Status</b></td>';
}
echo '


Find
            <td>', ($context['from_or_to'] == 'from' ? $message['member']['link'] : (empty($message['recipients']['to']) ? '' : implode(', ', $message['recipients']['to']))), '</td>

Add Below
';
if($context['folder'] == 'outbox')
{
    echo '<td class="windowbg2 smalltext" align="center">'. ($message['recipients']['is_read'] == '1' ? 'read' : 'unread') .'</td>';
}
echo '

Titel: Re: PM Receipt Confirmation
Beitrag von: SpectroPro in Oktober 31, 2008, 12:56:44 VORMITTAG
Working on this for 2b4...  The files are almost exactly the same, save for some case issues...  So I made all the changes you describe..  I get this error:

Parse error: syntax error, unexpected T_STRING in /home/sssss/public_html/ssss/ssss/Sources/PersonalMessage.php on line 723

That line is this:

         SELECT pmr.id_pm, mem_to.id_member AS id_member_to, mem_to.real_name AS to_name, pmr.bcc, pmr.labels, pmr.is_read" . ($context['folder'] == 'outbox' ? ", pmr.is_read" : '') . "


what would cause that?
Titel: Re: PM Receipt Confirmation
Beitrag von: palofdru in Oktober 31, 2008, 01:11:37 VORMITTAG
Zitat von: SpectroPro in Oktober 30, 2008, 09:18:59 VORMITTAG
Anyone do this for 2b4?  I think it would be a great feature if it added a colum to your sent messages page..  That column would say:  read  or  unread  depending on the status..  This way, you can see at a glance.

Date       Subject            To         Read/Unread


That would be a perfect add-on!!!!

And from an early post..  I agree, the way messages are displayed needs to change..  Just show the subjects and NOT the actual messages under them...  ONLY show messages if the subject is clicked in the list...

i agree
Titel: Re: PM Receipt Confirmation
Beitrag von: Sabre™ in November 03, 2008, 05:32:58 VORMITTAG
Very nice.
Have been looking for such a thing for awhile.

Good job also Kalina :)

Would anyone be able to make the "unread" text display as red, and the "read" display as green?

Colours help the elder members identify with the result more comfortably etc

ThankYou for any assistance
Titel: Re: PM Receipt Confirmation
Beitrag von: palofdru in November 03, 2008, 12:40:40 NACHMITTAGS
Zitat von: Sabre™ in November 03, 2008, 05:32:58 VORMITTAG
Very nice.
Have been looking for such a thing for awhile.

Good job also Kalina :)

Would anyone be able to make the "unread" text display as red, and the "read" display as green?

Colours help the elder members identify with the result more comfortably etc

ThankYou for any assistance

^ If that is the case, you may want to have an unread icon as well as a 'read' icon, since
a. People may have difficulty differentiating between red/green.
b. Those colors may have conflicts with the current themes color scheme
Titel: Re: PM Receipt Confirmation
Beitrag von: SpectroPro in November 03, 2008, 02:56:31 NACHMITTAGS
BUMP

Zitat von: SpectroPro in Oktober 31, 2008, 12:56:44 VORMITTAG
Working on this for 2b4...  The files are almost exactly the same, save for some case issues...  So I made all the changes you describe..  I get this error:

Parse error: syntax error, unexpected T_STRING in /home/sssss/public_html/ssss/ssss/Sources/PersonalMessage.php on line 723

That line is this:

         SELECT pmr.id_pm, mem_to.id_member AS id_member_to, mem_to.real_name AS to_name, pmr.bcc, pmr.labels, pmr.is_read" . ($context['folder'] == 'outbox' ? ", pmr.is_read" : '') . "


what would cause that?


Anyone can help me with this....greatly appreciated..  You can PM me, yahoo, msn, aim...  Would LOVE to get this working on 2b4....
Titel: Re: PM Receipt Confirmation
Beitrag von: palofdru in November 03, 2008, 07:23:13 NACHMITTAGS
parse errors are almost always caused by a unterminated string or some structural error. This error occurs BEFORE the PHP interpreter has even been able to look at code.

The line of code you have here is incomplete, repost with the 4 lines before and the 4 lines after that line you have.
Titel: Re: PM Receipt Confirmation
Beitrag von: SpectroPro in November 03, 2008, 08:10:04 NACHMITTAGS
Here is that entire section of code:  (and yeah, I was reading about that error on a php site, and checked everything they suggested, but damned if I see the error....)

// Get recipients (don't include bcc-recipients for your inbox, you're not supposed to know :P).
$request = $smcFunc['db_query']('', '
SELECT pmr.id_pm, mem_to.id_member AS id_member_to, mem_to.real_name AS to_name, pmr.bcc, pmr.labels, pmr.is_read" . ($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 ({array_int:pm_list})',
array(
'pm_list' => $all_pms,
)
);
Titel: Re: PM Receipt Confirmation
Beitrag von: Sabre™ in November 04, 2008, 01:54:11 VORMITTAG
Zitat von: palofdru in November 03, 2008, 12:40:40 NACHMITTAGS
If that is the case, you may want to have an unread icon as well as a 'read' icon

Thats not a bad idea.
Are you gonna offer a solution, or just the idea?

Zitat von: palofdru in November 03, 2008, 12:40:40 NACHMITTAGS
b. Those colors may have conflicts with the current themes color scheme

My theme is dark.
Red n green stand out so well that I use them for various site messages.
So no problem for my theme, but your icon idea seems the better way to go about it
Titel: Re: PM Receipt Confirmation
Beitrag von: SpectroPro in November 04, 2008, 02:54:19 NACHMITTAGS
Zitat von: Sabre™ in November 04, 2008, 01:54:11 VORMITTAG

My theme is dark.
Red n green stand out so well that I use them for various site messages.
So no problem for my theme, but your icon idea seems the better way to go about it

No matter the background, red and green are actually the 2 colors that most color blind people can NOT distinguish..  They see something, just can't tell you the color.

Greg
Titel: Re: PM Receipt Confirmation
Beitrag von: Sabre™ in November 04, 2008, 03:24:18 NACHMITTAGS
You assume people do not know that?
Thats why they then notice what the words are, assuming they can still read also ;)
Anyway, I wasnt asking about people that are colour blind, so I dont know why it is being spoken of.
I have since added buttons/images, so thank you come again.
Titel: Re: PM Receipt Confirmation
Beitrag von: SpectroPro in November 04, 2008, 03:44:41 NACHMITTAGS
Zitat von: Sabre™ in November 03, 2008, 05:32:58 VORMITTAG
Very nice.
Have been looking for such a thing for awhile.

Good job also Kalina :)

Would anyone be able to make the "unread" text display as red, and the "read" display as green?

Colours help the elder members identify with the result more comfortably etc

ThankYou for any assistance


THAT is why I posted it..  RED and GREEN are the two worst colors to use, especially for older and or color blind people.  So yes, I presumed you did NOT know that.
Titel: Re: PM Receipt Confirmation
Beitrag von: Sabre™ in November 04, 2008, 04:21:09 NACHMITTAGS
Presumption was wrong.
We cannot cater to everybody, but merely limit the gaps :)
Otherwise we may aswell cater to the blind also, as they cannot tell red or green too!
Did you know that? :D
I thought of it once, but it is just too much work, especially embedding code so when they mouse over an image, it will describe what that image is...
Not too difficult, just time consuming.

Now see how my asking for colours, has moved from colour blind people, to the blind!??
Funny how people like to change a question to suit them isnt it? :)

pmsl
Titel: Re: PM Receipt Confirmation
Beitrag von: SpectroPro in November 05, 2008, 02:22:30 VORMITTAG
Ok.. I fixed the error that was coming up on 723.  the " needed to be '

That done, the page loaded, but didn't see anything at all.

I then made the mod to show a column.  No error, but still see nothing at all different.  So I am apparently missing something in the code.  Maybe the window being called is not named properly...or something.. 

Here is what I did to get it to NOT give an error in 2b4 (but again, no change in appearance at all)

ZitatSources/PersonalMessage.php

Find:
Code:

      SELECT pmr.id_pm, mem_to.id_member AS id_member_to, mem_to.real_name AS to_name, pmr.bcc, pmr.labels, pmr.is_read


Replace:
Code:
           SELECT pmr.id_pm, mem_to.id_member AS id_member_to, mem_to.real_name AS to_name, pmr.bcc, pmr.labels, pmr.is_read' . ($context['folder'] == 'outbox' ? ', pmr.is_read' : '') . '




Find Twice:
Code:
      $recipients[$row['id_pm']][empty($row['bcc']) ? 'to' : 'bcc'][] = empty($row['id_member_to']) ? $txt['guest_title'] : '<a href="' . $scripturl . '?action=profile;u=' . $row['id_member_to'] . '">' . $row['to_name'] . '</a>';


Add After Each Instance:
Code:
         if($context['folder'] == 'outbox')
         {
            $recipients[$row['id_pm']]['is_read'] = $row['is_read'];
         }


Themes/default/PersonalMessage.template.php

Find:
Code:
                        <div class="personalmessage">', $message['body'], '</div>

Add After:
Code:
';
if($context['folder'] == 'outbox')

{

   echo '<br /><div class="windowbg2" style="padding:3px">';

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

   {

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

   }

}
echo '

Find
Code:
<td align="center" width="24"><input type="checkbox" onclick="invertAll(this, this.form);" class="check" /></td>

Add Above
Code:
';
if($context['folder'] == 'outbox')
{
    echo '<td align="center"><b>Status</b></td>';
}
echo '


Find
Code:
            <td>', ($context['from_or_to'] == 'from' ? $message['member']['link'] : (empty($message['recipients']['to']) ? '' : implode(', ', $message['recipients']['to']))), '</td>

Add Below
Code:
';
if($context['folder'] == 'outbox')
{
    echo '<td class="windowbg2 smalltext" align="center">'. ($message['recipients']['is_read'] == '1' ? 'read' : 'unread') .'</td>';
}
echo '

The find's work perfectly for 2b4 now..  there were case issues from the 1.6 version... 

If anyone can shed some light on this, I know many would be grateful.  I know I will....  If I find the answer, I'll post it as well.

Greg

----------------
Greg is currently listening to: Flo Rida - Low (http://www.foxytunes.com/artist/flo+rida/track/low)
via FoxyTunes (http://www.foxytunes.com/signatunes/)
Titel: Re: PM Receipt Confirmation
Beitrag von: Sabre™ in Dezember 07, 2008, 04:54:19 VORMITTAG
For anybody that wonders through this thread, I package all tips etc so I can easily uninstall the edits if needed.

Thought I'd share it for those that are uneasy with manual edits, or who just wanna make life easier for themselves lol
[HERE] (http://www.zshare.net/download/52376570ba48b76b/) are Kalinas edits for this tip packaged.

Sorry for the link, cannot attach in this Category

EDIT:
This is for 1.1.x   not SMF 2
Titel: Re: PM Receipt Confirmation
Beitrag von: katib in Dezember 19, 2008, 11:08:21 VORMITTAG
Thanks SpectroPro
Zitat von: SpectroPro in November 05, 2008, 02:22:30 VORMITTAG
The find's work perfectly for 2b4 now..  there were case issues from the 1.6 version...
If anyone can shed some light on this,
I also will be waiting for anyone willing to shed some light on this in order to use this great mod on SMF2beta4