Phpcms regularly releases the article solution. The solution to regularly publishing articles in phpcms is complicated to update articles in phpcms. it would be nice if phpcms could update articles regularly. In this way, you can write all the articles in phpcms and publish the articles regularly.
Updating phpcms articles is a complicated task. it would be nice if phpcms could update the articles on a regular basis. In this way, you can write all the articles at a time, and leave the rest of the release time to the system. through recent research, this method is actually available.
Step 1: code modification
Open phpcms \ modules \ content \ index. php
Add the following function
/* Wlsh timed release article set source programmer life www.wfuyu.com note: The article should set a level-1 review and release time should be later than the current time */public function dingshi () {$ this-> content_check_db = pc_base: load_model ('content _ check_model '); $ ids = $ this-> content_check_db-> select ('status = 1 and username = "admin" and inputtime <= '. SYS_TIME, 'checkid'); if (! Empty ($ ids) {foreach ($ ids as $ k) {$ k1 = explode ('-', $ k ['checkid']); $ this-> db-> set_model ($ k1 [2]); $ this-> db-> status ($ k1 [1]) ;}}
Step 2: Add a call to the constructor
Function _ construct () {$ this-> db = pc_base: load_model ('content _ Model'); $ this-> _ userid = param :: get_cookie ('_ userid'); $ this-> _ username = param: get_cookie (' _ username'); $ this-> _ groupid = param :: get_cookie ('_ groupid'); $ this-> dingshi (); // call the scheduled function during Initialization}
Step 3: set a level-1 review
Background-> content-related Settings-> Topic management-> modify a topic
Step 4: publish an article
When publishing an article, select review on the right, and the time is the time when the article is automatically published.
The system will judge that if the time is up, the article will be automatically approved and published
Now we have completed the regular release of phpcms articles. please contact me if you have any bugs. I am exclusively released by the programmer's Life Network. For more information, see the source.
Difficult to live, hard work for coders
If you think the content in this article is helpful to your learning, you can scan the QR code on your mobile phone to donate
Phpcms is a tedious task to update an article. if phpcms can update the article regularly, it will be fine. In this way, you can write all the articles at a time...