织梦CMS百度、mip推送代码

织梦dedecms MIP推送代码,支持普通推送、mip推送,不限制条数的推送。

[adsense]

require_once (“include/common.inc.php”);
$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);
$bdapiz = $dsql->GetOne(“SELECT value FROM dede_sysconfig where varname=’cfg_zjapi'”);
$bdapi = $bdapiz[‘value’];
$query = “SELECT arch.id,types.typedir FROM dede_arctype as types inner join dede_archives as arch on types.id=arch.typeid order by id desc limit 9999″;
//999是读取的链接条数,如果你没有达到9999条数,以你网站最大的文章输出(你的网站200篇文章就输出200篇文章),如果网站文章数超过9999就自己改下更大的数字~
$urls=””;
$dsql->Execute(‘arch.id,types.typedir’,$query);
while($row = $dsql->GetArray(‘arch.id,types.typedir’))
{
$urls.=”http://改成你的网址”.str_replace(“{cmspath}”,””,$row[‘typedir’]).”/”.$row[id].”.html”.”,”;
}
$urls=substr($urls,0,-1);
$urls = explode(“,”,$urls);
$api = ‘你站长平台的推送接口地址’; //你的api
$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;
echo “<pre>”;print_r($urls);echo “<pre>”;

[adsense]

$api 也可以放你的mip推送代码就可以实现mip推送。

.php文件复制保存在根目录,打开即可

END

原创文章,作者:Admin,如若转载,请注明出处:https://www.52d.top/svip/4432.html

发表评论

电子邮件地址不会被公开。 必填项已用*标注

联系我们

400-800-8888

在线咨询:点击这里给我发消息

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息