20150331--dede+ paging, searching, collecting

Source: Internet
Author: User

first, complete the search page 1. Complete pagination Display

(1) Under the Plus directory, create a new sou.php page, complete the page display, and copy the corresponding template page to the Templets directory below the A67 directory, also named Sou.htm, and modify the static page inside the style and image path.

(2) Perform the construction of the paging variable,

(3) The current content of the extracted data, there is no arcurl content, so to view the arclist tag file, to see if it is calculated.

Reference: The following SQL statement is taken out of the content.

The last SQL statement: The Arcurl value is inside the content that is taken out.

(4) traverse the contents of the data to the static page.

(5) Output paging string.

Defines an anchor point for easy paging links.

Paging String Code:

2. Add search Criteria

(1) Strings for making search conditions

To calculate the total number of records based on the condition, add the Where condition to the SQL statement.

(2) solve the problem of condition loss when turning the page

Idea: When turning the page, get the condition of the query, and add the condition of the query to the link above the page.

How to get query criteria:

Although the condition is not lost, there is a new problem with the paging string overlay problem.

Workaround: Remove the front page string before turning the page. Modify the Geturl function.

3. Complete Search by Region

Modify to get the function of the address bar condition:

4. Search by chronological completion 5. Complete the search by column

(1) Remove the data from the movie sub-column

(2) Traverse the removed sub-column to the static page.

6, the search conditions to the output

Idea: Combine the conditions retrieved in the address bar into an array for traversal.

Format of the array:

$array [Value of]=array (' diqu ' = area)

Loop the array of conditions into a static page.

second, the principle of collection:

The functions of the Curl series are generally used in the acquisition of content.

If you want to capture simple text, direct file_get_contetns ();

Get the HTML code to match the data with regular completion

1. Getting Started case, getting data content

2, collect pictures, to collect the pictures, save to Local.

3. Capture Movie Data:

(1) Collect the list of data, get the name picture of the movie link to the movie details page URL address

To build an array:

array[movie details of Url]=array (

' title ' = movie Name

' Litpic ' = The address of the picture

);

(2) Collect specific data content according to the data list, (collect specific movie data according to the URL of the movie detail page)

Build an array for easy storage

$array []=array (

' title ' = movie Name,

' Litpic ' + ' pictures saved to the local URL ',

' Diqu ' area,

' Yuyan ' =

' Zhuyan ' =

)

The last code is in the index.php page

Common curl_setopt options for this series of functions:

curl_setopt ($s, curlopt_url, $url);

curl_setopt ($s, curlopt_referer, ' http://www.7060.com/'); curl_setopt ($s, curlopt_returntransfer,1);

curl_setopt ($s,curlopt_cookie, get the contents of the COOKIE via Firbug)

20150331--dede+ paging, searching, collecting

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.