phpcms定时发布文章解决办法
phpcms定时发布文章解决办法
phpcms更新文章是一件比较繁琐的事情,如果phpcms能有定时更新文章的功能就好了。这样就可以一次把文章都写好,规定发布时间剩下的事情就交给系统了,通过最近的研究,还真有这种方法。第一步:代码修改
打开phpcms\modules\content\index.php
加入下面函数
/*wlsh 定时发布文章设置 来源程序员人生 www.wfuyu.com 说明: 文章要设置一级审核 并且发布的时候时间要大于当前时间 */ 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]); } } }
第二步:在构造函数中加入调用
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(); //初始化的时候调用定时功能 }
第三步:文章设置一级审核
后台->内容相关设置->栏目管理->修改栏目
第四步:发布文章
发布文章的时候,右边要选择审核,然后时间就是文章自动发布的时间了
系统会判断,如果到时间了,文章就会自动审核通过,也就发布了
到此就完成了phpcms定时发布文章的内容了,有什么bug及时与我联系,本人由程序员人生网独家发布,转载请说明出处
生活不易,码农辛苦
如果您觉得本文的内容对您的学习有所帮助,可以手机扫描二维码进行捐赠

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

1. How can you make money by publishing articles on Toutiao today? How to earn more income by publishing articles on Toutiao today! 1. Activate basic rights and interests: original articles can earn profits by advertising, and videos must be original in horizontal screen mode to earn profits. 2. Activate the rights of 100 fans: if the number of fans reaches 100 fans or above, you can get profits from micro headlines, original Q&A creation and Q&A. 3. Insist on original works: Original works include articles, micro headlines, questions, etc., and are required to be more than 300 words. Please note that if illegally plagiarized works are published as original works, credit points will be deducted, and even any profits will be deducted. 4. Verticality: When writing articles in professional fields, you cannot write articles across fields at will. You will not get appropriate recommendations, you will not be able to achieve the professionalism and refinement of your work, and it will be difficult to attract fans and readers. 5. Activity: high activity,

What should I do if my laptop won’t turn off? With the continuous development of technology, laptops have become an indispensable part of people’s lives. However, sometimes we may encounter a frustrating problem that the laptop won't shut down. Faced with this problem, how should we solve it? This article will discuss the reasons why the computer cannot shut down and how to deal with it. First, let’s take a look at why the laptop won’t shut down. Sometimes, this problem may be caused due to some bugs in the system. For example, it might be because

Many people may encounter the problem of their mobile phones being too cold and automatically shutting down. As mobile phones become more and more important in our lives. It may also have a negative impact on the lifespan of your phone, which is more than just an inconvenience. Provide some solutions. In order to solve this problem, this article will start with the reasons why the mobile phone shuts down when it is too cold. 1. Reasons why the mobile phone shuts down when it is too cold: Understand the root cause of the problem. The internal protection mechanism of the mobile phone will cause the shutdown. The mobile phone is prone to overheating in low temperature environments, and once the temperature drops too fast. 2. How to avoid overcooling your phone: Maintaining a suitable temperature, such as sub-zero outdoor temperatures, can reduce the risk of shutdown due to overcooling by avoiding exposing your phone to extremely cold environments. 3. Avoid using your phone for a long time in cold environments: Using your phone for a long time can cause your phone to overheat.

How to understand @VitalikButerin’s new article’s thoughts on Ethereum’s expansion? Some people say that Vitalik’s order for Blob Inscription is outrageous. So how do blob packets work? Why is the blob space not being used efficiently after the upgrade in Cancun? DAS data availability sampling in preparation for sharding? In my opinion, the performance of Cancun is usable after the upgrade, and Vitalik is worried about the development of Rollup. Why? Next, let me talk about my understanding: As I have explained many times before, Blob is a temporary data package that is decoupled from EVM calldata and can be directly called by the consensus layer. The direct benefit is that EVM does not need to access the Blob when executing transactions. data, thus resulting in lower execution layer computations

In this article, we will learn how to add articles in HTML5. One of the new segmentation elements in HTML5 is the tag. Articles are represented in HTML using tags. More specifically, the content contained within the element is different from the rest of the site's content (even though they may be related). Let us consider the following example to understand how to add an article in HTML5 Example 1 In the following example, we are using inline styles in the article element. <!DOCTYPEhtml><html><body><articlestyle="width:300px;border:2pxsolidgray;padding:

1. Open your phone, click on the WeChat software, and enter the WeChat home page settings. 2. Find [My] in the lower right corner of WeChat, open it, and enter the [My] page. 3. Click Collection and then open a new page.

Toutiao Search Express software not only provides a wealth of article content for users to browse, but also provides a platform for users to express themselves and share knowledge. Many users would like to know whether publishing articles in Toutiao Search Express Edition can make money, so today the editor of this site will introduce in detail whether publishing articles in Toutiao Search Express Edition can make money and how to publish articles. I hope it can help everyone in need. Is there any profit from publishing articles on Toutiao Search Express? Answer: Yes. 1. First, we open the Toutiao search speed version software. On the homepage, we click the [plus icon] in the upper right corner; 2. Then we will come to the page for publishing articles, where we can upload videos, photos, links, and enter text. Wait, everything is set up

php验证session无效问题解决办法。php验证session无效问题解决办法 环境,我用的是apache+php环境了 如我的程序代码如下 代码如下 input name=username type=text class=input id=username inp
