Hi,
Ive created a private messaaging system for my project. It works all fine.
I wanted to know how i can keep a count of the read and unread messages.
So that whenever the user logs in he is displayed the number of unread messages.
I also wanted to add the text formating and smiley feature when composing a message.
How can it be done.
if you designed this, i'm surprised to see a question like this. To that this post might seem like i'm mocking you, but i hope it helps.
In the table that stores your messages, have a column that has a boolean flag. When the user requests to view that message set the flag to Off (read), otherwise it is left On (unread)
When the user views the inbox (or at any time) query the message table for all message for this user with that flag on, and then total of messages
You'll get Total UNREAD and Total number of messages.
Total messages minus total unread = total read messages.
as for the smilies, search google for WYSIWYG editor that has support for smilies and BBCode.
For a powerful editor, i'd use TinyMCE (a little too advanced) but you can easily implent custom buttons (such as insert smilies) if you choose to.
Good luck
DM