找到文件:post_newthread.php。
备份该文件以防止意外情况:
备份:post_newthread.php。
编辑:post_newthread.php。
接下来,在文件中搜索以下代码段:
- showmessage($return, $returnurl
- ox_baidu_url_submit(array($tid));
function ox_baidu_url_submit($tids){
foreach ($tids as $key => $value){
$urls[] = 'http://你的域名/forum.php?mod=viewthread&tid=' . $value;
}
$api = 'http://data.zz.baidu.com/urls?site=你的域名&token=你的Tonken';
$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);
return $result;
}