How to Create a friend request system/Users system?? - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23) +--- Thread: How to Create a friend request system/Users system?? (/showthread.php?tid=23005) |
How to Create a friend request system/Users system?? - El Forum - 09-26-2009 [eluser]flyenig[/eluser] Hello well I'm trying to create some type of friend request system, or friends ssystem, or users system or profile system,(what ever u want to call it :-P). for example...(send friend request, accept friend request, block user, send comment, messaging between friends, etc) Ive looked almost everywhere and i cant seem to find a tutorial. Any help would be appreciated. thank you How to Create a friend request system/Users system?? - El Forum - 09-26-2009 [eluser]freshface[/eluser] There are no tutorials for doing this. Just learn the code igniter basics. How to Create a friend request system/Users system?? - El Forum - 09-26-2009 [eluser]flyenig[/eluser] thanks, well i know the basics, i just need help on how to start this, ive already created views for it. like how would i go about this, in the database How to Create a friend request system/Users system?? - El Forum - 09-26-2009 [eluser]bretticus[/eluser] [quote author="flyenig" date="1254004455"]thanks, well i know the basics, i just need help on how to start this, ive already created views for it. like how would i go about this, in the database[/quote] Programming = Trial & Error = Time consuming = Experience. My point, you can teach yourself much by just digging in and doing it. Suggestion: Ask more specific questions including what you have attempted and ask them one at a time. How to Create a friend request system/Users system?? - El Forum - 09-26-2009 [eluser]flyenig[/eluser] Thx Ok well, I've tried and failed and ive been trying to do this for a week straight, and the code i had before, i started all over because nothing was working at all. so right now, all i have is my views and some mysql and i see what you are saying, So to simplify this, How would i acheive a simple friend request system? for example, Kenny sends a friend request to Jake, Jake accepts and they become friends. and i can view all of johns friends (and no im not a beginner with codeigniter :-P) How to Create a friend request system/Users system?? - El Forum - 09-26-2009 [eluser]freshface[/eluser] For doing this you need to know how the db class works and how relationships work. How to Create a friend request system/Users system?? - El Forum - 09-26-2009 [eluser]flyenig[/eluser] lol, yea i know how the DB class works, i've made a CRUD already from scratch, I've made it so that people can have a profile, and edit their information and settings, and also people can view all the users thats on my site. (using num_rows etc...) I have some knowledge on relationships, an example of how i could go about this would be nice, and i think i can handle the rest. How to Create a friend request system/Users system?? - El Forum - 09-26-2009 [eluser]bretticus[/eluser] [quote author="flyenig" date="1254005029"]How would i acheive a simple friend request system? for example, Kenny sends a friend request to Jake, Jake accepts and they become friends. and i can view all of johns friends[/quote] That is not a specific question: How would I achieve a simple friend request system? So here's my broad and overarching answer: Store Kenny's friend request in the database. When Jake logs in, display that he has a request. Let Jake accept or deny the request and store that in the database so when Kenny logs in he can see Jake's profile. See how that works? How to Create a friend request system/Users system?? - El Forum - 09-27-2009 [eluser]flyenig[/eluser] [quote author="bretticus" date="1254006319"] Store Kenny's friend request in the database. When Jake logs in, display that he has a request. Let Jake accept or deny the request and store that in the database so when Kenny logs in he can see Jake's profile. See how that works?[/quote] Yes thats what i need help with. im having a hard time coding that out. if i can see an example from someone that would be nice How to Create a friend request system/Users system?? - El Forum - 09-28-2009 [eluser]ChrisMiller[/eluser] Code: CREATE TABLE IF NOT EXISTS `friend_requests` ( Okay the quick and dirty explanation... this is not a perfect setup nor the best but it works and should help you get you on the right track. So you have a bunch of members in the member table. User A decides to add User B as a friend so the request is sent and a row is created in the friend_requests table. If User B accepts it then a new row is created in relationships table and would contain User A's ID# & User B's ID # and the type of relationship for basic we will use 1 however you can set 2 to be family and so on as needed. Then to get a list of friends you would query the relationship table for anywhere that the user_a or user_b id ='s the users friend list you are trying to find and then you will get a list of ID's. I reccommend getting a book on MySQL to learn how to do complex queries such as Sub Queries etc... |