TAILIEUCHUNG - Thiết kế mạng xã hội với PHP - 25

Tham khảo tài liệu 'thiết kế mạng xã hội với php - 25', công nghệ thông tin, đồ họa - thiết kế - flash phục vụ nhu cầu học tập, nghiên cứu và làm việc hiệu quả | Public and Private Messages tr th Sent th td inbox_sentFriendlyTime td tr tr th Message th td inbox_message td tr table div div Mark as read Once a user has read a message we should update the database to indicate that the message has been read so that the user can see at a glance which of their messages are new and unread and which ones have already been read. However for privacy reasons we shouldn t show this information to the sender of the message. To do this we simply set the read property on the model to 1 and save the record as illustrated by the changes to viewMessage highlighted below View a message @param int message the ID of the message return void private function viewMessage message require_once FRAMEWORK_PATH . models 222 Download from Wow eBook Chapter 7 message new Message this- registry message if message- getRecipient this- registry- getObject authenticate - getUser - getUserID this- registry- getObject template - buildFromTemplates messages message- toTags inbox_ message- setRead 1 message- save else this- registry- errorPage Access denied Sorry you are not allowed to view that message Now once the user reads a message the database records the message as having been read. Deleting a message To delete a message we simply call the model s delete method provided the message was sent to the logged in user of course What about the sender These deletes will remove the message completely even from the sender but what if we want to have the sender keep their copy or have the sender be able to delete their copy Feel free to extend this to have an additional field to indicate whether the message has been deleted by the sender and add the functionality in. Delete a message @param int message the message ID return void private function deleteMessage message require_once FRAMEWORK_PATH . models message new Message this- registry message if message- getRecipient this- .

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.