- /*wlsh
- 定時(shí)發(fā)布文章設(shè)置 來源程序員人生 www.vxbq.cn
- 說明:
- 文章要設(shè)置一級審核 并且發(fā)布的時(shí)候時(shí)間要大于當(dāng)前時(shí)間
- */
- 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]);
- }
- }
- }
第二步:在構(gòu)造函數(shù)中加入調(diào)用
- 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(); //初始化的時(shí)候調(diào)用定時(shí)功能
- }
第三步:文章設(shè)置一級審核
后臺->內(nèi)容相關(guān)設(shè)置->欄目管理->修改欄目
第四步:發(fā)布文章
發(fā)布文章的時(shí)候,右邊要選擇審核,然后時(shí)間就是文章自動發(fā)布的時(shí)間了
到此就完成了phpcms定時(shí)發(fā)布文章的內(nèi)容了,有什么bug及時(shí)與我聯(lián)系,本人由程序員人生網(wǎng)獨(dú)家發(fā)布,轉(zhuǎn)載請說明出處
上一篇 漢化InnoSetup5.5
下一篇 There is no Action mapped for namespace [/] and action name [Login] associated w