dede发布,修改文章时候主动推送给百度。
织梦的这二个文档默认存于,/dede/ 文件夹根目录中, 根据内容模型,默认如下,
文章模型,article_add.php(发布文档);article_edit.php(修改文档)
图片模型,album_add.php (发布文档);album_edit.php(修改文档)
修改发布文档,搜索
$artUrl = MakeArt($arcID, true, true,$isremote); if($artUrl=='') { $artUrl = $cfg_phpurl."/view.php?aid=$arcID"; } |
在下边加入
$urls[]='http://'.$_SERVER['HTTP_HOST'].$artUrl;
$api = 'http://data.zz.baidu.com/urls?site=www.jstzts.com&token=RRiU4GNGYaadd6MH';
$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);
}
还有一种这么加:(暂时没用)
else{
$urls = array($artUrl);
$api = 'http://data.zz.baidu.com/urls?site=www.*******.com&token=**********';
$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.$artUrl;
}
紧接着继续找到,
<a href='catalog_do.php?cid=$typeid&dopost=listArchives'><u>已发布文章管理</u></a>
在下边加入:
<a href=''><u>百度提交返回".$result."</u></a>
