search
HomeCMS TutorialDEDECMSHow to use the DEDE Dreamweaver planning task function to regularly update the homepage

How to use the DEDE Dreamweaver planning task function to regularly update the homepage

How to use the DEDE Dreamweaver scheduled task function to regularly update the homepage?

dedecms Dreamweaver system has a plan in the background I believe many people don’t know how to use the task function, and there is no detailed explanation. Here we will use a practical case to explain how to use scheduled tasks to automatically update the homepage of the website every 5 minutes.

Recommended learning: 梦Weavercms

Regularly update the homepage index.html file. The advantage of updating is that when search engine spiders crawl index.html, Status code 304 will not be returned. The search engine will determine the update time of your HTML file and compare it with the previous index time. If there is an update, it will be included. If there is no update, it will set the 304 status and not update.

The following is a detailed description of how to use scheduled tasks:

First enter the background-system-scheduled task management

After entering, you can see an instruction for executing scheduled tasks:

Instructions for scheduled task execution

In order to ensure that the task can be fully executed, it is recommended to use Dede's client tool, otherwise it can only be triggered through JS, but there are many uncertain factors in JS triggering that will cause the task to not be completed. ;

JS triggering method: Use JS to call /plus/task.php?client=js in all document pages (the password for scheduled tasks must be disabled, system configuration parameters-> other options);

Customize your own client: Directly access "http://website/plus/task.php?clientpwd=Management Password", which will return the URL of one of the executable tasks (if there is no available task, the string: notask will be returned), and then The client can run this URL.

Next we create a new scheduled task. The task needs to have a PHP execution file to generate the website homepage:

plus.zip

How to use the DEDE Dreamweaver planning task function to regularly update the homepage

Upload the dede-post.php file after unzipping the attachment to plus/task/ in the website directory

In order to update the website every 5 minutes, we also need to modify the file plus/task/ task.php

Open task.php and change the $daylimit parameter to 300 seconds - $daylimit = 300; if you need to change it to other times, you can modify it yourself and then upload it. At this point, the conditions for basic task execution are all there, but there is still a trigger method. Here we choose to use the JS file triggering method, which can be triggered as long as a visitor accesses it. If your website is often visited by no one, you can only manually access the trigger.

We copy the code: and put it in the bottom template footer.htm .

In this way, every time someone visits your website, this JS will be triggered, allowing your execution program to run, that is, the website will automatically update.

The above is the detailed content of How to use the DEDE Dreamweaver planning task function to regularly update the homepage. For more information, please follow other related articles on the PHP Chinese website!

Statement
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

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
4 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Best Graphic Settings
4 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. How to Fix Audio if You Can't Hear Anyone
4 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
WWE 2K25: How To Unlock Everything In MyRise
1 months agoBy尊渡假赌尊渡假赌尊渡假赌

Hot Tools

VSCode Windows 64-bit Download

VSCode Windows 64-bit Download

A free and powerful IDE editor launched by Microsoft

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Dreamweaver Mac version

Dreamweaver Mac version

Visual web development tools

mPDF

mPDF

mPDF is a PHP library that can generate PDF files from UTF-8 encoded HTML. The original author, Ian Back, wrote mPDF to output PDF files "on the fly" from his website and handle different languages. It is slower than original scripts like HTML2FPDF and produces larger files when using Unicode fonts, but supports CSS styles etc. and has a lot of enhancements. Supports almost all languages, including RTL (Arabic and Hebrew) and CJK (Chinese, Japanese and Korean). Supports nested block-level elements (such as P, DIV),

Atom editor mac version download

Atom editor mac version download

The most popular open source editor