欧美日韩国产成人在线,亚洲日韩一欧美,一区二区高清,欧美中文字幕一区二区三区

18038435860

JTBC_PHP 3.0.1.6版本增加文章定時(shí)發(fā)布功能(二)

時(shí)間:2018-11-30 23:19:19 點(diǎn)擊:617 來源:易速網(wǎng)絡(luò)

1、數(shù)據(jù)庫jtbc_news增加字段n_timing,類型DATETIME,注釋{"fieldType":"text"}
 
<item>
<name><![CDATA[timing]]></name>
<zh-cn><![CDATA[定時(shí)]]></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 -> orderBy('time', 'desc');
$pagi = new pagi($dal);
$rsAry = $pagi -> getDataAry($page, $pagesize);*/
    注釋掉這3行
 
5、設(shè)置發(fā)布時(shí)間,定時(shí)發(fā)布時(shí)間格式2018-11-09 10:45:28,點(diǎn)發(fā)布開關(guān)到綠色發(fā)布狀態(tài),然后提交。

 

1.jtbc.push.js放至/console/common/assets/js
2.push.inc.php放至/console/common/incfiles
3.在/news/template/manage.jtbc中查找
<name><![CDATA[list]]></name>節(jié)點(diǎn),注意是[list]節(jié)點(diǎn),在第3個(gè)<default><![CDATA[<nav genre="{$=$genre}"><span>{$-account-nav}{$=universal\category::getCategoryNavByID($getPara('genre'), '{$-lang}', '{$-nav-category}')}</span></nav>
后添加<script type="text/javascript" src="{$=$assetspath}/js/jtbc.push.js"></script>

 

如果你在其他地方調(diào)用新聞標(biāo)題列表,比如首頁,就加上一句SQL

比如這個(gè)<jtbc $function="transfer" $parameter="genre=news;type=new;limit=6;osql= and n_time<now()">

還有這個(gè){$=transfer('genre=news;category=3;type=new;limit=24;osql= and n_time<now();baseurl=./;tpl=news_list')}

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

jtbc.push.js代碼如下

$(document).ready(function(){
var s = jQueryAjaxPost("2");
});
function jQueryAjaxPost(pushData) {
var return_data = "";
$.ajax({
type: "POST",
dataType: "json",
url: "common/incfiles/push.inc.php",
data: pushData,
async: false,
success: function(data, status) {
if(status == "success") {
return_data = data;
} else {
return_data = "error";
}
}
});
return return_data;
}

 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

push.inc.php代碼如下

<?php
include_once ("../../../common/incfiles/const.php");
$r = array();
@$db = mysqli_connect(DB_HOST, DB_USERNAME, DB_PASSWORD, DB_DATABASE);
if (mysqli_connect_errno()) {
echo json_encode("sorry,the conntect had some wrongs");
exit ;
}
$read = "select n_id,n_time,n_timing from jtbc_news where n_id=(select max(n_id) from jtbc_news)";
$result = mysqli_query($db, $read);
$rownumber = mysqli_num_rows($result);
for ($i = 0; $i < $rownumber; $i++) {
$row = mysqli_fetch_assoc($result);
array_push($r, $row['n_id'], $row['n_time'],$row['n_timing']);
}
if(($r[2]!=null)&&($r[1]!=$r[2])){
$up="update jtbc_news set n_time='$r[2]' where n_id='$r[0]'";
mysqli_query($db, $up);
}
mysqli_close($db);
echo json_encode("ok");
?>

 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

天天看高清无码| 一本色道久久综合亚洲精品东京热| 四虎国产精品永久在线| 肉大捧一进一出好爽mba| 亚洲中文字幕最新| 精品一区二区欧美| 宅男666在线永久免费观看| 午夜不卡av| 中文字幕高清av| 最新AV电影网站| 午夜AV影视| 亚洲性爱综合| 97无码人妻精品免费一区二区| 久久另类TS人妖一区二区| 亚洲av无码一区二区乱子伦| 人妻av一区二区| 91看片麻豆| 91精品国产自产在线| 97国产精品| 少妇把腿扒开让我添6912p| 97精品人人槡人妻人人| 超碰国产97| 精品成人在线| 欧美偷拍| 精品无码视频一区二区三区| 亚洲精品五月天| 亚洲视频在线观看一区二区| 亚洲av乱码一区二区三区香蕉| 日韩内射视频| 91综合国产| 女人18毛片免费看| 最好看的2018中文在线观看| 日韩亚洲电影网| 亚洲色大情网站www永久网站| 久久91精品国产一区二区| 国内精品久| 国产成人亚洲精品青草天美| 亚洲午夜av在线| 午夜精品福利一区二区蜜股av| 日韩精品免费观看视频| 91精品国产桃色无码久久久久|