TAILIEUCHUNG - Practical Web 2.0 Applications with PHP phần 8

Giấy phép người dùng xem trước bài viết mới. Hệ thống quy trình làm việc đơn giản này sẽ cho phép người sử dụng Trong chương 2, chúng tôi thiết lập khả năng đăng nhập cho ứng dụng web của chúng tôi, có nghĩa là chúng ta có thể ghi lại khi xảy ra sự kiện khác nhau. | Simpo PDF Merge and Split Unregistered Version - http CHAPTER 11 A DYNAMIC IMAGE GALLERY 399 image not found response- setHttpResponseCode 404 return try fullpath image- createThumbnail w h catch Exception ex fullpath image- getFullPath info getImageSize fullpath response- setHeader content-type info mime response- setHeader content-length filesize fullpath echo file_get_contents fullpath Managing Blog Post Images Now that we have the ability to view uploaded images both at their original size and as thumbnails we can display the images on the blog post preview page. In this section we will modify the blog manager to display uploaded images thereby allowing the user to easily delete images from their blog posts. Additionally we will implement Ajax code using Prototype and Scriptaculous that will allow the user to change the order in which the images in a single post are displayed. Automatically Loading Blog Post Images Before we can display the images on the blog post preview page we must modify DatabaseObject_BlogPost to automatically load all associated images when the blog post record is loaded. To do this we will change the postLoad function to automatically load the images. Currently this function only loads the profile data for the blog post but we will add a call to load the images as shown in Listing 11-30. Additionally we must initialize the images array. Listing 11-30. Automatically Loading a Blog Post s Images When the Post Is Loaded php class DatabaseObject_BlogPost extends DatabaseObject public images array . other code Simpo PDF Merge and Split Unregistered Version - http 400 CHAPTER 11 A DYNAMIC IMAGE GALLERY protected function postLoad this- profile- setPostId this- getId this- profile- load options array post_id this- getId this- images DatabaseObject_BlogPostImage GetImages this- getDb options . other code The code in Listing 11-30 calls a method called GetImages in DatabaseObject_ BlogPostImage which

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.