Kinh doanh - Marketing
Kinh tế quản lý
Biểu mẫu - Văn bản
Tài chính - Ngân hàng
Công nghệ thông tin
Tiếng anh ngoại ngữ
Kĩ thuật công nghệ
Khoa học tự nhiên
Khoa học xã hội
Văn hóa nghệ thuật
Sức khỏe - Y tế
Văn bản luật
Nông Lâm Ngư
Kỹ năng mềm
Luận văn - Báo cáo
Giải trí - Thư giãn
Tài liệu phổ thông
Văn mẫu
Giới thiệu
Đăng ký
Đăng nhập
Tìm
Danh mục
Kinh doanh - Marketing
Kinh tế quản lý
Biểu mẫu - Văn bản
Tài chính - Ngân hàng
Công nghệ thông tin
Tiếng anh ngoại ngữ
Kĩ thuật công nghệ
Khoa học tự nhiên
Khoa học xã hội
Văn hóa nghệ thuật
Y tế sức khỏe
Văn bản luật
Nông lâm ngư
Kĩ năng mềm
Luận văn - Báo cáo
Giải trí - Thư giãn
Tài liệu phổ thông
Văn mẫu
Thông tin
Điều khoản sử dụng
Quy định bảo mật
Quy chế hoạt động
Chính sách bản quyền
Giới thiệu
Đăng ký
Đăng nhập
0
Trang chủ
Công Nghệ Thông Tin
Đồ họa - Thiết kế - Flash
Tạo mạng xã hội với PHP - part 22
Đang chuẩn bị liên kết để tải về tài liệu:
Tạo mạng xã hội với PHP - part 22
Phước Nguyên
47
10
pdf
Đang chuẩn bị nút TẢI XUỐNG, xin hãy chờ
Tải xuống
Status Stream 'stream-' . $data['ID'], 'stream/types/' . $data['type_reference'] . '-fromself.tpl.php', $datatags ); } elseif( $data['poster'] == $data['profile'] ) { $this-registry-getObject('template')-addTemplateBit( 'stream-' . $data['ID'], 'stream/types/' . $data['type_reference'] . '-user.tpl.php', $datatags ); } else { // network updates $this-registry-getObject('template')-addTemplateBit( 'stream-' . $data['ID'], 'stream/types/' . $data['type_reference'] . '.tpl.php', $datatags ); } } } else { If there were no updates, we display the none template. $this-registry-getObject('template')-buildFromTemplates( 'header.tpl.php', 'stream/none.tpl.php', 'footer.tpl.php'); } } So, if we had our templates in place at this stage, bringing all of this together, adding the controller to our database, and viewing /stream what would we see? [ 192 ] Download from www.eBookTM.com Chapter 6 This is. | Status Stream stream- . data ID stream types . data type_reference . -fromself.tpl.php datatags elseif data poster data profile this- registry- getObject template - addTemplateBit stream- . data ID stream types . data type_reference . -user.tpl.php datatags else network updates this- registry- getObject template - addTemplateBit stream- . data ID stream types . data type_reference . .tpl.php datatags else If there were no updates we display the none template. this- registry- getObject template - buildFromTemplates header.tpl.php stream none.tpl.php footer.tpl.php So if we had our templates in place at this stage bringing all of this together adding the controller to our database and viewing stream what would we see 192 Download from www.eBookTM.com Chapter 6 This is the basics of our status stream. We can now look at adding comments likes and dislikes to the stream. Comments likes and dislikes The functionality behind adding comments likes and dislikes is very similar to the work we did in Chapter 5 in developing the statuses on a user s profile. The concept to adding these to the stream is fairly straightforward. Firstly we create an empty array of comments likes dislikes for each status. This way if a post has no comments likes or dislikes then by caching the empty array and sending it to the template we don t see a blank list where comments should be. If there are comments they are added to the empty array making it non-empty cached and sent to the template. Although the method is the same for the three aspects comments require one database query whereas likes and dislikes combined require another so let s add in support one at a time. Comments Take the status IDs we retrieved earlier and create empty arrays for each of them. status_ids implode IDs start array foreach IDs as id start id array Copy our new array of empty arrays to be used for comments. comments comments start Query the database for comments. sql SELECT p.name as commenter c.profile_post c.comment
TÀI LIỆU LIÊN QUAN
Tạo mạng xã hội với PHP - part 1
Tạo mạng xã hội với PHP - part 2
Tạo mạng xã hội với PHP - part 3
Tạo mạng xã hội với PHP - part 4
Tạo mạng xã hội với PHP - part 5
Tạo mạng xã hội với PHP - part 6
Tạo mạng xã hội với PHP - part 7
Tạo mạng xã hội với PHP - part 8
Tạo mạng xã hội với PHP - part 9
Tạo mạng xã hội với PHP - part 10
crossorigin="anonymous">
Đã 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.