织梦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文件复制保存在根目录,打开即可

以上内容来源于网络,如有侵权,请联系删除,给您带来的不便,敬请谅解,谢谢!
吾爱豆 » 织梦CMS百度、mip推送代码

发表评论

现在注册会员,免费送一年超级VIP

查看演示 官网购买