Home > CMS Tutorial > DEDECMS > body text

How to determine whether a dedecms article is included or not

angryTom
Release: 2019-07-27 17:12:32
Original
2368 people have browsed it

How to determine whether a dedecms article is included or not

If you want to know more about dedecms. You can click: DEDECMS tutorial

 dedecms background query whether the article is included in Baidu, this is a small function, online There are also similar functions made by other experts, but the ones I found all charge a fee, and in my opinion are very expensive and bloated. They use ajax for dynamic updates, which I feel is unnecessary. As long as the article is included in Baidu, it is not updated every day. All we need to know is whether this article has been included. Maybe you can check it once a month or once a week. You don't need to check it every time you open the list, which consumes too many resources. Based on this, I am not very talented, so I pieced together this small function without borrowing anyone else's program. I am also a newbie in PHP and know very little about PHP. Maybe the program is not perfect enough, but in my opinion, it is indeed enough.

Note: Due to poor consideration, the address of the internal page of the website is not in a pseudo-static form. It will be very troublesome to use. Please be careful when downloading.

First of all, here is the rendering:

How to determine whether a dedecms article is included or not

1. Understand the functions implemented by this plug-in.

DEDECMS background query plug-in to query whether articles are included in Baidu is based on the document batch maintenance function in the dede background. It adds a field kdate to the main data table archives to store Baidu snapshot data. , the background queries whether each article has a snapshot in Baidu. If it does not exist, it will be written as not included. If it exists, the snapshot date will be written.

2. Specific implementation method

#1. Download the compressed package, decompress it to get the module file, upload the module in the background and install it .

2. The plug-in cannot be used normally after installation. You need to do the following operations: (Note: The reason why the plug-in cannot be used after installation is because the author’s background files have been changed, not The original one, and I don’t want to replace the original one. I am afraid that there will be problems after the user installs it, so the module package does not include the template.)

Open the backend directorydede/templets/content_batch_up.htm , find: "Delete Document" four words, add below it:

<input name="action" type="radio" class="np" id="delradio" value="zhizhu" onClick="ShowHideMove()" />  
       验证是否被百度收录
Copy after login

This is mainly to add the "Verify whether it is included by Baidu" option in the Core-Batch Maintenance-Document Batch Maintenance page. This plug-in is based on Document batch maintenance function, as shown below:

How to determine whether a dedecms article is included or not

Open zhizhu.php and find:

$domain = "http://www.daimajiayuan.com/sitejs-".$id."-1.html";/*欲查询的页面*/
Copy after login

The author does not know what your page address is, so he needs you Change it manually. $id is the ID of the article. The code in double quotes on both sides can be changed according to your own URL. If you use pseudo-static, it is the easiest. If it is a dynamic address, such as this address:

http://www.xxx.com/plus/view.php?aid=11824
Copy after login

needs to be changed to:

$domain = "http://www.xxx.com/plus/view.php?aid=".$id;/*欲查询的页面*/
Copy after login

Open the dede/templets/content_list.htm file and find:

colspan="10"
Copy after login

Change to:

colspan="11"
Copy after login

(Students who know html should understand.) This is the beginning of adding table columns. Find

<td width="8%">权限</td>
Copy after login

and add at the end:

<td width="8%">快照日期</td>
Copy after login

Grasp this percentage yourself, and then Find again:

<td>{dede:field.arcrank function="GetRankName(@me)"/}</td>
Copy after login

Add:

<td>{dede:field.kdate/}</td>
Copy after login

Open content_list.php and find:

$query = "SELECT arc.id,arc.typeid,arc.senddate,arc.flag,arc.ismake,
Copy after login

Add

arc.kdate,
Copy after login

after the half-width comma. Here, The code changes are complete. Go to the backend to try out the function.

In Core--Batch Maintenance--Document Batch Maintenance, you can choose to do it by column or ID range, as shown in the above picture, the following picture will be displayed after it is completed.

How to determine whether a dedecms article is included or not

#After completing the query, you will know that your article has not been included. According to my own usage, it takes about 40 minutes to query 1W articles. The accuracy rate is above 99%. Why do we say this? Due to network reasons, some URL crawling may time out and be skipped. But we have tried our best to avoid it in the program. In this case, do not spray.

The above is the detailed content of How to determine whether a dedecms article is included or not. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!