1

Topic: Hard Cover Tute: Have PM message been read or not.

When somebody in love and wrote message to his sweetheart he badly need to know have She read his message

Keep your users informed whether their message been read or not.
It took me 5 minutes to invent,
it will take you 30 seconds to implement.

Actually it's totally based on existing code.

Open your lib.account_messages.php and find: function show_sent($page)

About 50 lines below find (line 991 of commercial version): $fields[$i]['message_id'] = $obj['message_id'];

And add below it:

$fields[$i]['message_nonread'] = $obj['new'];

Open your account_messages_sent.tpl and find:    

<a href="{top.virtual_path}{message_link}">{message_subject}</a>

And add: &nbsp;<sup><!-- IF message_nonread -->Non-read<!-- ELSE -->Read<!-- ENDIF --></sup>
right after it so it become:

<a href="{top.virtual_path}{message_link}">{message_subject}</a>&nbsp;<sup><!-- IF message_nonread -->Non-read<!-- ELSE -->Read<!-- ENDIF --></sup>

Test it! smile

Now you can customize the results: show closed and opened envelope instead of words etc. Moreover you can give that feature only to your paid members.


P.S.: It took me 15 minutes to write this shortest tutorial smile

2

Re: Hard Cover Tute: Have PM message been read or not.

Thank you once again again!!! smile
I tryed it, and it worked very well smile
However, I made the "Non-read" red for an easy overview...

3

Re: Hard Cover Tute: Have PM message been read or not.

hi radioact ,this is a great feature.
please excuse if there is already an answer to this as im new.but can the same feature display an open or closed envelope for read or unread mail to display for the members inbox mail.at the moment it displays the message in bold if unread..
thanks

4

Re: Hard Cover Tute: Have PM message been read or not.

I have tryed something like this with succes:

&nbsp;<!-- IF message_nonread --><img src="http://www.YOUR-HOMEPAGE.COM/templates/YOUR-TEMPLATE/media/email_on.gif" alt="Non read"/><!-- ELSE --><img src="http://www.YOUR-HOMEPAGE.COM/templates/YOUR-TEMPLATE/media/membermessages.gif" alt="Read"/><!-- ENDIF -->

I took some images from vld folders, but you can create your own envelopes smile
I think you can change the code so your envelope comes before the messages subject...

Last edited by Freja (2008-03-07 13:05:58)

5

Re: Hard Cover Tute: Have PM message been read or not.

Hi there

Just what I needed, works perfectly. I was almost going to pay for this feature.

Thanks Anton

Last edited by AtPetat (2008-03-07 14:33:42)

6

Re: Hard Cover Tute: Have PM message been read or not.

Nice!!!!!

radioact
What can I say
with your help and Vld personals,
We can blow all the other date scripts out of the water

members can delete the pm's they know have been read

Nice!!!!!
Thank you
Me, I'm just a hack but, this inspires me to sit down and learn PHP and MYSQL programing
(I want to be a Mr. Wizard too)

Together, we will rule the world
I think that's Vlad's plan all along big_smile

Last edited by seeme101 (2008-03-07 17:49:00)

7

Re: Hard Cover Tute: Have PM message been read or not.

hello   Read  hello Read        nadia        07/03/2008 23:32      
tein tein  Read tein tein Read     babyeinstein     06/03/2008 18:19    
Re[4]: wink wink  Read Re[4]: wink wink Read     dillberz     06/03/2008 09:43    
Re[2]: wink wink  Read Re[2]: wink wink Read     dillberz     05/03/2008 13:13    


it  says  READ all the time .... sad   Somebody Help me!   radioact i will pay u 10 USD.. as i did it before lolz..
Below is preview of what i have done.


Step 1: lib.account_messages.php

                'member_id' => 'member_id1',
                'basic_rows' => 1,
                )
            );
            $fields[$i]['message_id'] = $obj['message_id'];
            $fields[$i]['message_nonread'] = $obj['new'];
            $fields[$i]['message_subject'] = strlen($obj['subject']) > 40 ? htmlentities2utf8(substr($obj['subject'], 0, 40)) . " ..." : htmlentities2utf8($obj['subject']);


Step 2 and 3: account_messages_sent.tpl

<a href="{top.virtual_path}{message_link}">{message_subject}</a>
                                    &nbsp;<sup><!-- IF message_nonread -->Non-read<!-- ELSE -->Read<!-- ENDIF --></sup>
                                    <a href="{top.virtual_path}{message_link}">{message_subject}</a>&nbsp;<sup><!-- IF message_nonread -->Non-read<!-- ELSE -->Read<!-- ENDIF --></sup>
                                </td>
                                <td class="name">
                                    <a href="{top.virtual_path}{member_profile_link}">{member_username}</a>

Last edited by khawar (2008-03-07 18:39:50)

8

Re: Hard Cover Tute: Have PM message been read or not.

hi: Khawar

please follow Radioact's very good instructions

You have cut and pasted the entire sample line of code into account messsage.tpl
you only need this part: 

&nbsp;<sup><!-- IF message_nonread -->Non-read<!-- ELSE -->Read<!-- ENDIF --></sup>

that's why you see 2 subjects

the entire line should look like this

<a href="{top.virtual_path}{message_link}">{message_subject}</a>&nbsp;<sup><!-- IF message_nonread -->Non-read<!-- ELSE -->Read<!-- ENDIF --></sup>

not this ( as you have it )

<a href="{top.virtual_path}{message_link}">{message_subject}</a>&nbsp;<sup><!-- IF message_nonread -->Non-read<!-- ELSE -->Read<!-- ENDIF --></sup>
<a href="{top.virtual_path}{message_link}">{message_subject}</a>&nbsp;<sup><!-- IF message_nonread -->Non-read<!-- ELSE -->Read<!-- ENDIF --></sup>

hence the two subject headers

remove the extra line and you'll be as right as rain

Last edited by seeme101 (2008-03-07 19:19:28)

9

Re: Hard Cover Tute: Have PM message been read or not.

Hi seeme 101,  Thanks for help now that fine there is no double text, but it still says  Read for all messages even there are many unread messages. sad

10

Re: Hard Cover Tute: Have PM message been read or not.

It's only because you found the wrong $fields[$i]['message_id'] = $obj['message_id'];
There are two of them. Find the other one, read carefully

Open your lib.account_messages.php and find: function show_sent($page)
ABOUT 50 LINES BELOW function show_sent($page) you will find:
$fields[$i]['message_id'] = $obj['message_id'];

and ADD this below it
$fields[$i]['message_nonread'] = $obj['new'];

So, go physically and count the 50 lines down from function show_sent($page) in lib.account_messages.php

I hope this helps

11

Re: Hard Cover Tute: Have PM message been read or not.

Thank you guys. Thank you Seeme101 smile
Thank you, Anton, for explaining to Khawar I'm sure the reason is exactly you've described.

12

Re: Hard Cover Tute: Have PM message been read or not.

jet wrote

hi radioact ,this is a great feature.
please excuse if there is already an answer to this as im new.but can the same feature display an open or closed envelope for read or unread mail to display for the members inbox mail.at the moment it displays the message in bold if unread..
thanks

You should pay your attention at account_messages_inbox.tpl:

<a href="{top.virtual_path}{message_link}" <!-- IF message_new -->class="new"<!-- ENDIF -->>{message_subject}</a>

You can do it editing your .css or editing above file the way Freja said.

13

Re: Hard Cover Tute: Have PM message been read or not.

Gosh! I didn't see it was for the INBOX...sorry...

By the way, those envelopes in vld, dosn't fit the backgroundcolor in dark_yellowish...
I have made a white closed envolope on the same background as dark_yellowish and use only this for non-read messages, because I see (now) no need to show a text or an envolope for messages that have been read too...I simply deleted from and with the <!-- ELSE --> until <!-- ENDIF -->
If someone want to have this closed envolope for dark_yellowish (I have also an open, but don't use it my self), you can use my mailadress... smile

Last edited by Freja (2008-03-08 08:13:00)

14

Re: Hard Cover Tute: Have PM message been read or not.

Not working on 2.1.0

15

Re: Hard Cover Tute: Have PM message been read or not.

Oh, you still using 2.1.0? Then you have to edit lib.messages.php and use:

$fields[$i]['message_nonread'] = $obj->new;

16

Re: Hard Cover Tute: Have PM message been read or not.

This is a great mod, thanks alot radioact. You said in your first post that you could only give this option to paid members group. I have looked at the messaging options in the CP for paid members and cant see this option in there. Can you shed any light on how I can achieve this.

Thanks

17

Re: Hard Cover Tute: Have PM message been read or not.

This is how I did; only paid members and admins can use this function:

<a href="{top.virtual_path}{message_link}">{message_subject}</a>&nbsp;<sup><!-- IF top.loggedin_group_id == "1" OR top.loggedin_group_id == "5" --><!-- IF message_nonread -->Non-read<!-- ELSE -->Read<!-- ENDIF --><!-- ENDIF --></sup>

Or I did before I made an envelope insted smile

18

Re: Hard Cover Tute: Have PM message been read or not.

Yeah, that's right Freja

19

Re: Hard Cover Tute: Have PM message been read or not.

Fantastic, thanks Freja

20

Re: Hard Cover Tute: Have PM message been read or not.

Sorry Radioact, didn't know you was awake smile

21

Re: Hard Cover Tute: Have PM message been read or not.

Hi there what I would like to have added here is so that a member can see if the other member has replied on that specific message.

Like in Sent messages it will be
Subject: Hi there  (Read / Not read)      (Replied / Not Replied)        To: Babyangel        Sent: 18/05/2001

I'm sure this is easily achievable with a similar script.

22

Re: Hard Cover Tute: Have PM message been read or not.

Very-very odd feature request smile It can not be easily achieved I'm sure and moreover I don't understand the logic and need to have this : )

23

Re: Hard Cover Tute: Have PM message been read or not.

If you get 500 messages a day and you're interested in a certain conversation, you would like to see if that person replied and know if you should search through the 500 messages for that specific persons message or not. I think it's quite valid.

BUT okay, how about this one?
Being able to sort message history by Usernames, maybe make a dropdownbox where you can select a username and when you select the username it shows you the whole discussion history between you and them only!

Example (to make sure everyone understand) VLAD and MARK - please note

-------
Inbox
-------
Please select a member to view the discussion history between you and them.
John
Steven
Peter
Mary   << You select theis one from dropdown
Sarah
Marianne

----------
Results should be shown like the history
----------
You wrote on 13/02/2008
Hi Mary, how are you?
delete message


Mary replied on 13/02/2008
I'm very good thanks, it's the first message I get from you but I LOVE YOU ALREADY
Please tell me more about yourself.
reply | view profile | delete message

You wrote on 15/03/2008
Hi Mary - sorry I took a month to respond but I fell of my chair and and and
delete message

Mary replied on 46/57/3468
No problem, I still love you
reply | view profile | delete message

Makes sense I guess - any thoughts?
While we're at it? What about one liner replies for members who's not paid

24

Re: Hard Cover Tute: Have PM message been read or not.

Such a feature for members is useful and several big dating sites use it. As a member of one, if I don't get a reply from a member I can easily check to see if that member has read my message. It can indicate to the message sender that the member is not active.

25

Re: Hard Cover Tute: Have PM message been read or not.

You summed it up pretty well Dragon - still think we need an option to sort messages by username using a dropdownlist. So you can read the whole conversation on one page, you said, I said, you said, I said and be able to reply or view their profile from each message as well