赞
踩
1、打开api\extend.func.php 【注意你这个文件有没有进行过二次开发,如果有,就降下面的复制进去即可】
增加函数:
//S baidutuisong
function baiduping($url){
global $DT;
$api = "百度推送接口";
$ch = curl_init();
$options = array(
CURLOPT_URL => $api,
CURLOPT_POST => true,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_POSTFIELDS => $url,
CURLOPT_HTTPHEADER => array('Content-Type: text/plain'),
);
curl_setopt_array($ch, $options);
$result = curl_exec($ch);
$result = json_decode($result, true);
if($result['not_same_site']){
$code = '推送地址错误';
}
if($result['error']){
$code = $result['message'];
}
if($result['success']){
$code = $result['success'];
//echo '今天剩余:'.$result['remain'].'条';
}
return $code;
}
//E baidutuisong
2、打开module\mall\mall.class.php(其他模块的打开module\模块名称\模块名称.class.php)
2-1、搜索:
function _($e) {
在上面增加:
//S baidutuisong
function baidu($itemid) {
global $_username, $MOD;
if(is_array($itemid)) {
foreach($itemid as $v) { $this->baidu($v); }
} else {
$this->itemid = $itemid;
$item = $this->get_one();
$item['linkurl'] = $MOD['linkurl'].$item['linkurl'];
$baidu = baiduping($item['linkurl']);
return true;
}
}
//E baidutuisong
2-2、搜索:
if($post['status'] == 3 && $post['username'] && $MOD['credit_add']) {
credit_add($post['username'], $MOD['credit_add']);
credit_record($post['username'], $MOD['credit_add'], 'system', lang('my->credit_record_add', array($MOD['name'])), 'ID:'.$this->itemid);
}
在下面增加:
//S baidutuisong
if($post['status'] == 3) $this->baidu($this->itemid);
//E baidutuisong
文章转自www.dir9.com
赞
踩
赞
踩
赞
踩
赞
踩
赞
踩
赞
踩
赞
踩
赞
踩
赞
踩
赞
踩
赞
踩
赞
踩
赞
踩
赞
踩
赞
踩
赞
踩
赞
踩
赞
踩
赞
踩
赞
踩
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。