Let me see if I understand. You want PersonA to be able to click on a link or a button on PersonB's record, which would then build a form for someone to add a record to a second database that could only be seen by PersonB.
It's an interesting take on the "view own" feature. I think the crux of the whole thing would rest in the following line in sub query:
Code:
next LINE if ($restricted and ($db_userid ne $values[$auth_user_field]));
Probably all you would have to do is to create two variable in the .cfg file --
$auth_reader_field (similar to $auth_user_field) and
$private_message (set to 1 when you want to use it) -- and do some futzing with the line. I think this would work:
Code:
if ($restricted) {
if ($private_message) {
next LINE if ($db_userid ne $values[$auth_reader_field]);
}
else {
next LINE if ($db_userid ne $values[$auth_user_field]);
}
}
You might want to modify sub html_home so that when the person firsts logs in it would give the number of new messages.
Ah, that brings up the newness of messages. You actually would want a modified modify form to come up when the person reads messages so that he can set that he has read the message. And there would need to be a facility for deleting, which you would encourage your users to do often. People don't usually delete their messages (this is from experience in running a message board), so your db file would fill up quickly. You might even want to warn people that messages would be purged every 30 or 60 or whatever days. I know I helped someone with writing something like that years ago. Lois undoubtedly has it in her database.
JPD
----------------------------------------------------
JPDeni's DBMan-ual How to
ask questions the smart way.