Jump to content

Recommended Posts

I keep complicating things when trying to figure out how I should send messages and invites between members.

 

The way I was trying to do my invites was to have a table (Id, UserId1, UserId2, Approved). I would mark the Approved as 1 when the invite was first sent. Then mark it as 3 if the invite was accepted and 2 if declined. This is basically how I was trying to setup my friends table. It didn't work very well when people was submit multiple invites to each other.

 

Also, my messages table was setup like (Id, Userd1, UserId2, Subject, Message).

Link to comment
https://forums.phpfreaks.com/topic/148377-solved-trouble-getting-started/
Share on other sites

Approved as 1 when the invite was first sent. Then mark it as 3 if the invite was accepted and 2 if declined

 

Your confusing me as well,

 

if a user invites another mark as.

invite_awaiting.

 

you can now email all invite_awaiting every week or so,

also adjust to default message like no_invites after a set time in the database.

 

all those with no_invites will see the link to invite people.

 

if a user invites another user and accepted, then mark it as

invite_accepted.

 

if invite accepted, now you can make sure that the same user

dosent see the link for invite, because there all ready a friend with invite_accepted.

 

if the invite was not accepted then mark as.

invite_not_accepted.

 

because they don't want to have them as a friend don't show the invite link.

 

the database it self looks fine except no date or ip but apart from that good stuff.

 

it always nice to no when i was invited for any think.

might also help as a log.

 

 

so in essence, it all about what user get's to see the link, to invite another user, if the link ant there then that user does not want to no or has been accepted as a friend,this is all done via the database info.

 

i was told years ago via a member on

here always write every think on paper before doing any project, always worked.

 

Using the first table, how should I query to select all the friends of a particular member?

 

Would I have to run 2 separate queries?

 

Like:

 

select UserId2 from friend_table where Approved = invite_accepted and UserId1 = $Username

while

{

select * from user_table where Username=$myrow[username]

}

 

then,

 

select UserId1 from friend_table where Approved = invite_accepted and UserId2 = $Username

while

{

select * from user_table where Username=$myrow[username]

}

 

 

 

 

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.