Kill lui lei Dog---CMS---16-dedecms (example of movie net 10-completion of the film's scoreboard)

Source: Internet
Author: User

The plate to be implemented is the movie scoring table, as shown below:

The label used is {dede:arclist}, and the data for the attached table is also removed.

The top 3 styles are not the same as those in the back, according to the scoring values in descending order .

Analysis of the source code on the template, in fact, the top three added a class attribute just

  

(1) The resolution is sorted according to the rating value.

We want to sort by the rating values, we need to sort according to the pfen field, so we can only modify The source code of the arclist tag to support sorting according to Pfen .

The {dede:arclist} tag is found by analysis,

Then go to the arclist.lib.php page and find out where the SQL statements are, and we'll test him for breakpoints:

And then back to the background home----Build-----Update the home page HTML, select the updated template specified to test.htm inside the update, the effect as shown:

When parsing is performed, three tables are manipulated

Dede_archives table alias is arc

Dede_arctype table alias is TP

Dede_addonmovie table alias is ADDF

But there is no sort of scoring, no words,,,,,, but we can go to see him arclist.lib.php inside the code to determine whether can be modified, inside we first double-click his execution code:

To look up,

And this code has a ersql, see sort of we can try to double-click him, and then go up to find ... (in bitter Force)

It's been found here. We're going to take a bold test to see if it works here, so we add a piece of data to see

Add a bar, and then put the breakpoint test (Var_dump ($query);d ie;) code open Save, and then back to the background, to update to see how the effect

See here in a very good mood oh, because come out, then we block his breakpoint debugging, then update to see how the effect.

Successfully get sorted results, haha, go back to the index.htm code on the rational template,

The effect came out ...

But there is a problem not solved, is the style of the problem, the front-end design when he is the top three of the style of the nominal orange, but now all are orange, you can use in the field label simple business logic.

Grammar:

The runphp=property, "Yes," means that the field label uses simple business logic.

[Field: Fields tab runphp= "yes"]

if () {

}

[/field: field label ]

Let's do a little case test.

Case: If the score value is greater than 8 points, the display is good, otherwise normal display score.

Look at the results.

This makes it easy to judge ...

Don't say much nonsense, return to project, continue to transform index.htm file

Then in the background to update the index home page, the final effect is as follows:

The effect has come out.

Kill lui lei Dog---CMS---16-dedecms (example of movie net 10-completion of the film's scoreboard)

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.