How to enable the Empire CMS to display headlines, top posts, recommendations, and other marks

Source: Internet
Author: User

Recently, I am engaged in the Empire cms. If the article contains images or the article is top-notch, I need to display the corresponding logo in the header of the list. Then I implemented it with the smart tag. Here I will record some, it is estimated that many people will use it.

We output the information with the new icon Based on the release within 3 days (the Smart tag format on the homepage template ):

[E: loop = {topic ID, number of entries displayed, operation type, only title images displayed}] <? $ Newimg = ""; if (time ()-$ bqr [truetime] <= 3*24*3600) {$ newimg = " <Li> <a href = "<? = $ Bqsr [titleurl]?> "Title =" <? = $ Bqr [title]?> "Target =" _ blank "> <? = Esub ($ bqr [title], 36)?> </A> <? = $ Newimg?> </Li> [/e: loop]

Note: The field value array variable is $ bqr, and the corresponding field variable is $ bqr [field name]. For example, the title field variable is $ bqr [title].

First, select "use program code" on the list template. We recommend that you output information with the new icon (list Page Template [list content template (list. var)] format ):

$ Newimg = "; if ($ r [isgood] = 1) {$ newimg = ' ';} $ listtemp = '<li> <a href = "[! -- Titleurl --] "title = "[! -- Oldtitle --] "> [! -- Title --] </a> '. $ newimg.' </li> ';

Note: The field value array variable is $ r, and the corresponding field variable is $ r [field name]. For example, the title field variable is $ r [title]. The variable '. $ newimg.' is also defined .'. Assign the final template content to the $ listtemp variable.

For more information about condition collection on homepage templates, see:

If ($ bqr [isgood] = 1) // recommended if ($ r [firsttitle] = 1) // toutiao if ($ r [istop] = 1) // set the top if ($ bqr [isgood] = 1 & $ bqr [firsttitle] = 1 & $ bqr [istop] = 1) // top-toutiao.com-recommendation (Combined Use)

Finally, the actual code is provided:

[E: loop = {'selfinfo ', 20, 0, 0}] <? $ Newimg = ""; $ good = ""; if (! Empty ($ bqr [titlepic]) {$ newimg = " <Tr class = "even"> <td class = "title"> 

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.