It would not be that hard...
All you would have to do is create another table called something like
Messages, which should include the following columns/fields:
Code:
MessageID
SenderID
RecipientID
Subject
Body The
SenderID should be the
UserID pulled from the
$USER{'UserID'} variable when the user wanting to send the message is logged in. Then the
RecipientID is the recipient's ID number, which can be pulled by creating a link like the following:
Code:
<a href="<%build_message_url%>?UserID=<%UserID%>">Send Private Message</a> The connection between the
Users table and
Messages table would be a M<->M connection, meaning that many users can send and receive many messages.
Of course, you could create an intersection table like
User_Messages with the following concantenated foreign keys:
But in terms of database design, you could simply carry over the
UserIDs as foreign keys from the
Users table.
Then use similar codes in the
add.cgi and
modify.cgi to add/modify private messages. Rather than adding records into the
Links table, you would add/modify the
Messages table.
Of course, the easier solution would be to install WWWThreads and install the WWWThreads Authentication Plug-in.
Regards,
Eliot Lee