Đang chuẩn bị liên kết để tải về tài liệu:
OBJECT-ORIENTED PHP Concepts, Techniques, and Code- P9

Đang chuẩn bị nút TẢI XUỐNG, xin hãy chờ

OBJECT-ORIENTED PHP Concepts, Techniques, and Code- P9:A number of years ago, before I started using PHP, I created dynamic web pages using C. This really wasn’t too different from some of the other options available at the time, though it seems almost unthinkable now. Creating a dynamic page meant outputting HTML from your script and recompiling that script if any changes needed to be made. | else then calculate offset totaloffset offset PERPAGE If no query string is passed into the page you want to begin displaying images at the beginning of your list so you set O totaloffset to 0. If offset does have a value multiplying it by @ the PERPAGE value calculates the start position within the array of image filenames. The name of the directory you want to use is assigned to the variable directory directory graphics di new DirectoryItems directory Listing 8-1 Hard-coded directory name Because you want to display the directory of images in the graphics directory pass the value graphics to the constructor of the Directoryitems class. The imagesOnly method filters out all non-images and the method naturalCaselnsensitiveOrder ignores case and orders numerically where appropriate. di- imagesOnly di- naturalCaseInsensitiveOrder In Chapter 6 when you displayed all the thumbnails on one page you retrieved the entire list of filenames from the Directoryitems class instance. Since the page navigator controls the starting position and since you can retrieve a slice of the array you need only retrieve a specific number of items here. Do this by passing the getArraySlice method a start position and the number of items you wish to display. get portion of array filearray di- getFileArraySlice totaloffset PERPAGE Displaying an Array Slice You retrieve each filename and pass it to the getthumb.php file so it can serve as the file source for an img tag. You don t need to make any changes to the version of the getthumb.php file you used in Chapter 6 it includes the Thumbnailimage class and uses it to create a reduced image. The code to loop through the thumbnail images hasn t changed from Chapter 6 either. For ease of reference it s reproduced in Listing 8-2. Using the PegeNevigetor Gloss 61 echo div style text-align center echo Click the file name to view full-sized version. br path specify size of thumbnail size 100 foreach O filearray as key value path directory . key .

TÀI LIỆU 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.