一、用FTP下载文件:
dede/templets/article_add.htm
dede/templets/article_edit.htm
二、然后用编辑器打开:(友情提示:用编辑器打开之前最好做一个备份)在上个</tr>结束标签后面添加我们的代码:两个文件都添加这个内容,然后上传;
![]()
<!-- 推送代码 -->
<tr>
<td width="100%" height="24" colspan="2" class="bline">
<table width="800" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="90"> 提交连接:</td>
<td><input name="auto_submit_baidu" type="checkbox" class="np" id="auto_submit_baidu" value="1" />百度</td>
</tr>
/table>
</td>
</tr>
<!-- 推送代码 -->
三、在FTP上下载:(同样的做个备份,总是没错的,如果大意之下把其它地方碰着了,你都不知道是哪里改了)
dede/article_add.php
dede/article_edit.php
四:打开文件,搜索:$artUrl = $cfg_phpurl."/view.php?aid=$id";找到之后添加我们调用代码:两个文件都要这个代码,之后上传就可以。
![]()
else{
if($auto_submit_baidu){
$urls = array('http://'.$_SERVER['HTTP_HOST'].$artUrl);
$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;
}
}
最后的结果是这样:
![]() |