TAILIEUCHUNG - Tạo mạng xã hội với PHP - part 15

Friends and Relationships Relationships Our relationships table needs to relate two users together, as well as record the type of relationship. Since some relationships require mutual consent, we need to indicate if the non-requesting user accepted the request to connect. The following is a suitable structure for our relationships table: Field ID Type Usera Userb Accepted Type Integer, Primary Key, Auto Increment ID Integer Integer Boolean Description A unique ID for the relationship between the two users The type of relationship (a reference to the relationship_types table) The user who initiated the relationship, a relation to the users table The user who usera. | Friends and Relationships Relationships Our relationships table needs to relate two users together as well as record the type of relationship. Since some relationships require mutual consent we need to indicate if the non-requesting user accepted the request to connect. The following is a suitable structure for our relationships table Field TyPe Description ID Integer Primary Key Auto Increment A unique ID for the relationship between the two users TyPe ID The type of relationship a reference to the relationship_types table Usera Integer The user who initiated the relationship a relation to the users table Userb Integer The user who usera initiated a relationship with a relation to the users table Accepted Boolean Indicates if this is a mutual relationship which is only used if the relationship type is a mutual relationship Adding friends Our users can see other users on the site either by searching for them or viewing a list of users from here we can add a link to enable the user to form a relationship. We have a suitable database structure to facilitate this but we now need functionality to connect our users together. Forming a relationship Let s walk through what the process should be for our users to form relationships with each other 1. View the listing of the user they wish to connect with. 2. Click on a link or select a relationship type from a list and click on Submit. 3. Check for pre-existing relationships. 4. Check if the relationship type selected is active. 5. Create the relationship in the database. 122 Download from Chapter 4 6. If the relationship type is mutual e-mail the other user an approval request message asking them to confirm the relationship. 7. If the relationship type isn t mutual e-mail the other user a message informing them that someone has connected with them. We already have step one set up the list of members. For step two we either need a link on the user s name or a list of relationship types which are links or .

TỪ KHÓA LIÊN QUAN
TAILIEUCHUNG - Chia sẻ tài liệu không giới hạn
Địa chỉ : 444 Hoang Hoa Tham, Hanoi, Viet Nam
Website : tailieuchung.com
Email : tailieuchung20@gmail.com
Tailieuchung.com là thư viện tài liệu trực tuyến, nơi chia sẽ trao đổi hàng triệu tài liệu như luận văn đồ án, sách, giáo trình, đề thi.
Chúng tôi không chịu trách nhiệm liên quan đến các vấn đề bản quyền nội dung tài liệu được thành viên tự nguyện đăng tải lên, nếu phát hiện thấy tài liệu xấu hoặc tài liệu có bản quyền xin hãy email cho chúng tôi.
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.