帝國(guó)cms怎么百度自動(dòng)提交

帝國(guó)cms怎么百度自動(dòng)提交

如果你想了解更多關(guān)于帝國(guó)cms的知識(shí),可以點(diǎn)擊:帝國(guó)cms教程

帝國(guó)cms 實(shí)現(xiàn)百度主動(dòng)推送 (非插件)方法。

修改3個(gè)文件找出來(lái)ecmsinfo.php、listinfo.php、userfun.php

1,e/admin/ecmsinfo.php

在任意一個(gè)elseif{….}后添加

elseif($enews=="Post_Baidu_sitemap")//文章實(shí)時(shí)發(fā)送百度 { ????$id=$_POST['id']; ????$urls=$_POST['titleurl']; ????ePostBaiduSitemap($id,$urls);  }

2,e/data/html/list/listinfo.php

<input>"=$checked?&gt;&gt; <input>"&gt;

后面添加

<input>]"?type="hidden"?value='=$titleurl?&gt;'&gt;

在最后一個(gè)標(biāo)簽前添加

??<tr>? ??????<td> ?<input><font><p>備注:多選框藍(lán)色為未審核信息;發(fā)布者紅色為會(huì)員投稿;信息ID粗體為未生成,點(diǎn)擊ID可刷新頁(yè)面.</p></font> </td> ????</tr>

3,e/class/userfun.php添加

//發(fā)送給百度時(shí)時(shí)更新------------------------------- function?ePostBaiduSitemap($id,$_urls){ ????$site?=?'www.xxxxx.com';//你的網(wǎng)站域名 ????$token?=?'xxxxxxx';//百度給的token ????$count?=?count($id);? ????if?(empty($count)) ????{ ????????printerror("未選擇信息ID",?"",?1,?0,?1); ????} ????$urls=array(); ????for($i=0;$i?$api, ????????CURLOPT_POST?=&gt;?true, ????????CURLOPT_RETURNTRANSFER?=&gt;?true, ????????CURLOPT_POSTFIELDS?=&gt;?implode("n",?$urls), ????????CURLOPT_HTTPHEADER?=&gt;?array('Content-Type:?text/plain'), ????); ????curl_setopt_array($ch,?$options); ????$result?=?curl_exec($ch); ????$httpstat?=?curl_getinfo($ch,CURLINFO_HTTP_CODE);? ????curl_close($ch); ????if($httpstat==200){ ????????$obj?=?json_decode($result); ????????printerror("今天剩余{$obj-&gt;remain}條,成功提交{$obj-&gt;success}條",?"",?1,?0,?1); ????}else{ ????????printerror('推送失敗',?"",?1,?0,?1); ????} }

使用:

  網(wǎng)站后臺(tái)——信息

  點(diǎn)擊任意左側(cè)樹(shù)形列表

  在右側(cè)的信息管理勾選要提交給百度的文章

  然后點(diǎn)擊列表下面的批量提交百度!

以上就是

? 版權(quán)聲明
THE END
喜歡就支持一下吧
點(diǎn)贊5 分享