18038435860

JTBC_PHP 3.0.1.6版本增加文章定时发布功能

时间:2018-11-09 10:48:52 点击:734 来源:易速网络

1、数据库jtbc_news增加字段n_timing,类型DATETIME,注释{"fieldType":"text"}
 
<item>
<name><![CDATA[timing]]></name>
<zh-cn><![CDATA[定时]]></zh-cn>
</item>
 
 
$nowTime = base::getDateTime();
    if ($category == 0){
      $sqlstr = "select * from jtbc_news where n_delete=0 and n_publish=1 and n_timing< '" .$nowTime."' order by n_time desc";
    } else {
      $sqlstr = "select * from jtbc_news where n_delete=0 and n_publish=1 and n_timing< '" .$nowTime."' and n_category = '" .$category."' order by n_time desc";
    }
    $pagi = new pagi();
    $rsAry = $pagi -> getDataAry($page, $pagesize, $sqlstr);
 
~~~~~~~~~~~~~~~~~~~~~~~~~
4、/*$dal = new dal();
    到
    $rsAry = $pagi -> getDataAry($page, $pagesize);*/
    注析掉32到42行
 
5、设置发布时间,定时发布时间格式2018-11-09 10:45:28,点发布开关到绿色发布状态,然后提交。