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

Nếu người dùng đang đăng nhập là thành viên của nhóm, hoặc tạo của nó, sau đó điều khiển nhìn lên các chi tiết đầy đủ các yêu cầu của người dùng, và chuyển điều khiển đến các phương pháp thích hợp. if (isset ($ urlBits [2])) {switch ($ urlBits [2]) {case 'tạo-chủ đề': $ this- createTopic (); break; case 'xem, chủ đề': $ this- viewTopic (intval ($ urlBits [3])); break; trường hợp đáp-to-đề ": $ this- replyToTopic (intval ($ urlBits [3])); break; trường hợp" thành viên ": $ this- manageMembership (intval ($ urlBits [3])); break; mặc định: $ this- viewGroup. | Groups If the group is active the next stage is to check that the currently logged in user is either the creator of the group or is a member of the group. require_once FRAMEWORK_PATH . models gm new Groupmembership this- registry user this- registry- getObject authenticate - getUser - getUserID gm- getByUserAndGroup user this- groupID if this- group- getCreator user gm- getApproved If the currently logged in user is a member of the group or its creator then the controller looks up the full details of the user s request and passes control to the appropriate method. if isset urlBits 2 switch urlBits 2 case create-topic this- createTopic break case view-topic this- viewTopic intval urlBits 3 break case reply-to-topic this- replyToTopic intval urlBits 3 break case membership this- manageMembership intval urlBits 3 break default this- viewGroup break else this- viewGroup else ------------------------------------ 332 -------------------------------- Download from Wow eBook Chapter 10 If the user isn t a member of the group control is passed to a secondary controller we will create it shortly which if appropriate will provide a mechanism for the user to join the group. require_once FRAMEWORK_PATH . controllers group membership new Membershipcontroller this- registry this- groupID membership- join else this- registry- errorPage Group not found Sorry the group you requested was not found else this- registry- errorPage Group not found Sorry the group you requested was not found else this- registry- errorPage Please login Sorry you must be logged in to view groups If the user s request was to view a group then the group model data is sent to the template engine the template is built and the cache of topics from the group is generated and also sent to the template engine. private function viewGroup this- group- toTags group_ this- registry- getObject template - buildFromTemplates groups .

Không thể tạo bản xem trước, hãy bấm tải xuống
TÀI LIỆU MỚI ĐĂNG
Đã 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.