Jump to content

personal messages system


webtuto

Recommended Posts

It all depends how big the system is going to be. If the system is small you can store PM message in a database. Then have a auto run script to check for new messages every minute. If you have a lot of users this is a bad design idea.

 

You should google php chat tutorials. There are a few good ones out there. Maybe from that you'll come up with a solution.

Link to comment
Share on other sites

Table: private_messages

Columns:

- id

- author

- receiver

- time

- title

- message

- status

 

Something like that..

 

Then use the query:

SELECT * FROM private_messages WHERE receiver='{$myself}'

 

Display them all (basic data) in a while loop (don't forget a count!) for a PM list, and (in the while loop) determine if the PM has been viewed or not.

 

For a "You have x PMs" you can basically just use a similar while loop & counter, leaving out the output, but keeping the counter and status check.

If its viewed, don't add it to the count, otherwise do add it to the count.

 

Then on the PM VIEW page, output all the details of that PM and change the status (if its not already) to viewed.

 

Simple, no?

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.