文章来源:http://www.imtr.cn/html/n12.html
打开织梦后台目录下的article_add.php,大概第262行
找到:“//返回成功信息”
在这一行代码的上面加入以下代码:
$urls=$artUrl; $urls = explode(",",$urls); $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);
这样每发布一篇文章,都会自动把当前文章url向百度推送
原文地址:http://www.imtr.cn/html/n12.html