jakebur01 Posted March 7, 2009 Share Posted March 7, 2009 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). Quote Link to comment https://forums.phpfreaks.com/topic/148377-solved-trouble-getting-started/ Share on other sites More sharing options...
v3nom Posted March 7, 2009 Share Posted March 7, 2009 How about getting it to check to see if the member receiving the invite already has a pending or accepted invite, and stop future invites from being sent to them? Quote Link to comment https://forums.phpfreaks.com/topic/148377-solved-trouble-getting-started/#findComment-779034 Share on other sites More sharing options...
redarrow Posted March 7, 2009 Share Posted March 7, 2009 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. Quote Link to comment https://forums.phpfreaks.com/topic/148377-solved-trouble-getting-started/#findComment-779046 Share on other sites More sharing options...
jakebur01 Posted March 7, 2009 Author Share Posted March 7, 2009 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] } Quote Link to comment https://forums.phpfreaks.com/topic/148377-solved-trouble-getting-started/#findComment-779084 Share on other sites More sharing options...
jakebur01 Posted March 7, 2009 Author Share Posted March 7, 2009 bump... Quote Link to comment https://forums.phpfreaks.com/topic/148377-solved-trouble-getting-started/#findComment-779186 Share on other sites More sharing options...
jakebur01 Posted March 8, 2009 Author Share Posted March 8, 2009 How should I query this table to select the friends of a member? Could I make it happen all in one query? members (Id, UserId1, UserId2, Approved) Quote Link to comment https://forums.phpfreaks.com/topic/148377-solved-trouble-getting-started/#findComment-779215 Share on other sites More sharing options...
jakebur01 Posted March 8, 2009 Author Share Posted March 8, 2009 bump.... Quote Link to comment https://forums.phpfreaks.com/topic/148377-solved-trouble-getting-started/#findComment-779694 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.