In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-01 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/02 Report--
Call the method of hot keywords in DEDE? This problem may be often seen in our daily study or work. I hope you can gain a lot from this question. The following is the reference content that the editor brings to you, let's take a look at it!
How to call the DEDE popular keyword?
DEDE hot tag,DEDE home page digg,DEDE random hot keyword call method, friends in need can refer to the following
Recommended study: dream weaving cms
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 detailed code is as follows
Hot recommendation concerns are being loaded. Please wait later. {dede:arclist row=5 titlelen=24 orderby=digg} [field:digg/] [field:textlink/] [field:pubdate function=strftime ('% Mmuri% dongma mai me) /] [field:info/]. {/ dede:arclist} {dede:arclist row=5 titlelen=24 orderby=digg att=5} [field:digg/] [field:textlink/] [field:pubdate function=strftime ('% MMMI% danzhongmei) /] [field:info/]. {/ dede:arclist} {dede:arclist row=5 titlelen=24 orderby=click} [field:digg/] [field:textlink/] [field:pubdate function=strftime ('% MMMI% danzhongmei) /] [field:info/]. {/ dede:arclist}
DEDE5's DIGG function, you can see that the number of "tops" has been added by 1, but if you refresh the page, you will find that the number of "tops" has been restored.
This is because the top number of articles has been generated and static HTML has been generated and fixed to display, unless the next time the background updates this article
So I made the following changes, that is, when the current article is topped, update the article at the same time so that the "top" number in its static HTML is the latest real number.
The modification method is simple, as follows:
Open the digg.php file in the DEDE root directory and insert the following three lines of code on line 26
Include_once (dirname (_ FILE__). "/ include/inc_archives_view.php"); $arc = new Archives ($aid); $reurl = $arc- > MakeHtml ()
The method of automatically refreshing the home page at the top:
Open the diggindex.php file.
find
Header ("Expires:0"); header ("Content-Type: text/html; charset=gb2312")
Add below
The code is as follows:
If ($action = = indexdigg) {echo'. $row ['digg'].'; echo "; exit ();}
Home page template added
The code is as follows:
Function Digg (divId,aid) {var taget_obj = document.getElementById (divId+''+aid); var myajax = new DedeAjax (taget_obj,false,false, "); myajax.SendGet2 (" / diggindex.php?action=indexdigg&aid= "+ aid); DedeXHTTP = null;}
Example:
Function Digg (divId,aid) {var taget_obj = document.getElementById (divId+''+aid); var myajax = new DedeAjax (taget_obj,false,false, "); myajax.SendGet2 (" / diggindex.php?action=indexdigg&aid= "+ aid); DedeXHTTP = null;} DIGG rank {dede:arclist row=9 titlelen=24 infolen='29' orderby=digg} [field:digg/] [field:textlink/] [field:info/]. {/ dede:arclist}
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 the label:
The popular tag of the month is called by default. If you want to switch to other tags, you can:
Latest tag {dede:tag row='30' sort='new'} [field:highlight/] ([field:result/]) {/ dede:tag}
The popular hashtag 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 for the web page section is as follows:
Popular label
{dede:loop table='dede_search_keywords' sort='keyword' row='40' if=''} [field:keyword/] {/ dede:loop}
The code for the CSS section 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: ◆ this color keyword code has 4 color changes, if you want to add more color changes, just modify var num=4; and css to add .tag for example: var num=5; css to add .tag5 {color:#00b9da;}, of course, you can also modify the corresponding css, change the font color, size, font. Wait, let's do it freely!
Thank you for reading! After reading the above, do you have a general idea of how to call popular keywords in DEDE? I hope the content of the article will be helpful to all of you. If you want to know more about the relevant articles, you are welcome to follow the industry information channel.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.