In-site private messaging php script

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
Ozz
Forum Commoner
Posts: 26
Joined: Wed Aug 21, 2002 11:47 pm

In-site private messaging php script

Post by Ozz »

I want to add a private messaging facility for my members.
After some search I found this script:
http://pmsys.sourceforge.net/index.php
But its quite compilicated. I need a more simple one.
An inbox and sentbox and send message ability is enough.
I use MySql for database.
I want to do this with adding a table to my database.

What do you suggest?
Any ready-to-run scripts do you know?

Thanks by now...
User avatar
bradvan
Forum Newbie
Posts: 10
Joined: Mon Jun 02, 2003 8:26 pm
Location: Rylstone, Australia
Contact:

Post by bradvan »

You could add a table to your database that contains all your members and their details including whether or not they are currently logged on. Or you may be able to slightly modify an existing one.

When a member logs on update their status in the db and get all online users to display in their browser. Perhaps with a hyperlink, so you can click on a name and get a popup window to message them.

For each member you could have another table to hold all messages that they have received and a field that tells whether the message has been viewed and one for the senders name. Then query the db for all messages for current_user that they have not viewed and display them with senders name.

You will have to either have the message display area in a popup window or frame/iframe that is regularly refreshed so that you get new messages displayed, or you could use the XMLHttpRequest object (mozilla) or ActiveXObject("Msxml2.XMLHTTP") object for IE5+ to fetch new messages without refreshing the page.

If you want some (or a lot ;-) of help with code email me.
Post Reply