20150328--dede+ Condition Selection-01

Source: Internet
Author: User

Catalogue

I. Content Review 1

1 , Main Table 1

2 , using CMS the process of completing the project in the system 1

3 , label 1

4 , the relationship between templates and static pages 1

Second, complete the following data extraction 3

third, the completion of the ranking values, 6

Iv. Output The sub-columns of the film. 8

Five: The output sub-column movie content; 9

Six, make the head of the website, let other templates introduce 10

Vii. Complete the contents of the Column list page 10

Eight, in the column page to take out the film belongs to the column. 11

nine, in the Column page page, remove the conditions: the region for the mainland film. 12

10. Complete your Content details page; review 1, Main Table

Dede_channeltype table: Storing content models inside the DEDECMS

Dede_archives table: Some information that stores data content publicly.

Dede_addonxxxx Table: Stores some information about the model data.

Dede_arctype Table: Stores the columns created. 2, the use of CMS system to complete the project process

(1) Create the model, and each model corresponds to an additional table.

(2) Create columns,

(3) Add data content,

(4) Make the model, complete the replacement, use the label to remove the data

(5) Generate static page, homepage, list page, content detail page. 3. Label

{Dede:channel} Tags: take out the column data, query the table is, Dede_arctype table

{dede:arclist} Tags: get specific data content, query the table is dede_archives (content Main Table) and dede_addonxxx (additional table)

The channeled= "" property is the property that determines which data is to be read from which model, which is the additional table.

Addfields= "" To get the field contents of the attached table, 4, the relationship between the template and the static page

Static pages are generated through templates.

Extended:

Remove the data with the slide (f) attribute,

Condition: Flag has the word f in it.

SELECT * FROM dede_archives where flags like '%f% ';

SELECT * from dede_archives where find_in_set(' F ', flag) >0

The return value of Find_in_set (' F ', flag) is the location of the parent string where the lookup string is located, starting at 1.

Inside MySQL is the InStr(female string, substring) function, which returns the value of the substring at the position of the parent string, starting from 1.

Second, complete the following data extraction

Think: Take out the specific data content, using the tag is, arclist tag.

Think: There is no data from the attached table, if there is, use channelid= "" addfields= "Add the field of table

Number of data fetched: Using row= "4"

Knowledge point 1:

field Label: [field:global.autoindex/]   similar to the use of $i=1 in loops; <?php echo $i + +?>

The field label, used in the loop, automatically adds 1 output per loop.

Knowledge point 2:

tags are not nested in Dede, such as

{Dede:arclist}

{dede:global.cfg_templets_skin/}/images/1.jpg

{/dede:arclist}

Unable to parse {dede:global.cfg_templets_skin/} content.

Solution: If the label is nested, change it to a field label

{dede:global.cfg_templets_skin/} changed to [field:global.cfg_templets_skin/]

Change {} to [] Change Dede to field.

Knowledge point 3: Functions can be used in field labels,

Syntax: [Field: Field name function= "function name (@me)"]

If you want to use a custom function, you need to define it in a file. The file is under the Include directory with the file name: extend.func.php file

For example, the following function is defined in the extend.func.php file:

Use in Tags:

The result of the final output:

Case: Show the number of Venus according to the score

The code in the template page:

Functions defined in the extend.func.php file,

The final result:

third, the completion of the ranking of the score values,

Thinking: Using tags, arclist, using Properties channeled= "" Addfields= ' PFZ '

How to sort by the rating values.

by outputting the SQL statement in the tag file:

The analysis found that in the SQL statement,

The alias for Dede_archives is: arc

The alias of Dede_arctype is TP

Dede_addonxxx aliases are: ADDF

Modify: arclist.lib.php page, add code, support sorting based on scoring value.

Knowledge points : Simple business logic can be used in the field tags ,

Syntax usage:

[Field: Field name runphp= "Yes"]

if (@me >=6) {

$me = ' good '

}

[/field: Field name]

The content of the last output of the field label is the result of processing through the business logic.

Case: Sort by score value, Top 3 Add class= "Hove" style:

The specific code:

The final result:

Summary: Parameters that can be used in the field label:

(1) You can use the function in the field label, the last field label output is the function of the return value of processing results. The function can be either a system function or a self-defined one, and it must be in the extend.func.php file below the Include directory if you want to define it yourself.

(2) field Label:[field:global.autoindex/], used in a loop, automatically plus 1 per loop

(3) The field label can be a simple business logic, by using runphp= "yes", and finally the content of the field label output, is the result of business logic processing. Iv. Output The sub-columns of the film.

Think: The column data is taken out, the channel label

20150328--dede+ Condition Selection-01

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.