推荐设备MORE

网站建设平台—深圳石岩微信

网站建设平台—深圳石岩微信

行业知识

织梦cmsDedeCMS后台管理加上一键消息推送百度搜索

日期:2021-02-16
我要分享
今日Dede88模版网详细介绍下,根据后台管理加上常见消息推送作用,如:一键消息推送PC、一键消息推送WAP、一键消息推送MIP、一键消息推送熊掌/历史时间、一键消息推送神马等。

织梦cms织梦cmsDedeCMS网站一键消息推送作用有益于检索模块搜索引擎蜘蛛在第一時间爬取到网站的全新內容,百度收录速率迅速提升

织梦DedeCMS后台添加一键推送百度站长、MIP、熊掌号功能

第一步:百度搜索网站站长、MIP、移动消息推送 在织梦cms后台管理文件目录下(默认设置为dede),在建一个baidu.php文档,放进下列编码。


$query = SELECT arch.id,types.typedir FROM dede_arctype as types inner join dede_archives as arch on types.id=arch.typeid ORDER BY pubdate DESC LIMIT $limit //这儿dede换为大家自身的表作为前缀

$urls=

$dsql- Execute( arch.id,types.typedir ,$query);

while($row = $dsql- GetArray( arch.id,types.typedir ))

{

& . , // p> }

$urls=substr($urls,0,-1);

$urls = explode( , ,$urls);

$api = urls?site= token=******** // 前边的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.count($urls);

?


$query = SELECT arch.id,types.typedir FROM dede_arctype as types inner join dede_archives as arch on types.id=arch.typeid where pubdate .$dayEnd. AND pubdate .$dayBegin. //这儿dede换为大家自身的表作为前缀

$urls=

$dsql- Execute( arch.id,types.typedir ,$query);

while($row = $dsql- GetArray( arch.id,types.typedir ))

{

& . , // p> }

$urls=substr($urls,0,-1);

$urls = explode( , ,$urls);

$api = urls?appid=**** token=*** type=realtime // 前边的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.count($urls);

?