名站网址导航为大驾家提供DedeCMS站点程序站点教程相关的知识,比如织梦程序安装教程,织梦程序系统故障等教程。DedeCMS站点程序5.7百度主动推送PhP相关具体代码如下,如果,你还是不明白,那。。。。只能帮你到这里了…
这是干货,懂点相关具体代码如下的可以自己延伸(保存为任意php网站文件,放到plus目录下,访问看下结果?)。另外,避免手动提交的麻烦,可以服务器端设置个时间每天自动执行。
<?php
require_once(dirname(__FILE__).'/../include/common.inc.php');
require_once(DEDEINC."/channelunit.class.php");
$whereSql = '';
//设置推送时间 每天有指定配额
$year = date("Y");
$month = date("m");
$day = date("d");
$dayBegin = mktime(0,0,0,$month,$day,$year);//当天开始时间戳
$dayEnd = mktime(23,59,59,$month,$day,$year);//当天结束时间戳
$whereSql = "where arc.pubdate<".$dayEnd." AND arc.pubdate>".$dayBegin;
$query = "SELECT arc.*,tp.* FROM `2ky_archives` arc
LEFT JOIN `2ky_arctype` tp ON arc.typeid=tp.id
$whereSql
ORDER BY arc.id DESC";
//下面网址换成自己的站点
$urls = "";
$dsql->SetQuery($query);
$dsql->Execute();
while($row = $dsql->GetArray())
{
$urls .= "http://www.mzdh.net".GetFileUrl($row['id'],$row['typeid'],$row['senddate'],$row['title'],$row['ismake'],
$row['arcrank'],$row['namerule'],$row['typedir'],$row['money'],$row['filename'],$row['moresite'],$row['siteurl'],$row['sitepath']).",";
}
$urls = substr($urls,0,-1);
$urls = explode(",",$urls);
//api url换成自己的,站长工具里有
$api = 'http://data.zz.baidu.com/urls?site=www.mzdh.net&token=uUGps6ZBwuEYk0LW';
$ch = curl_init();
$options = array(
CURLOPT_URL => $api,
CURLOPT_POST => true,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_POSTFIELDS => implode("\n", $urls),
CURLOPT_hTTPhEADER => array('Content-Type: text/plain'),
);
curl_setopt_array($ch, $options);
$result = curl_exec($ch);
echo $result;
?>
关于DedeCMS站点程序站点教程相关的知识,就说到这里了希望能帮助朋友们。修改织梦程序dedeCMS简略文章标题字数的相关具体操作方法