|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
page has been viewed?
I am wondering how to go about checking if a PM has been read by the user.
what I am trying to accomplish is pretty much the same as what these forums, and many other forums, do. If the PM has been read by the user, it changes the icon to mark that it has been read, etc, etc. The other thing I am trying to accomplish is, I am allowing users to reply to each others PM's,...I want it to act like a message board, in that, if the user has 4 PM's,...and the user gets a reply on PM number 3, I want PM number 3 to be displayed first. Thanks for any input. -- Jason |
|
#2
|
|||
|
|||
|
Create a new field in your DB. This field will hold a flag, you could set a flag in this field as '0' equals a read message and '1' equals a new message. You could use that on the PM display page. On your forum, or main page, you can query the DB for the logged user and count the flags. 5 ones (1) would equal 5 new messages. Also, when they view the message within thier PM display page, UPDATE the DB field to represent the new flag, in this case a '0'. Pretty simple to do and implement....
Last edited by jpenn : October 21st, 2002 at 09:45 PM. |
|
#3
|
|||
|
|||
|
jpenn, thats a great way to do it!
Taelo, i would suggest using jpenn's way, but if your looking for something quick, try cookies |
|
#4
|
|||
|
|||
|
ok I think I am following you. Thank you for the input.
|
|
#6
|
|||
|
|||
|
Lol Joe4JC,
Hey, there are some really really good application developers in the devshed community, I have learned from them guys... I am sure there are some really good ones here also, but man, the guys over there are pretty incredible... Last edited by jpenn : October 22nd, 2002 at 02:31 AM. |
|
#7
|
|||
|
|||
|
ok well
well I didn't wanna post again until I had some time to think about this. Let me see if I am understanding correctly,...
Are you saything to create another table and it in store an Order Field PM ID Field and UserID Field? If I did that, everytime that user got a PM,....I would have use a for loop or something to increment each Foriegn Key to the Order ID. Is this what you are talking about? |
|
#8
|
||||
|
||||
|
Quote:
Well, no. An efficient DB layout would have a seperate table for PM's only. In this table you would have the PM_ID_NUMBER, the PM_SENDER, the PM_RECIEVER, the PM_SUBJECT, the PM_MESSAGE and the PM_FLAG -> the flag being the number number '0' or '1', as I discussed in the earlier reply. You do have a seperate table for your messenger, correct? Quote:
Ok.... When your user enters the page that displays you have such and such messages in your inbox, being your main site page or whatever page in your community or user area, your function would do a very simple query, like so -> PHP Code:
Now, the code above is efficient. The code is efficient in a way that when using '0' and '1' as the flags, we do not have to use a comparison of any sort to determine the '0' or '1' to increment the count... --> A '0' will return false and a '1' will return true. Last edited by jpenn : October 23rd, 2002 at 07:24 PM. |
|
#9
|
|||
|
|||
|
I follow you now
|
![]() |
| Viewing: Dev Articles Community Forums > Programming > General Programming Help > page has been viewed? |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|