How to call DEDE popular keywords?
Popular tags in DEDE, DEDE homepage digg, DEDE random popular keyword calling methods, friends in need can refer to the following
Recommended learning:梦Weavercms
DIGG
orderby=digg is sorted according to the number of DIGG
{dede:arclist row=5 titlelen=24 orderby=digg} [field:textlink/] [field:digg/]
{/dede:arclist}
The specific detailed code is as follows
- 正在载入,请稍后...
- {dede:arclist row=5 titlelen=24 orderby=digg} {/dede:arclist}
- {dede:arclist row=5 titlelen=24 orderby=digg att=5} {/dede:arclist}
- {dede:arclist row=5 titlelen=24 orderby=click} {/dede:arclist}
DEDE5 With the DIGG function, you can see that the number of "likes" has been increased by 1 after you like it, but if you refresh the page, you will find that the number of "likes" has been restored.
This is because the article has been liked and static HTML has been generated and fixed for display, unless the article is updated in the background next time.
Then I made the following modifications, that is, when the current article When it is liked, the article is updated at the same time so that the number of "likes" in its static HTML is the latest real number.
The modification method is very simple, as follows:
Open the digg.php file in the root directory of DEDE and insert the following three lines of code in line 26
include_once(dirname(__FILE__)."/include/inc_archives_view.php"); $arc = new Archives($aid); $reurl = $arc->MakeHtml();
The home page can be topped How to automatically refresh at once:
Open the diggindex.php file. .
Find
header("Expires:0"); header("Content-Type: text/html; charset=gb2312");
Add
below and the code is as follows:
Home page template add
The code is as follows:
Example:
Template code:
{dede:tag row='10' sort='month' } [field:tagname/] {/dede:tag}
CSS code:
.tag1 { color:#339900;font-weight:bold;} .tag2 { color:#e65730;} .tag3 { color:#00b9da;} .tag4 { color:#FE3981;font-weight:bold;font-size:14px;}
How to change tags:
The popular tags of the month are called by default. If You can think of something else:
Latest tag{dede:tag row='30' sort='new'}[field:highlight/] ([field:result/]){/dede:tag}
Popular tags of the month{dede:tag row='30' sort='month'}[field:tagname/]([field:result/]){/dede:tag}
Random tag{dede:tag row='60' sort='rand'}[field:highlight/]([field:result/]){/dede:tag}
The code of the web page part is as follows:
热门标签
{dede:loop table='dede_search_keywords' sort='keyword' row='40' if=''}
- [field:keyword/] {/dede:loop}
The code of the CSS part is as follows:
.tag1 { color:#339900;font-weight:bold;} .tag2 { color:#e65730;} .tag3 { color:#00b9da;} .tag4 { color:#FE3981;font-weight:bold;font-size:14px;}
Instructions for use: ◆There are 4 color changes in this color keyword code, if you want to add more To change the color, you only need to modify var num=4; and add .tag to the css part. For example: var num=5; add .tag5{ color:#00b9da;} to the css. Of course, you can also modify the corresponding css to change the font color. , size, font...etc., feel free to play with it!
The above is the detailed content of How to call DEDE popular keywords. For more information, please follow other related articles on the PHP Chinese website!